Advertisement
Combreal

ildapLinuxPowerShell.ps1

Sep 23rd, 2020 (edited)
1,324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $login = "conio"
  2. $domain = "LDAP://ildap.dbs.fr:389/OU=people,DC=dbs,DC=FR"
  3. $Filter = "(&(objectClass=*)(login=$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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement