Dsquery * -limit 0 -filter "&(objectClass=User)(objectCategory=Person)" -attr * >>AllUsers.txt
Get-ADUser -Filter * -property *
Get-ADUser -F * -PR *
Get-QADUser -Name * -sizelimit 0 | select givenName,sn,name,PasswordExpires | Export-CSV c:\pass_exp.csv
PS C:\> get-aduser -f * -Searchbase "ou=powershell,dc=contoso,dc=com" -pr SamAccountName,PasswordExpired,whenChanged,UserPrincipalName Find users attributes (Users input from a Text file) PS C:\> get-content c:\users.txt | get-aduser -pr SamAccountName,PasswordExpired,whenChanged,UserPrincipalName DistinguishedName : CN=rock,CN=Users,DC=contoso,DC=com Enabled : True GivenName : rock Name : rock ObjectClass : user ObjectGUID : 57bcbc28-c46a-4ba3-8cad-db4eada9230e PasswordExpired : True SamAccountName : rock SID : S-1-5-21-359348832-1345755819-277917231-1109 Surname : UserPrincipalName : rock@contoso.com whenChanged : 9/19/2013 7:51:09 AM DistinguishedName : CN=Administrator,CN=Users,DC=contoso,DC=com Enabled : True GivenName : Name : Administrator ObjectClass : user ObjectGUID : d7d91e0a-e25d-4adc-8c70-8197afd698e4 PasswordExpired : False SamAccountName : Administrator SID : S-1-5-21-359348832-1345755819-277917231-500 Surname : UserPrincipalName : whenChanged : 9/10/2013 7:37:38 AM DistinguishedName : CN=copy,CN=Users,DC=contoso,DC=com Enabled : True GivenName : copy Name : copy ObjectClass : user ObjectGUID : e3867e09-2f04-4238-aa36-aa1c83323d08 PasswordExpired : True SamAccountName : copy SID : S-1-5-21-359348832-1345755819-277917231-1106 Surname : UserPrincipalName : copy@contoso.com whenChanged : 9/3/2013 4:19:17 PM
PS C:\>
DistinguishedName : CN=rock,CN=Users,DC=contoso,DC=com
Enabled :
True
GivenName : rock
Name : rock
ObjectClass : user
ObjectGUID : 57bcbc28-c46a-4ba3-8cad-db4eada9230e
PasswordExpired :
SamAccountName : rock
SID : S-1-5-21-359348832-1345755819-277917231-1109
Surname :
UserPrincipalName : rock@contoso.com
whenChanged : 9/19/2013 7:51:09 AM
DistinguishedName : CN=Administrator,CN=Users,DC=contoso,DC=com
GivenName :
Name : Administrator
ObjectGUID : d7d91e0a-e25d-4adc-8c70-8197afd698e4
False
SamAccountName : Administrator
SID : S-1-5-21-359348832-1345755819-277917231-500
UserPrincipalName :
whenChanged : 9/10/2013 7:37:38 AM
DistinguishedName : CN=copy,CN=Users,DC=contoso,DC=com
GivenName : copy
Name : copy
ObjectGUID : e3867e09-2f04-4238-aa36-aa1c83323d08
SamAccountName : copy
SID : S-1-5-21-359348832-1345755819-277917231-1106
UserPrincipalName : copy@contoso.com
whenChanged : 9/3/2013 4:19:17 PM
001.
AccountExpirationDate :
002.
accountExpires : 9223372036854775807
003.
AccountLockoutTime :
004.
AccountNotDelegated :
005.
AllowReversiblePasswordEncryption :
006.
BadLogonCount : 0
007.
badPasswordTime : 0
008.
badPwdCount : 0
009.
CannotChangePassword :
010.
CanonicalName : contoso.com/Powershell/Ankur Seth
011.
Certificates : {}
012.
City :
013.
CN : Ankur Seth
014.
codePage : 0
015.
Company :
016.
CompoundIdentitySupported : {}
017.
Country :
018.
countryCode : 0
019.
Created : 5/24/2013 11:50:43 PM
020.
createTimeStamp : 5/24/2013 11:50:43 PM
021.
Deleted :
022.
Department :
023.
Description : ADMIN
024.
DisplayName : Ankur Seth
025.
DistinguishedName : CN=Ankur Seth,OU=Powershell,DC=contoso,DC=com
026.
Division :
027.
DoesNotRequirePreAuth :
028.
dSCorePropagationData : {12/31/1600 4:00:00 PM}
029.
EmailAddress :
030.
EmployeeID :
031.
EmployeeNumber :
032.
033.
Fax :
034.
GivenName : Ankur
035.
HomeDirectory :
036.
HomedirRequired :
037.
HomeDrive :
038.
HomePage :
039.
HomePhone :
040.
Initials :
041.
instanceType : 4
042.
isDeleted :
043.
KerberosEncryptionType : {}
044.
LastBadPasswordAttempt :
045.
LastKnownParent :
046.
lastLogoff : 0
047.
lastLogon : 0
048.
LastLogonDate :
049.
LockedOut :
050.
logonCount : 0
051.
LogonWorkstations :
052.
Manager :
053.
MemberOf : {}
054.
MNSLogonAccount :
055.
MobilePhone :
056.
Modified : 5/24/2013 11:56:24 PM
057.
modifyTimeStamp : 5/24/2013 11:56:24 PM
058.
msDS-User-Account-Control-Computed : 8388608
059.
Name : Ankur Seth
060.
nTSecurityDescriptor : System.DirectoryServices.ActiveDirectorySecurity
061.
ObjectCategory : CN=Person,CN=Schema,CN=Configuration,DC=contoso,DC=com
062.
063.
ObjectGUID : cd1f097f-8c54-4988-9bcd-ced6cb954e9c
064.
objectSid : S-1-5-21-3894563728-440662116-3668880775-1105
065.
Office :
066.
OfficePhone :
067.
Organization :
068.
OtherName :
069.
070.
PasswordLastSet :
071.
PasswordNeverExpires :
072.
PasswordNotRequired :
073.
POBox :
074.
PostalCode :
075.
PrimaryGroup : CN=Domain Users,CN=Users,DC=contoso,DC=com
076.
primaryGroupID : 513
077.
PrincipalsAllowedToDelegateToAccount : {}
078.
ProfilePath :
079.
ProtectedFromAccidentalDeletion :
080.
pwdLastSet : 0
081.
SamAccountName : ASeth
082.
sAMAccountType : 805306368
083.
ScriptPath :
084.
sDRightsEffective : 15
085.
ServicePrincipalNames : {}
086.
SID : S-1-5-21-3894563728-440662116-3668880775-1105
087.
SIDHistory : {}
088.
SmartcardLogonRequired :
089.
sn : Seth
090.
State :
091.
StreetAddress :
092.
Surname : Seth
093.
Title :
094.
TrustedForDelegation :
095.
TrustedToAuthForDelegation :
096.
UseDESKeyOnly :
097.
userAccountControl : 512
098.
userCertificate : {}
099.
UserPrincipalName : ASeth@contoso.com
100.
uSNChanged : 28712
101.
uSNCreated : 28705
102.
whenChanged : 5/24/2013 11:56:24 PM
103.
whenCreated : 5/24/2013 11:50:43 PM
get-content c:\users.txt | get-aduser |
Set
-ADAccountPassword -NewPassword (ConvertTo-SecureString -AsPlainText monster@me123 -Force)
-ADUser -Manager
"Biswajit"
PS C:\> get-command -module ActiveDirectory
CommandType Name ModuleName
----------- ---- ----------
Cmdlet Add-ADCentralAccessPolicyMember ActiveDirectory
Cmdlet Add-ADComputerServiceAccount ActiveDirectory
Cmdlet Add-ADDomainControllerPasswordReplicationPolicy ActiveDirectory
Cmdlet Add-ADFineGrainedPasswordPolicySubject ActiveDirectory
Cmdlet Add-ADGroupMember ActiveDirectory
Cmdlet Add-ADPrincipalGroupMembership ActiveDirectory
Cmdlet Add-ADResourcePropertyListMember ActiveDirectory
Cmdlet Clear-ADAccountExpiration ActiveDirectory
Cmdlet Clear-ADClaimTransformLink ActiveDirectory
Cmdlet Disable-ADAccount ActiveDirectory
Cmdlet Disable-ADOptionalFeature ActiveDirectory
Cmdlet Enable-ADAccount ActiveDirectory
Cmdlet Enable-ADOptionalFeature ActiveDirectory
Cmdlet
Get
-ADAccountAuthorizationGroup ActiveDirectory
-ADAccountResultantPasswordReplicationPolicy ActiveDirectory
-ADCentralAccessPolicy ActiveDirectory
-ADCentralAccessRule ActiveDirectory
-ADClaimTransformPolicy ActiveDirectory
-ADClaimType ActiveDirectory
-ADComputer ActiveDirectory
-ADComputerServiceAccount ActiveDirectory
-ADDCCloningExcludedApplicationList ActiveDirectory
-ADDefaultDomainPasswordPolicy ActiveDirectory
-ADDomain ActiveDirectory
-ADDomainController ActiveDirectory
-ADDomainControllerPasswordReplicationPolicy ActiveDirectory
-ADDomainControllerPasswordReplicationPolicy... ActiveDirectory
-ADFineGrainedPasswordPolicy ActiveDirectory
-ADFineGrainedPasswordPolicySubject ActiveDirectory
-ADForest ActiveDirectory
-ADGroup ActiveDirectory
-ADGroupMember ActiveDirectory
-ADObject ActiveDirectory
-ADOptionalFeature ActiveDirectory
-ADOrganizationalUnit ActiveDirectory
-ADPrincipalGroupMembership ActiveDirectory
-ADReplicationAttributeMetadata ActiveDirectory
-ADReplicationConnection ActiveDirectory
-ADReplicationFailure ActiveDirectory
-ADReplicationPartnerMetadata ActiveDirectory
-ADReplicationQueueOperation ActiveDirectory
-ADReplicationSite ActiveDirectory
-ADReplicationSiteLink ActiveDirectory
-ADReplicationSiteLinkBridge ActiveDirectory
-ADReplicationSubnet ActiveDirectory
-ADReplicationUpToDatenessVectorTable ActiveDirectory
-ADResourceProperty ActiveDirectory
-ADResourcePropertyList ActiveDirectory
-ADResourcePropertyValueType ActiveDirectory
-ADRootDSE ActiveDirectory
-ADServiceAccount ActiveDirectory
-ADTrust ActiveDirectory
-ADUser ActiveDirectory
-ADUserResultantPasswordPolicy ActiveDirectory
Cmdlet Install-ADServiceAccount ActiveDirectory
Cmdlet Move-ADDirectoryServer ActiveDirectory
Cmdlet Move-ADDirectoryServerOperationMasterRole ActiveDirectory
Cmdlet Move-ADObject ActiveDirectory
New
-ADDCCloneConfigFile ActiveDirectory
Cmdlet Remove-ADCentralAccessPolicy ActiveDirectory
Cmdlet Remove-ADCentralAccessPolicyMember ActiveDirectory
Cmdlet Remove-ADCentralAccessRule ActiveDirectory
Cmdlet Remove-ADClaimTransformPolicy ActiveDirectory
Cmdlet Remove-ADClaimType ActiveDirectory
Cmdlet Remove-ADComputer ActiveDirectory
Cmdlet Remove-ADComputerServiceAccount ActiveDirectory
Cmdlet Remove-ADDomainControllerPasswordReplicationPolicy ActiveDirectory
Cmdlet Remove-ADFineGrainedPasswordPolicy ActiveDirectory
Cmdlet Remove-ADFineGrainedPasswordPolicySubject ActiveDirectory
Cmdlet Remove-ADGroup ActiveDirectory
Cmdlet Remove-ADGroupMember ActiveDirectory
Cmdlet Remove-ADObject ActiveDirectory
Cmdlet Remove-ADOrganizationalUnit ActiveDirectory
Cmdlet Remove-ADPrincipalGroupMembership ActiveDirectory
Cmdlet Remove-ADReplicationSite ActiveDirectory
Cmdlet Remove-ADReplicationSiteLink ActiveDirectory
Cmdlet Remove-ADReplicationSiteLinkBridge ActiveDirectory
Cmdlet Remove-ADReplicationSubnet ActiveDirectory
Cmdlet Remove-ADResourceProperty ActiveDirectory
Cmdlet Remove-ADResourcePropertyList ActiveDirectory
Cmdlet Remove-ADResourcePropertyListMember ActiveDirectory
Cmdlet Remove-ADServiceAccount ActiveDirectory
104.
Cmdlet Remove-ADUser ActiveDirectory
105.
Cmdlet Rename-ADObject ActiveDirectory
106.
Cmdlet Reset-ADServiceAccountPassword ActiveDirectory
107.
Cmdlet Restore-ADObject ActiveDirectory
108.
Cmdlet Search-ADAccount ActiveDirectory
109.
-ADAccountControl ActiveDirectory
110.
-ADAccountExpiration ActiveDirectory
111.
-ADAccountPassword ActiveDirectory
112.
113.
114.
-ADClaimTransformLink ActiveDirectory
115.
116.
117.
118.
119.
120.
-ADDomainMode ActiveDirectory
121.
122.
123.
-ADForestMode ActiveDirectory
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
Cmdlet Sync-ADObject ActiveDirectory
137.
Cmdlet Test-ADServiceAccount ActiveDirectory
138.
Cmdlet Uninstall-ADServiceAccount ActiveDirectory
139.
Cmdlet Unlock-ADAccount ActiveDirectory
ADDS PowerShell (CMDLET , ADSI & .Net) to Expedite Your Tasks