Here is a simple script that you can run at the power-shell cmd line to get the properties associated with an AD user: (where JDoe is the AD userid)
(([directoryservices.directorysearcher] "(samaccountname=JDoe)").findall())[0].Properties
You can get at a particular property such as the objectId using the following statement:
[guid]((([directoryservices.directorysearcher] "(samaccountname=JDoe)").findall())[0].properties.getenumerator() | ? { $_.name -eq "objectguid"}).value[0]
No comments:
Post a Comment