Skip to content

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

Closed

Description

@erwinkramer

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

Activity

  1. peombwa commented on May 12, 2021

    @peombwa
    Member

    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 https://github.com/microsoftgraph/microsoft-graph-devx-api/issues/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"
  2. erwinkramer commented on May 13, 2021

    @erwinkramer
    Author

    Thanks Peter Ombwa (@peombwa) .

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

    • Remove-mgApplicationOwner
    • Remove-mgServicePrincipalOwner
  3. kaiaschulz commented on Feb 2, 2022

    @kaiaschulz

    Hey Peter Ombwa (@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.

  4. kaiaschulz commented on Feb 2, 2022

    @kaiaschulz

    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

  5. maisarissi commented on Feb 23, 2022

    @maisarissi

    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

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions