PowerShell ADAssist Tool and List-ADUsers Script

If you would like to read the other parts in this blog series please go to:

1. Logon Script and PowerShell ADAssist Tool (Part 1)
2. PowerShell ADAssist Tool and List-ADUsers Script (Part 2)
3. PowerShell AD User Properties Script (Part 3)
4. Exchange – PowerShell AD User Properties Script (Part 4)

Different IT environments have IT professionals with different requirements and organizational boundaries, and therefore I’ve received quite a few emails asking the following question:  Is there a way to launch a Windows form to display and edit the selected user account and its attributes in Active Directory without a need to either use an ADAssist tool or the stats produced by logon/logoff scrips?

The short answer is: yes; there is a PowerShell script – List-ADUsers.ps1, see the picture 1. This script you can use to select different users’ OUs in your Active Directory and from drop-down list, select user’s name and click on ‘Display Selected User’ button.

Picture 1: List-ADUsers.ps1

How you install/where you get List-ADUsers.ps1?

No installation required; this PowerShell scrip is just one of the scripts presented with the ADAssist application and it is kept in the same location. I’ve updated the download file just before publishing this post and you can download the compressed file from the download/application section of this site and extract it anywhere you want (in my example it is extracted inside C:\PSScript\AD-Assist folder).

Picture 2: Location of ADAssist application and List-ADUsers.ps1 script

Note the XML file named “ADassistConfigFile.xml” which is an integral part of this application. This file has been updated as well. As shown in picture 03. List-ADUsers.ps1 script reads XML document and stores the elements’ content into the script’s variables.

Some nodes/elements could be empty, but some, like user element ‘<UserOU>’ and ‘<PsFile><UserFile>’ must have value as shown in picture 3.

Picture 3: ADAssist XML configuration file

Start you PowerShell and Run-as admin the List-ADUsers.ps1 script. The button ‘Select OU’ let you choose an organizational unit containing users’ accounts (see the picture 4). The selected OU’s DistinguishedName will be saved in ‘<UserOU>’ element of the ADassistConfigFile.xml file.

Picture 4: selecting users’ OU and saving a selection as default into the ADassistConfigFile.xml file

Important: If you do not select ‘Save as default’ check box, the drop-down list will be loaded with users’ accounts from selected OU container, but the current selection will not be saved into ADassistConfigFile.xml file.  To go back to your default option, just click ‘Refresh/Reset User List’ button.

Finally, to view and display additional user’s attributes or to administer selected user account, you select a user name from the drop-down list and click on ‘Display Selected User’ button. This will launch a new Windows form (Display-ADUserProperties.ps1) as shown in picture 5.

Note: you have an option to display more than one form /user account; just select another user name from the drop-down list and click on ‘Display Selected User’ button.

Picture 5: AD-User Properties form to view and edit user’s account attributes in AD.

The Display-ADUserProperties.ps1 script, shown above in picture 5, is updated and included as well in the download/application section of this site. My intention is to elaborate more on this form and administration of user accounts in my next blog that will be published this month. The final blog in this series about user accounts’ administration will present this Windows Form with two additional tabs: Exchange General and Mailbox Settings as shown in picture 6.

Picture 6: Exchange General and Mailbox Settings tabs

As always, I have more features on the road-map and I would welcome any feature ideas / suggestions.


Leave a Reply

Your email address will not be published. Required fields are marked *