Posted on 2014-11-17
I need to run the below script for an application vendor. Can someone explain what the following command does? I know the script will harvest information such as email address, title and so on in active directory but I would like to understand the detail.
Our users in AD are mostly in the USER container and there are some other groups scattered in other OUs. Should I run the below in ourdomain.com? If yes, do I need to specify or it will run from ourdomain.com by default?
Please advise. Many thanks.
Get-ADUser –LDAPFilter "(&(objectCategory=person)(objectClass=user)(!userAccountControl:1.2.840.113522.214.171.1243:=2) (mail=*))" -Properties OfficePhone,EmailAddress,Title,Office,Department,Description,Manager | Set-Custodian -Company <company>