Skip to content
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

Restore-Mg* commands don't work at all #1321

Closed
adamedx opened this issue Jun 14, 2022 · 2 comments · Fixed by #1325
Closed

Restore-Mg* commands don't work at all #1321

adamedx opened this issue Jun 14, 2022 · 2 comments · Fixed by #1325

Comments

@adamedx
Copy link

adamedx commented Jun 14, 2022

The following commands attempt to invoke the restore action on various objects like directoryObject, user, group, etc. There's just one problem: they are being invoked on the entity set (e.g. directoryObjects, users, groups), and the action isn't supported on an object referenced from the entity set! restore is only supported on the directory/deletedObjects navigation property.

See these impacted commands -- they currently result in bad rquest:

�[32;1mCommandType Name Version Source�[0m
�[32;1m----------- ---- ------- ------�[0m
Function Restore-MgAdministrativeUnit 1.9.3 Microsoft.Graph.Identity.DirectoryManagem…
Function Restore-MgApplication 1.9.6 Microsoft.Graph.Applications
Function Restore-MgApplication 1.9.3 Microsoft.Graph.Applications
Function Restore-MgContact 1.9.3 Microsoft.Graph.Identity.DirectoryManagem…
Function Restore-MgContract 1.9.3 Microsoft.Graph.Identity.DirectoryManagem…
Function Restore-MgDevice 1.9.3 Microsoft.Graph.Identity.DirectoryManagem…
Function Restore-MgDirectoryObject 1.9.3 Microsoft.Graph.DirectoryObjects
Function Restore-MgDirectoryRole 1.9.3 Microsoft.Graph.Identity.DirectoryManagem…
Function Restore-MgDirectoryRoleTemplate 1.9.3 Microsoft.Graph.Identity.DirectoryManagem…
Function Restore-MgDirectorySettingTemplate 1.9.3 Microsoft.Graph.Identity.DirectoryManagem…
Function Restore-MgGroup 1.9.3 Microsoft.Graph.Groups
Function Restore-MgOrganization 1.9.3 Microsoft.Graph.Identity.DirectoryManagem…
Function Restore-MgServicePrincipal 1.9.6 Microsoft.Graph.Applications
Function Restore-MgServicePrincipal 1.9.3 Microsoft.Graph.Applications
Function Restore-MgUser 1.9.3 Microsoft.Graph.Users.Actions
Function Restore-MgUserManagedDeviceCloudPc 1.9.3 Microsoft.Graph.Users.Actions
Function Restore-MgUserManagedDevicePasscode 1.9.3 Microsoft.Graph.Users.Actions

@peombwa
Copy link
Member

peombwa commented Jun 17, 2022

Thanks for bringing this to our attention.

Restore-MgDirectoryDeletedItem - /directory/deleteditems/{id}/restore will be available as part of #1324.

As for the unsupported action bound on derived types of deletedObject, the long-term fix is to fix this in the metadata. I've opened an issue in the metadata repo to track this bug - microsoftgraph/msgraph-metadata#169. In the meantime, we will suppress the unsupported commands by applying a targeted remove directive on them.

@adamedx
Copy link
Author

adamedx commented Jun 17, 2022

Thanks, that sounds good -- removing the commands shouldn't break anyone I think since the commands never succeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants