Friday, December 31, 2010

Export Active Directory data

Show me the samid and upn name of all disabled user accounts in the domain.

C:\>dsquery user -disabled | dsget user -samid -upn


Show me the samid and upn of each user account in the domain and show me when the user account expires.

C:\>dsquery user | dsget user -samid -upn -acctexpires


Show me the samid and upn of each user account in the domain and show me when the user account expires. Send output to a file called c:\log.txt

C:\>dsquery user | dsget user -samid -upn -acctexpires > c:\log.txt


Show me the samid and upn name of each user account in the Production OU in the TEST.COM domain with a password age of 14 days or older and also show me if the account is flagged for "user must change password" and if the user account is allowed to change its password

C:\>dsquery user "OU=Production,DC=test,DC=com" -stalepwd 14 | dsget user -samid -upn -mustchpwd -canchpwd

No comments: