Bulk User Account Activation and Password Reset
The following Windows PowerShell cmdlets provided in the Microsoft Online Services Directory Synchronization tool can be used for user account bulk activation, bulk password reset, and other user management scenarios.
Windows PowerShell cmdlet
Descriptions
Enable-MSOnlineUser
Activates a specific user and assigns a service license the user
Get-MSOnlineSubscription
Returns of list of available subscriptions to assign licenses to users.
Set-MSOnlineUserPassword
Sets a specific user account’s password to a specific value.
Add-MSOnlineUser
Creates a disable user account in Microsoft Online Services.
Set-MSOnlineUser
Sets a specific user account’s properties.
Remove-MSOnlineUser
Remove a specific user account form Microsoft Online Services.
Get-MSOnlineUser
Returns a specific user account’s properties.
These PowerShell cmdlets mainly support the following functions:
- Bulk activation: For user accounts synchronized from your local Active Directory to Microsoft Online Services, you can activate those user accounts and assign them a specified password and subscription(s) by using the Enable-MSOnlineUser Windows PowerShell cmdlet. A comma separated values (CSV) file can be created and imported to bulk activate multiple user accounts with this cmdlet.
You can get a list of available subscriptions by using the Get-MSOnlineSubscription Windows PowerShell cmdlet. - Bulk password reset: You can use the Set-MSOnlineUserPassword Windows PowerShell cmdlet to set a user account’s password to a specific value. A CSV file can be created and imported to bulk reset passwords for multiple user accounts. Microsoft Online Services Deskless Worker service administrators can use this function to manage passwords on behalf of deskless workers.
- Bulk add disabled user accounts: You can add disabled user accounts to Microsoft Online Services by using the Add-MSOnlineUser Windows PowerShell cmdlet. A CSV file can be created and imported to bulk add disabled user accounts. The added user accounts are disabled and not assigned with any service, allowing for the creation of a unified global address list (GAL) in Exchange Online without using up licenses. These accounts can be activated at a later time with the Enable-MSOnlineUser Windows PowerShell cmdlet.
In addition, you can view or edit user properties with the Get-MSOnlineUser or Set-MSOnlineUser Windows PowerShell cmdlet, or remove user accounts from Microsoft Online Services with the Remove-MSOnlineUser Windows PowerShell cmdlet.




