Skip to content

Restore-MgBetaDirectoryDeletedItem missing BodyParameter parameter #3318

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
12Knocksinna opened this issue May 10, 2025 · 1 comment
Open
Labels
status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience

Comments

@12Knocksinna
Copy link

Describe the bug

The Restore-MgBetaDirectoryDeletedItem cmdlet documents the use of the Bodyparameter parameter https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.beta.identity.directorymanagement/restore-mgbetadirectorydeleteditem?view=graph-powershell-beta to pass details of deleted object being restored with a different UPN. V2.27 of the cmdlet says that no such parameter can be found.

Expected behavior

$DeletedUserUPN = "Marc.c.Vigneau@office365itpros.com"
$NewUserPrincipalName = "Marc.B.Vigneau@office365itpros.com"
$DeletedObject = Get-MgDirectoryDeletedItemAsUser -Filter "displayName eq 'Marc Vigneau'"
$NewUPNDetails = @{}
$NewUPNDetails.Add("newUserPrincipalName",$NewUserPrincipalName)
$NewUPNDetails.Add("autoReconcileProxyConflict",$true)

$Status = Restore-MgBetaDirectoryDeletedItem -DirectoryObjectId $DeletedObject.Id -BodyParameter $NewUPNDetails
Restore-MgBetaDirectoryDeletedItem: A parameter cannot be found that matches parameter name 'BodyParameter'.

How to reproduce

See above.

SDK Version

V2.27

Latest version known to work for scenario above?

V2.25

Known Workarounds

Use Graph request

Debug output

No debug because cmdlet fails immediately ```
</details>


### Configuration

Windows

Name                           Value
----                           -----
PSVersion                      7.5.1
PSEdition                      Core
GitCommitId                    7.5.1
OS                             Microsoft Windows 10.0.26100
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

### Other information

_No response_
@12Knocksinna 12Knocksinna added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels May 10, 2025
@12Knocksinna
Copy link
Author

Updated to V2.28 and the Bodyparameter parameter is still unsupported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience
Projects
None yet
Development

No branches or pull requests

1 participant