Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #need empty line at the end
- $cred = Get-Credential -credential conio@ad.dbs.fr
- $username = $cred.username
- $password = $cred.GetNetworkCredential().password
- $de = New-Object System.DirectoryServices.DirectoryEntry("LDAP://ad.dbs.fr", $username, $password)
- $searcher = New-Object System.DirectoryServices.DirectorySearcher($de,"(&(objectCategory=Computer)(CN=mymachine))")
- $searcher.FindOne().GetDirectoryEntry()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement