5.29. Retrieving Properties on User Accounts
Problem
You need to retrieve a list of properties on user accounts.
Solution
Using a graphical user interface
Log on to any machine in your domain that has the Exchange management tools installed.
Open the ADUC snap-in (Users and Computers.msc).
Locate the container that holds the user object whose properties you want to modify.
Select the user object you want to modify, then right-click it and select Properties.
Select the General tab in the Properties dialog box.
Edit properties as desired.
Select other pages in the tabbed dialog box, and edit other properties.
Click OK to close the Properties dialog box.
Repeat steps 4-8 for each additional user whose properties you want to review.
Using a command-line interface
Run the following command:
> ldifde -f c:\outfile.ldf -r "(&(objectClass=User)(objectCategory=Person))" -d "cn=<Username>,cn=users,<ForestRootDN>"
This will create an LDIF-format file called outfile.ldf, which you can view with your favorite text editor.
Using VBScript
' This code dumps most of the properties on the selected user object.
'To output to a text file, run 'cscript filename.vbs >outfile.txt'
' ------ SCRIPT CONFIGURATION ------
strUser = "<Username>" 'e.g., "cn=jimmy,cn=Users,dc=domain,dc=com" set objUser = GetObject("LDAP://" & strUser) 'declare arrays for multivalue properties arrOtherHomePhone = objUser.GetEx("otherHomePhone") arrOtherPager = objUser.GetEx("otherPager") arrOtherMobile = objUser.GetEx("otherMobile") arrOtherIpPhone ...