Thursday, June 11, 2020

Office365 Powershell example

https://docs.microsoft.com/en-us/office365/enterprise/powershell/connect-to-office-365-powershell#connect-with-the-azure-active-directory-powershell-for-graph-module

Install-Module MSOnline

Connect-MsolService

Get-MsolUser –All

Get-MsolUser -UserPrincipalName admin@demo.onmicrosoft.com

Get-MsolUser –DomainName demo.onmicrosoft.com

Get-MsolUser –UnlicensedUsersOnly

Get-MsolUser -SearchString "user@demo.onmicrosoft.com" | fl IsLicensed, Licenses, ObjectId


IsLicensed : True
Licenses   : {nida365:STANDARDWOFFPACK_IW_FACULTY}
ObjectId   : 37787efb-8c3e-449f-9799-9c636c26a554



(Get-MsolUser -UserPrincipalName user@demo.onmicrosoft.com).Licenses.servicestatus

Set-MsolUserLicense -UserPrincipalName user@demo.onmicrosoft.com -RemoveLicenses demo365:POWER_BI_STANDARD, demo365:POWERAPPS_INDIVIDUAL_USER, demo365:STANDARDWOFFPACK_IW_FACULTY


Set-MsolUserLicense -UserPrincipalName user@demo.onmicrosoft.com -AddLicenses demo365:POWER_BI_STANDARD, demo365:POWERAPPS_INDIVIDUAL_USER, demo365:STANDARDWOFFPACK_IW_FACULTY

(Get-MsolUser -UserPrincipalName user@demo.onmicrosoft.com).Licenses.servicestatus

ALCATEL 6900

write memory copy running certified reload from working no rollback-timeout