Set-MgUserLicense — Export ResultsIT technician command center
Microsoft Graph · Entra ID and Graph

Set-MgUserLicense — Export Results

Export the output of Set-MgUserLicense for documentation or review.

Copy-ready commandSet-MgUserLicense — Export Results
Set-MgUserLicense -UserId user@contoso.com -AddLicenses @{SkuId=$skuId} -RemoveLicenses @() | Export-Csv .\output.csv -NoTypeInformation
Production warning

Directory write operations can affect tenant access.

Requirements and permissions

Requirements
Microsoft.Graph PowerShell SDK
Permissions
Graph delegated or application permissions
Last reviewed
2026-07-31

Examples

Export Results

Export the output of Set-MgUserLicense for documentation or review.

Set-MgUserLicense -UserId user@contoso.com -AddLicenses @{SkuId=$skuId} -RemoveLicenses @() | Export-Csv .\output.csv -NoTypeInformation

Original command

Assign a Microsoft 365 license.

Set-MgUserLicense -UserId user@contoso.com -AddLicenses @{SkuId=$skuId} -RemoveLicenses @()

Common errors

Command not found

Confirm Microsoft.Graph PowerShell SDK is installed and available in your current shell.