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

Missing Remove-* functions on various owner objects. #660

Closed
erwinkramer opened this issue May 11, 2021 · 5 comments · Fixed by #1324
Closed

Missing Remove-* functions on various owner objects. #660

erwinkramer opened this issue May 11, 2021 · 5 comments · Fixed by #1324

Comments

@erwinkramer
Copy link

erwinkramer commented May 11, 2021

Call : Get-Command -Module Microsoft.Graph* *owner*

The following objects have a New function, but don't seem to have a Remove function:

Function        New-MgApplicationOwnerByRef                        1.5.0      Microsoft.Graph.Applications
Function        New-MgDeviceManagementAndroidDeviceOwnerEnrollm... 1.5.0      Microsoft.Graph.DeviceManagement.Enrolment
Function        New-MgDeviceManagementAndroidDeviceOwnerEnrollm... 1.5.0      Microsoft.Graph.DeviceManagement.Actions
Function        New-MgDeviceRegisteredOwnerByRef                   1.5.0      Microsoft.Graph.Identity.DirectoryManagement
Function        New-MgGroupOwnerByRef                              1.5.0      Microsoft.Graph.Groups
Function        New-MgServicePrincipalOwnerByRef                   1.5.0      Microsoft.Graph.Applications
Function        New-MgTeamOwnerByRef

They are included in the Graph API, for instance, the delete method for MgApplicationOwnerByRef: https://docs.microsoft.com/en-us/graph/api/application-delete-owners?view=graph-rest-1.0&tabs=http
AB#9384

@peombwa
Copy link
Member

peombwa commented May 12, 2021

This is missing from the OpenAPI document that the SDK is generated from. I've opened an issue for the appropriate team to fix this here microsoftgraph/microsoft-graph-devx-api#567.

As a workaround, you could use Invoke-MgGraphRequest like this to remove an application owner like this.

Invoke-GraphRequest -Method 'Delete' -Uri "https://graph.microsoft.com/v1.0/applications/$appId/owners/$ownerId/`$ref"

@erwinkramer
Copy link
Author

erwinkramer commented May 13, 2021

Thanks @peombwa .

Also it's not just the ref types, I think it's missing these as well:

  • Remove-mgApplicationOwner
  • Remove-mgServicePrincipalOwner

@kaiaschulz
Copy link

kaiaschulz commented Feb 2, 2022

Hey @peombwa ,
you marked this as resolved.
Unfortunately, this the commands Remove-mgApplicationOwner and Remove-mgServicePrincipalOwner aren't available within the following version:

1.9.2                Microsoft.Graph.Applications
1.9.2                Microsoft.Graph.Authentication

In the meantime, I am trying to use your mentioned workaround.

@kaiaschulz
Copy link

Additionally, the links within the mapping table are somehow available (404) or have a wrong linking:

Not available (404):

<td>Connect-AzureAD</td>
  <td><a href="/en-us/powershell/module/microsoft.graph.authentication/connect-mggraph?view=graph-powershell-1.0&amp;preserve-view=true" data-linktype="absolute-path">Connect-MgGraph</a></td>

  <td>Disconnect-AzureAD</td>
  <td><a href="/en-us/powershell/module/microsoft.graph.authentication/disconnect-mggraph?view=graph-powershell-1.0&amp;preserve-view=true" data-linktype="absolute-path">Disconnect-MgGraph</a></td>

The documentation for the module microsoft.graph.authentication doesn't exist:
https://docs.microsoft.com/en-us/powershell/module/microsoft.graph.authentication/connect-mggraph?view=graph-powershell-1.0&preserve-view=true

Wrong linking (404):

<td>Add-AzureADApplicationOwner</td>
<td><a href="/en-us/powershell/module/microsoft.graph.applications/new-mgapplicationownerbyref.md?view=graph-powershell-1.0&amp;preserve-view=true" data-linktype="absolute-path">New-MgApplicationOwnerByRef.md</a></td>

The .md is the problem within the link. The correct link would be https://docs.microsoft.com/en-us/powershell/module/microsoft.graph.applications/new-mgapplicationownerbyref?view=graph-powershell-1.0&preserve-view=true

@maisarissi
Copy link

Hi @kaiaschulz .

You are right, the issue was not resolved. A fix was deployed back in August, but it seems like we are still missing "delete operations" in the OpenAPI document.

So, I've raised a new issue and I'm engaging with that team to get this fixed as soon as possible.

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.

4 participants