Forum Discussion

JamesA1675's avatar
JamesA1675
Copper Contributor
Dec 06, 2021
Solved

Powershell not recognizing cmdlet?

I'm launching Powershell ISE and attempting to use get-azureadmconditionalaccesspolicy.  This is from a shared server.  Another user is able to run the same script without issue.  I get the following response.

 

get-azureadmconditionalaccesspolicy : The term 'get-azureadmconditionalaccesspolicy' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ get-azureadmconditionalaccesspolicy
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (get-azureadmconditionalaccesspolicy:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

 

 

In Powershell ISE, I'm able to select the AzureADPreview module and locate the command.   When I run Get-installedmodule, I'm able to see the following entries.

 

 

2.0.2.140 AzureAD PSGallery Azure Active Directory V2 General Availability Module....
2.0.2.138 AzureADPreview PSGallery Azure Active Directory V2 Preview Module. ...

 

 

the command should be available, so I'm unsure what I'm missing.

  • The cmdlet is Get-AzureADMSConditionalAccessPolicy, make sure you type (paste) it correctly as your example is missing an "S".

2 Replies

  • The cmdlet is Get-AzureADMSConditionalAccessPolicy, make sure you type (paste) it correctly as your example is missing an "S".
    • JamesA1675's avatar
      JamesA1675
      Copper Contributor
      I was having a hell of a day yesterday. I ran into the error, installed the module, but still couldn't run it. In my troubleshooting I went to manually typing in the command and ended up misspelling it. I checked today and the script is working for me. Thank you for pointing out the misspelling. Would have drove me crazy today again.

Resources