Pages

Thursday, August 22, 2013

Microsoft Enables Remote Powershell for Lync Online


As announced by the Office 365 Team here, Microsoft finally enabled remote Powershell for Lync Online. Here is the link to Technet's Introduction to Lync Online Powershell Documentation which will give you information about how to connect, list available Powershell cmdlets, and other general information about the new feature. You can download the Powershell Module for Lync Online here and see the list of all Lync Online cmdlets here.

Thursday, August 1, 2013

Script to mass enable users for Exchange UM

During Lync deployments, I have often run into the need to mass enable multiple users for Unified Messaging. To do this, I altered an existing script (I cannot remember where I found it) to do this using a CSV file. Here is the script:

if ($args[0] -eq $null) 
{
$userNameFile = read-host "Please enter the full path of the .csv file with user aliases."
$usernamefile  = $usernamefile -replace '"',"" 
} else {
$usernamefile = $args[0]
}
if($userNameFile -ne "") 
{    
$csv=import-csv $userNameFile 
} else {
"Unable to find a valid CSV with user Aliases, extensions and UM policy name. Please try again later."
exit
}
foreach($c in $csv )
{
"Enabling  User " + $c.Alias + " using UM mailbox policy = " + $c.umpolicy
Enable-ummailbox -id $c.Alias -PinExpired $True -ummailboxpolicy $c.umpolicy -extensions $c.extension   
}

The CSV file for this script will look like this:
Alias extensions umpolicy
User1 1234 Policy Name
User2 1235 Policy Name
User3 1236 Policy Name

The Alias column can contain any of the following values for the Identity parameter:
  • ADObjectID
  • GUID
  • Distinguished name (DN)
  • Domain\Account 
  • user principal name (UPN)
  • LegacyExchangeDN
  • SmtpAddress
  • Alias
If you want the PIN to not prompt the user to change it on first log on, change the -PinExpired value to $False. You can also manually set the PIN if the need arises by adding '-Pin $c.pin' to the Enable-ummailbox line and add a column to the CSV file with the header of 'pin'.

Let me know if you have any questions or comments about this script. Hope this helps.