Update service plan in user license

He, Erchuang/何 二创 141 Reputation points
2023-03-07T06:56:47.1366667+00:00

Thank you very much for your answer.
Because I want to update the service plan status in the user license on MS365. There are always problems when using the "Update-MgUserLicenseDetail" command.

I'm sorry that I'm a beginner and I'm not familiar with the use of command "Update-MgUserLicenseDetail" to update the user service plan status(Disabled->Success). Please help me. If there are other commands to update the user service plan, please let me know. Thank you very much.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,582 questions
{count} votes

Accepted answer
  1. CarlZhao-MSFT 36,896 Reputation points
    2023-03-07T08:18:21.0866667+00:00

    Hi @He, Erchuang/何 二创

    First import the user module:

    Import-Module Microsoft.Graph.Users

    Then connect to MgGraph using your global administrator:

    Connect-MgGraph -Scopes "User.ReadWrite.All"

    Retrieve a list of licenseDetails objects for enterprise users.

    Get-MgUserLicenseDetail -UserId $userId

    User's image

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.

    0 comments No comments

0 additional answers

Sort by: Most helpful