Monday, March 2, 2015

Quick Bulk Mailbox-Enabling

Hi folks,

This is just a quick post for those of you who provision bulks of mailboxes on the regular basis. This scenario assumes that user accouts have already been created in the AD.

All you need to is to have TXT or CSV file with the UserId header. Underneath it you can publish one of these values to identify user accounts which can be wither of the below:

  • GUID
  • Distinguished name (DN)
  • Display name
  • Domain\Account
  • User principal name (UPN)

As soon as the input file is ready you can import it into the pipe and enable mailboxes for each user ID in the file. And it's only one string as follows:

Import-Csv D:\Scripts\Users.txt| foreach {Enable-Mailbox -Identity $_.UserId}

Very helpful for lazy guys like me.