0
votes

I'm using query string parameters in a Graph API request to fetch users from Azure AD, however none appear to be working when I execute it through Powershell.

Here's the documentation on the API: https://docs.microsoft.com/en-us/graph/query-parameters

Here's some details about the scenario:

1

1 Answers

1
votes

I assume your app registration is set up properly and you have given the appropriate permissions etc. got the token and make the restmethod call, and the call returns full user profiles and not just the upn. It would be helpful if you provided some code. Assuming the above, from the little additional info, probably powershell is replacing your $top and $select with blank or something, because it will likely treat those as powershell variables instead of literally put them in the request url. meaning you probably did something like invoke-restmethod -Uri "graphurl?$top=etcetc" change that to single quote to take the literal string eg. invoke-restmethod -Uri 'graphurl?$top=etcetc'