create a script to do mailbox conversion.

nav2567
nav2567 used Ask the Experts™
on
Hello,

I have a txt file which contains list of email address of mailboxes.  

traffic@xyz.com
sales@xyz.com
hr@xyz.com
.....

I need to run a PS command to read this text file and convert the mailboxes into shared mailboxes.

I am trying this command but it does not work:

get-content "c:\mailbox.txt" | set-mailbox $_ -Type Shared

If someone knows how to fix it, please advise.

Thanks.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Assuming you've already connected to Exchange Online using Remote PowerShell, all you should have to add is this:

Get-Content 'c:\mailbox.txt' | ForEach-Object {Set-Mailbox $_ -Type Shared}

Open in new window

Author

Commented:
Thanks a lot Jason.  It looks right.  I am going to try.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial