question

ImtiyazAli-4066 avatar image
0 Votes"
ImtiyazAli-4066 asked ·

Get-AzureADPolicy is not working

I am getting below error while running command Get-AzureADPolicy

PS C:\WINDOWS\system32> Get-AzureADPolicy
Get-AzureADPolicy : Error occurred while executing GetPolicies
Code: Request_InvalidRequestUrl
Message: Request url was invalid. The request should be like /tenantdomainname/Entity or /$metadata. Tenant domain name can be any of the verified,
unverified domain names or context id.
InnerError:
RequestId: ae9de1d2-7c5c-4c22-8151-bac786e3262f
DateTimeStamp: Wed, 08 Apr 2020 15:23:22 GMT
HttpStatusCode: BadRequest
HttpStatusDescription: Bad Request
HttpResponseStatus: Completed
At line:1 char:1
+ Get-AzureADPolicy
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-AzureADPolicy], ApiException
+ FullyQualifiedErrorId : Microsoft.Open.MSGraphBeta.Client.ApiException,Microsoft.Open.MSGraphBeta.PowerShell.GetPolicy

PS C:\WINDOWS\system32>

azure-active-directory
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

michev avatar image
0 Votes"
michev answered ·

Getting the same experience here, so it seems like it's something on the backend. Open a support case if you haven't done it already.

· 1 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I have version 2.0.2.89 and this is working for me now.
Earlier it was not working with the same version.

0 Votes 0 ·
AnujRana-1707 avatar image
2 Votes"
AnujRana-1707 answered ·

Did you check if you are using latest version for module? it should be 2.0.2.85.

You can update the same from : https://t.co/kPilxDKnMQ?amp=1

Please confirm if this fixes your issue. I have tested Get-AzureADPolicy few mins back and it is working as expected on 2.0.2.85.


· 1 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thak you, it worked for me.

But why it stoped working in old version even without having a proper message.

0 Votes 0 ·
ImtiyazAli-4066 avatar image
0 Votes"
ImtiyazAli-4066 answered ·

Thanks everybody!!
Issue resolve as this is working with version 2.0.2.89.

· 1 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for the confirmation. Please mark the solution as accepted answer, so that it can help others too.

0 Votes 0 ·