Active Directory management & automation

Update Multiple AD Objects Using PowerShell

Adaxes includes a PowerShell module for Active Directory that allows administrators to automate routine Active Directory management tasks and perform bulk operations in AD from the command line. In this tutorial you will learn how to use the Adaxes PowerShell cmdlets to perform operations on multiple Active Directory objects.

To use the Adaxes PowerShell module, you need to install the PowerShell Module for Active Directory component of Softerra Adaxes.

The cmdlets included in the Adaxes PowerShell module are similar to those included in the Microsoft PowerShell Active Directory module for Windows Server 2008 R2. However, when Active Directory cmdlets are used together with Adaxes service, you get some extra benefits including automated provisioning, approval-based workflow, enterprise standard enforcement, etc.

For a list of all cmdlets contained in the Adaxes PowerShell module, see Adaxes PowerShell Module.

To start using the Adaxes PowerShell module, use the PowerShell Module for Active Directory shortcut in the Windows start menu.

PowerShell Module for Active Directory shortcut

Or launch the Windows PowerShell console and use the Import-Module cmdlet to import the Adaxes module: Import-Module adaxes

Using Adaxes PowerShell Module

Here you will find some examples of using the Adaxes PowerShell cmdlets to perform bulk operations on Active Directory objects.

The Adaxes PowerShell cmdlets can work with Active Directory either via Adaxes service or directly (bypassing the Adaxes service). If you need a cmdlet to access Active Directory via the Adaxes service, you either need to specify the -AdaxesService parameter:

Set-AdmUser -Identity 'lisa.wilson' -Country 'US' -Server -AdaxesService localhost

Or use the Adaxes PowerShell provider:

cd adaxes:
cd localhost/
Set-AdmUser -Identity 'lisa.wilson' -Country 'US'

Example 1: Import users to Active Directory from a CSV file:

	Import-CSV C:\users.csv | New-AdmUser -Server

Example 2: Set the homepage of all users from Sales department to

	Get-AdmUser -Filter {Department -eq "Sales"} | % { Set-AdmUser $_ -HomePage `
	('' +  $_.SamAccountName)}

Example 3: Add all disabled user accounts to a group:

	Search-AdmAccount -AccountDisabled -UsersOnly -Server | % { Add-AdmGroupMember `
	-Identity 'DisabledAccountsGroup' -Members $_ -Server}

Example 4: Change the display name of all Active Directory users using format 'LastName, FirstName':

	Get-AdmUser -Filter * -Server | % { Set-AdmUser $_ -DisplayName ($_.LastName +  `
	', ' + $_.FirstName) -Server}
? Waiting

Progress status: Checking...