Link to home
Start Free TrialLog in
Avatar of annayeg
annayeg

asked on

powershell script to enable Unified Messaging

Hi all,

I am trying to automate the process of enabling mailboxes for UM.  I have the following line but it doesn't work.

Basically, I have a csv file with the following headings:
uname extensions mailboxpolicy secondarydialplan

The script should import the csv file, Enable UM and add secondary dialplan:

HEre's the script

$users=import-csv ".\umusers.csv"

foreach ($user in $users)
      {get-mailbox -identity $_.uname

      enable-UMMailbox -identity $_.uname -umMailboxpolicy $_.mailboxpolicy -Extensions $_.extensions
      set-mailbox $_.uname -secondaryaddress $_.extensions -secondarydialplan $_.secondarydialplan
}

Any idea what I am doing wrong?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Stelian Stan
Stelian Stan
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial