question

JeromeDelaCruz-6189 avatar image
0 Votes"
JeromeDelaCruz-6189 asked JeromeDelaCruz-6189 commented

Get-AzureADPolicy is not working under version Version 2.0.2.134 (current version)

Hello,

I'm trying to execute Get-AzureADPolicy, however, i'm getting the following error:

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: 2b9dc227-b2f7-462a-9fcd-996d2660da9a
DateTimeStamp: Tue, 06 Apr 2021 12:43:48 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


Could someone check this issue? I've seen a similar old post but it looks like it has been resolved since then.

Thanks,
Jerome

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

JamesTran-MSFT avatar image
0 Votes"
JamesTran-MSFT answered JeromeDelaCruz-6189 commented

@JeromeDelaCruz-6189
Thank you for your post!

Would you be able to share the complete PS calls that you're making? This way I can try to repo your issue on my end.

If you're still having issues, can you try to uninstall the module and re-install them:

 #Uninstall the AzureAD Module
 UnInstall-Module AzureAD
    
 #Re-install the AzureAD Module
 Install-Module AzureAD
    
 #Install the AzureAD Preview Module adding the -AllowClobber
 Install-Module AzureADPreview -AllowClobber
    
 Connect-AzureAD
 Get-AzureADPolicy -All $true

For more info - https://stackoverflow.com/questions/54953927/get-azureadpolicy-the-term-get-azureadpolicy-is-not-recognized/66442381#66442381

85474-image.png


If you have any other questions, please let me know.
Thank you for your time and patience throughout this issue.


image.png (323.3 KiB)
· 4
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.

@JeromeDelaCruz-6189
I just wanted to check in and see if you had any other questions or if you were able to resolve this issue?

0 Votes 0 ·

I reinstall the module and delete all versions and it works like a charm. Thanks you so much for your help!

1 Vote 1 ·

@JeromeDelaCruz-6189
Thank you for the quick response and I'm glad that I was able to help resolve your issue!


Thank you for your time and patience throughout this issue.


Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.

0 Votes 0 ·

I reinstall the module and delete all versions and it works like a charm. Thanks you so much for your help!

0 Votes 0 ·