Common administrative cmdlets that are used for managing accounts and licensing
Office 365 is a subscription-based service, and it is important for organizations to manage the licenses of users, such as assigning a license to a new user, removing licenses, and activating new licenses in bulk.
Before assigning the license, let's see how we can filter users based on some criteria. For example, if you have users in multiple locations, we can use the following cmdlets to filter users based on the location Bethesda:
- Since PowerShell for Office 365 is used via remote management, as always the first step will be to connect to Office 365 and prove our identity:
Import-Module MSOnline $cred = Get-Credential
This will launch the Windows PowerShell credential request
dialog.
- Enter a valid Office 365 work or school
User name
andPassword
and click onOK
:
- Now run the cmdlet:
Connect-MsolService -Credential $cred
If the cmdlet is successful, it will not display an error message. This should...