Get-ADUser -Filter {(ObjectClass -eq "user") -and (Enabled -eq $true)} -property name,objectGUID,accountExpires,c,co,company,department,displayName,givenName,homePhone,l,mail,mailNickname,manager,physicalDeliveryOfficeName,postalCode,sAMAccountName,sn,st,streetAddress,telephoneNumber,title,userPrincipalName,facsimileTelephoneNumber,whenChanged,whenCreated,mobile,distinguishedName -SearchBase "DC=leavemealone,DC=local" | Select-object name,objectGUID,accountExpires,c,co,company,department,displayName,givenName,homePhone,l,mail,mailNickname,manager,physicalDeliveryOfficeName,postalCode,sAMAccountName,sn,st,streetAddress,telephoneNumber,title,userPrincipalName,facsimileTelephoneNumber,whenChanged,whenCreated,mobile,distinguishedName | ConvertTo-Json | Out-File $ad_user_json -encoding UTF8
Wednesday, August 26, 2020
Export AD Users in json format
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment