PowerShell Script – Add Target Address To Multiple Users

This script will show you how to add Target address to a list of users using PowerShell.

 The script will run on Windows Server 2008 R2 and above with AD tools Installed.

Before you start create a text file called users and add the users samaccountname to it like the example below:

"Exchange Online – Find Mailboxes... x
"Exchange Online – Find Mailboxes With Specific Domain – Learn IT And DevOps Daily"

import-module activedirectory

Get-Content C:\users.txt | % { set-aduser $_ -add @{targetAddress="smtp:[email protected]"}}


Categorized as Scripts