microsoftgraph / microsoftgraph/msgraph-sdk-powershell

Update-MgUser Unable to Clear onPremisesImmutableId

Open
#2,514 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Status: Needs Investigation
Dominant language
C#
Stars
898
Forks
230
Avg merge
2d 5h
Merged PRs (30d)
31

Description

Describe the bug
The Update-MgUser cmdlet cannot clear the onPremisesImmutableId property.

To Reproduce
Execute a command such as:
Update-MgUser -UserId [UserId] -OnPremisesImmutableId $null

Expected behavior
The property should clear.

The payload generated by Update-MgUser is:
{"onPremisesImmutableId": ""}
It should be:
{"onPremisesImmutableId":null}

Module Version
2.11.1

Environment Data

Name                           Value
----                           -----
PSVersion                      5.1.20348.2110
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.20348.2110
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Update-MgUser entry point and reproduce the command using -OnPremisesImmutableId $null. Trace the generated request payload and identify where the empty string is produced; done means the request sends a JSON null and the property can be cleared successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.