Quickly query Active Directory to find users distinguished name

Pretty simple method on extracting users distinguished name (dn) data from Active Directory. dsquery.exe * -limit 0 -filter “(&(objectCategory=Person)(objectClass=User)(!userAccountControl:1.2.840.113556.1.4.803:=2))” >”c:\activeUsers.txt” Note: This will only extract active users. To gather a list of all users, simply run: dsquery user

Update Active Directory User Objects

This PowerShell script allows you to update or append user objects in Active Directory based on data in an external data file (csv). $users = import-csv c:\is\scripts\ps1\ourusers.csv foreach($row in $users) { $dn = $row.dn $user=[ADSI]“LDAP://$dn” $telephoneNumber = $row.telephoneNumber $user.put(“telephoneNumber”, $telephoneNumber) $user.SetInfo() } The data file needs to have the following format: dn,telephoneNumber “distinguished name”,telephoneNumber Reference: [...]

Query User Membership in Active Directory

Have you ever needed to quickly get a particular users group membership in Active Directory? Sure, you could open ‘Active Directory Users and Computers’ and find the user and then check the ‘Member Of’ tab, but this has its drawbacks (i.e. it’s difficult to get a list if you need to email it to a [...]

Follow

Get every new post delivered to your Inbox.