User accounts can be added to Lync Online/Office 365 using Windows PowerShell in conjunction with the Microsoft Online Services Module. The installation steps and system requirements for the Microsoft Online Services Module are detailed later in this chapter in the section “Establishing Trust with Office 365 for SSO.” After the Microsoft Online Services Module is installed on a system with PowerShell, use the following steps to create a new user account using PowerShell:
1. Log on to the system where Windows PowerShell and the Microsoft Online Services Module are installed.
2. Open Windows PowerShell and import the Microsoft Online Services Module using the command Import-Module MSOnline
.
3. Execute the command $cred=Get-Credential
, and then at the prompt enter the credentials of an Office 365 administrative account.
4. Execute the command Connect-MsolService -Credential $cred
, which creates a connection to Office 365, as required to run the remaining cmdlets.
5. Execute the New-MsolUser
cmdlet to create the new user account. For example, the following command would be used to create a new account named Lois Victoria in the companyabc.onmicrosoft.com
organization:
New-MsolUser -UserPrincipalName "LoisV.companyabc.onmicrosoft.com" -DisplayName "Lois Victoria" -FirstName "Lois" -LastName "Victoria"
6. If the command completes successfully, the new user account properties will display, including the temporary password assigned to the account.
Tip
The New-MsolUser
command creates the user account; however, it does not apply licensing to the user. The licenses can be assigned after the user account is created using the online portal.