Retrieve a list of users ...


i need retrieve list of users from 2003 ad are  home office users either or without email currently.  our home office users spread throughout our ad users want filter out 'sales office' exist in either 'sales force' ou (or sub ou of sales force).  filter out accounts created voice mail, (they on servers 'diverse' , 'universe').

thanks in advance help

i assume "ou=sales office" child (sub ou) of "ou=sales force". if intent retrieve users in "ou=sales force", not in child ou's, can specify scope of query onelevel. using dsquery example:

dsquery user "ou=sales force,dc=mydomain,dc=com" -scope onelevel -limit 0

must specify full distinguished name of ou. if, however, want include child ou's of "ou=sales force" except "ou=sales office", cannot done in query. must retrieve users in "ou=sales force" (using default scope of subtree), in script parse users eliminate in "ou=sales office".

also, there 2 email attributes in ad, mail , proxyaddresses. neither indicates exchange server. separate query required, unless have other way determine if account voice mail (like telephone attribute - check in aduc). in case, think need specialized script.

 


richard mueller - mvp directory services


Windows Server  >  Directory Services



Comments

Popular posts from this blog

WIMMount (HSM) causing cluster storage to go redirected (2012r2 DC)

Failed to delete the test record dcdiag-test-record in zone test.com

Azure MFA with Azure AD and RDS