question

JeromeDelaCruz-6189 avatar image
0 Votes"
JeromeDelaCruz-6189 asked amanpreetsingh-msft answered

Get-AzureADPolicy is not working on 2.0.2.134 (current version)

Hi,

Im trying to execute Get-AzureADPolicy but im getting the following error:

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: a0dbcd2e-5c62-4278-a6ed-b08deee60a55
DateTimeStamp: Tue, 06 Apr 2021 12:57:38 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

Can someone please take a look on this? I found the same issue on the Microsoft Q&A page but it looks like it was already res

azure-active-directory
5 |1600 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.

1 Answer

amanpreetsingh-msft avatar image
0 Votes"
amanpreetsingh-msft answered

Hi @JeromeDelaCruz-6189 · Thank you for reaching out.

I just installed the latest version of AzureADPreview module and was able to run the cmdlet successfully.

85182-image.png

Could you please try running Connect-AzureAD -TenantID your_tenant.onmicrosoft.com to connect to your tenant and then run Get-AzureADPolicy


Please "Accept the answer" if the information helped you. This will help us and others in the community as well.


image.png (27.3 KiB)
5 |1600 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.