troubleshooting Question

Assign manager in ms graph - nothing happens

Avatar of greenshoots
greenshoots asked on
Azure* GraphAPI
2 Comments1 Solution65 ViewsLast Modified:
Having the challenge to get the set manager to work.
https://docs.microsoft.com/en-us/graph/api/user-post-manager?view=graph-rest-1.0&tabs=http
The permissions are right in my app as long as I have understood.
The app also has the Company Administrator and the Helpdesk Administrator role.
If those roles also have User.ReadWrite.All, Directory.ReadWrite.All everything should be alright?

In Powershell it works (but in another authentification context of course)
Set-AzureADUserManager -ObjectId $user.ObjectId -RefObjectId $manager.ObjectId
Then I can see the Manager with get-AzureADUserManager -ObjectId $user.ObjectId

PUT https://graph.microsoft.com/v1.0/users/zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz/manager/$ref
Content-type: application/json
Content-length: 92

{"@odata.id": "https://graph.microsoft.com/v1.0/users/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}


Content-length is the length of the JSON string, and I calculate it with strlen in PHP. I hope that's correct.

But this gives me no response. Which is normal, I guess. But nothing happens actually. If I enter a wrong email or wrong format in the input, I get a related error message. So a part of it works. But not the set stuff.
ASKER CERTIFIED SOLUTION
greenshoots

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros