Created
April 17, 2019 11:28
-
-
Save beci/17251bf394aec587bb5a3f9d4f9bd28b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# with filter for only enabled | |
Get-ADUser -LDAPFilter "(&(objectCategory=person)(objectClass=user)(!userAccountControl:1.2.840.113556.1.4.803:=2))" -Properties * | select Name,UserPrincipalName,Enabled,LockedOut,Created,LastLogonDate | ConvertTo-Json > users_f.json | |
# with all users | |
Get-ADUser -Filter * -Properties * | select Name,UserPrincipalName,Enabled,LockedOut,Created,LastLogonDate | ConvertTo-Json > users.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment