PowerShell을 사용하여 Microsoft 365 계정 라이선스 및 서비스 세부 정보 보기

이 문서는 Microsoft 365 Enterprise와 Office 365 Enterprise에 모두 적용됩니다.

Microsoft 365 라이선스 계획(SKU 또는 Microsoft 365 플랜이라고도 함)의 라이선스를 통해 사용자는 해당 계획에 정의된 Microsoft 365 서비스에 액세스할 수 있습니다. 그러나 사용자는 현재 할당된 라이선스에서 사용할 수 있는 모든 서비스에 액세스하지 못할 수도 있습니다. Microsoft 365 PowerShell을 사용하여 사용자 계정의 서비스 상태를 볼 수 있습니다.

라이선스 계획, 라이선스 및 서비스에 대한 자세한 내용은 PowerShell을 사용하여 라이선스 및 서비스 보기를 참조하세요.

Microsoft Graph PowerShell SDK 사용

먼저 Microsoft 365 테넌트에 연결합니다.

라이선스 세부 정보를 포함한 사용자 속성을 읽으려면 User.Read.All 권한 범위 또는 '사용자 가져오기' Graph API 참조 페이지에 나열된 다른 권한 중 하나가 필요합니다.

Connect-Graph -Scopes User.ReadWrite.All, Organization.Read.All

다음으로, 이 명령을 사용하여 테넌트에 대한 라이선스 계획을 나열합니다.

Get-MgSubscribedSku

이러한 명령을 사용하여 각 라이선스 계획에서 사용할 수 있는 서비스를 나열합니다.


$allSKUs = Get-MgSubscribedSku -Property SkuPartNumber, ServicePlans 
$allSKUs | ForEach-Object {
    Write-Host "Service Plan:" $_.SkuPartNumber
    $_.ServicePlans | ForEach-Object {$_}
}

이러한 명령을 사용하여 사용자 계정에 할당된 라이선스를 나열합니다.

Get-MgUserLicenseDetail -UserId "<user sign-in name (UPN)>"

예를 들어 다음과 같습니다.

Get-MgUserLicenseDetail -UserId "belindan@litwareinc.com"

사용자 계정에 대한 서비스를 보려면

사용자가 액세스할 수 있는 모든 Microsoft 365 서비스를 보려면 다음 구문을 사용합니다.

(Get-MgUserLicenseDetail -UserId <user account UPN> -Property ServicePlans)[<LicenseIndexNumber>].ServicePlans

이 예제에서는 사용자 BelindaN@litwareinc.com 액세스 권한이 있는 서비스를 보여 줍니다. 사용자의 계정에 할당된 모든 라이선스와 관련된 서비스를 표시합니다.

(Get-MgUserLicenseDetail -UserId belindan@litwareinc.com -Property ServicePlans).ServicePlans

이 예제에서는 사용자 BelindaN@litwareinc.com이 계정에 할당된 첫 번째 라이선스(인덱스 번호: 0)에서 액세스할 수 있는 서비스를 표시합니다.

(Get-MgUserLicenseDetail -UserId belindan@litwareinc.com -Property ServicePlans)[0].ServicePlans

여러 라이선스 가 할당된 사용자의 모든 서비스를 보려면 다음 구문을 사용합니다.

$userUPN="<user account UPN>"
$allLicenses = Get-MgUserLicenseDetail -UserId $userUPN -Property SkuPartNumber, ServicePlans
$allLicenses | ForEach-Object {
    Write-Host "License:" $_.SkuPartNumber
    $_.ServicePlans | ForEach-Object {$_}
}

Graph 모듈용 Azure Active Directory PowerShell 사용하기

먼저 Microsoft 365 테넌트에 연결합니다.

다음으로, 이 명령을 사용하여 테넌트에 대한 라이선스 계획을 나열합니다.

Get-AzureADSubscribedSku | Select SkuPartNumber

이러한 명령을 사용하여 각 라이선스 계획에서 사용할 수 있는 서비스를 나열합니다.

$allSKUs=Get-AzureADSubscribedSku
$licArray = @()
for($i = 0; $i -lt $allSKUs.Count; $i++)
{
$licArray += "Service Plan: " + $allSKUs[$i].SkuPartNumber
$licArray +=  Get-AzureADSubscribedSku -ObjectID $allSKUs[$i].ObjectID | Select -ExpandProperty ServicePlans
$licArray +=  ""
}
$licArray

이러한 명령을 사용하여 사용자 계정에 할당된 라이선스를 나열합니다.

$userUPN="<user account UPN, such as belindan@contoso.com>"
$licensePlanList = Get-AzureADSubscribedSku
$userList = Get-AzureADUser -ObjectID $userUPN | Select -ExpandProperty AssignedLicenses | Select SkuID 
$userList | ForEach { $sku=$_.SkuId ; $licensePlanList | ForEach { If ( $sku -eq $_.ObjectId.substring($_.ObjectId.length - 36, 36) ) { Write-Host $_.SkuPartNumber } } }

Windows PowerShell용 Microsoft Azure Active Directory 모듈 사용하기

먼저 Microsoft 365 테넌트에 연결합니다.

다음으로, 이 명령을 실행하여 조직에서 사용할 수 있는 라이선스 계획을 나열합니다.

Get-MsolAccountSku

참고

PowerShell Core는 Windows PowerShell용 Microsoft Azure Active Directory 모듈 및 이름에 Msol 이 있는 cmdlet을 지원하지 않습니다. 이러한 cmdlet을 계속 사용하려면 Windows PowerShell에서 이를 실행해야 합니다.

다음으로, 이 명령을 실행하여 각 라이선스 계획에서 사용할 수 있는 서비스 및 나열된 순서(인덱스 번호)를 나열합니다.

(Get-MsolAccountSku | where {$_.AccountSkuId -eq "<AccountSkuId>"}).ServiceStatus

이 명령을 사용하여 사용자에게 할당된 라이선스와 라이선스가 나열되는 순서(인덱스 번호)를 나열합니다.

Get-MsolUser -UserPrincipalName <user account UPN> | Format-List DisplayName,Licenses

사용자 계정에 대한 서비스를 보려면

사용자가 액세스할 수 있는 모든 Microsoft 365 서비스를 보려면 다음 구문을 사용합니다.

(Get-MsolUser -UserPrincipalName <user account UPN>).Licenses[<LicenseIndexNumber>].ServiceStatus

이 예제에서는 사용자 BelindaN@litwareinc.com 액세스 권한이 있는 서비스를 보여 줍니다. 사용자의 계정에 할당된 모든 라이선스와 관련된 서비스를 표시합니다.

(Get-MsolUser -UserPrincipalName belindan@litwareinc.com).Licenses.ServiceStatus

이 예제에서는 사용자 BelindaN@litwareinc.com이 계정에 할당된 첫 번째 라이선스(인덱스 번호: 0)에서 액세스할 수 있는 서비스를 표시합니다.

(Get-MsolUser -UserPrincipalName belindan@litwareinc.com).Licenses[0].ServiceStatus

여러 라이선스 가 할당된 사용자의 모든 서비스를 보려면 다음 구문을 사용합니다.

$userUPN="<user account UPN>"
$AllLicenses=(Get-MsolUser -UserPrincipalName $userUPN).Licenses
$licArray = @()
for($i = 0; $i -lt $AllLicenses.Count; $i++)
{
$licArray += "License: " + $AllLicenses[$i].AccountSkuId
$licArray +=  $AllLicenses[$i].ServiceStatus
$licArray +=  ""
}
$licArray

참고 항목

PowerShell로 Microsoft 365 사용자 계정, 라이선스 및 그룹 관리

PowerShell로 Microsoft 365 관리

Microsoft 365 용 PowerShell 시작