How to enable multiple mailbox in Exchange 2016 from existing AD users using PowerShell

Опубликовано: 11 Октябрь 2024
на канале: Fun & Tech
514
7

Creating mailbox with existing AD users with PowerShell

Get the list of users from an OU:
Get-ADUser -Properties * -Filter * -SearchBase "OU=myOU"
| Select-Object Name, DisplayName, DistinguishedName, mail | Export-Csv users.csv
Import the csv created file and enable mailbox:
Import-Csv "users.csv" | ForEach-Object {Enable-Mailbox -Identity $_.DisplayName -Database "DataBaseName"}