The Azure Active Directory Sync tool (aka DirSync) already has been setup here to synchronize on-premises Active Directory users to Office 365.
Assigning license within Office 365 admin center portal for one user is quite is easy. But, I don’t have much luck with doing similar stuff through the PowerShell.
I have Microsoft Online Services Sign-In Assistant and Azure AD Module already install on my Windows 8.1 workstation. I can Connect-MsolService with my Office 365 global admin account without any problem.
From my understanding, before I can assign a licence to a user using Set-MsolUserLicense cmdlet with the -AddLicenses parameter we must set the user's UsageLocation attribute.
I’m trying to run this command:
Set-MsolUser -UserPrincipalName email@example.com -UsageLocation US
But, PowerShell is returning an error: Set-MsolUser : Access Denied. You do not have permissions to call this cmdlet.
Any idea why and what needs to be done to fix this error?
Thanks in advance