Combreal

ildapLinuxPowerShell.ps1

Sep 23rd, 2020 (edited)
691
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $login = "fm"
  2. $domain = "LDAP://ildap.inria.fr:389/OU=people,DC=inria,DC=FR"
  3. $Filter = "(&(objectClass=*)(inriaLogin=$login))"
  4. $Entry = New-Object System.DirectoryServices.DirectoryEntry($domain,$null,$null,'FastBind')
  5. $Searcher = New-Object System.DirectoryServices.DirectorySearcher($Entry,$Filter)
  6. $Result = $Searcher.FindOne()
  7. $Result.Properties.mail
  8. #Get list of ldap fields :
  9. #$list = $Result.Properties
  10. #$list
RAW Paste Data