简体   繁体   中英

How to call the PIM Graph API endpoints?

I am trying to call the PIM (Privileged Identity Management) REST endpoints via the Graph API using PowerShell. In Graph Explorer I try https://graph.microsoft.com/beta/policies/roleManagementPolicies but it returns "{\"errorCode\":\"MissingProvider\",\"message\":\"The provider is missing.\",\"instanceAnnotations\":[]}"

I have gone down a rabbit hole with the MS documentation on this. Closest I got was they suggested the Powershell SDK, which is the new Microsoft.graph module. The equivalent cmdlet is Get-MgPolicyRoleManagementPolicy which returns a similar error {"errorCode":"MissingProvider","message":"The provider is missing.","instanceAnnotations":[]} . I can't find anywhere how to supply it the missing information. I know this is beta and pretty bleeding edge, but I'm hoping someone has been down this and found a solution. There's an outstanding issue on GitHub for this, but the author/owner is conspicuously absent

The below query will help fix the issue.

https://graph.microsoft.com/beta/policies/roleManagementPolicies?$filter=scopeId+eq+'/'+and+scopeType+eq+'DirectoryRole'

The scopeId and scopeType are required in the URL, will raise a PR to fix the docs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM