07-14-2017 09:15 AM
07-14-2017 09:15 AM
Sorry if I posted this twice, to me it seems that the first post did not succeed.
Installed PowerShellGet using the MSI.
Installed the Azure AD PowerShell v2 GA module using Install-Module AzureAD.
Connected and authenticated to our Azure AD tenant successfuly using Connect-AzureAD as can be seen below.
PS C:\Users\Administrator> connect-azuread
Account Environment TenantId TenantDomain AccountType
------- ----------- -------- ------------ -----------
firstname.lastname@example.org AzureCloud xxxxxxxx-0599-4cd4-8... xxxxxxxx.onmicrosof... User
But when running the Get-AzureADPolicy I get the error that this cmdlet is not available as can be seen below.
PS C:\Users\Administrator> Get-AzureADPolicy
Get-AzureADPolicy : The term 'Get-AzureADPolicy' 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
+ CategoryInfo : ObjectNotFound: (Get-AzureADPolicy:String) , CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
What am I doing wrong?
I urgently need to adjust the token lifetimes.
07-14-2017 09:49 AM
07-14-2017 11:34 AM
Which version of the Preview module you have, works fine here with 220.127.116.11. Make sure you are actually loading the correct module, as when you have matching cmdlets between both (Connect-AzureAD is the same for AzureADPreview and AzureADPreview). For example, open a fresh PowerShell window, do a Import-Module AzureADPreview, connect and then try running Get-AzureADPolicy.
07-15-2017 12:44 AM
Thank you very much! I was not aware that I had to import the module. Hope this wil change in the future so that the module loads automatically when start PowerShell like the MSOL module does.
07-15-2017 09:47 AM
It does load, but you have matching cmdlets between the two modules, and the non-preview version takes precedence. Unless you load it explicitly :)
07-25-2017 04:10 PM
First uninstall using
then install the preview module
05-23-2018 02:33 PM
Having same issue. If I import the AzureADPreview module only the same thing occurs, so its loading the AzureAD module in the background. You should be able to run both side by side for production.
06-13-2018 11:45 AM
I have the same issue. The AzureADPreview module was working fine with 18.104.22.168 (I think that was the version) but updated to 2.0.11 I get the same experience. If I run Install-Module AzureADPreview, then run Connect-AzureAD, it loads AzureAD module and the Preview cmdlets can't be found... I can't run Preview cmdlets anymore.
06-13-2018 12:52 PM
06-14-2018 12:26 PM
This worked. Installing the AzureADPreview module was failing as there were too many conflicting commands with the AzureAD Module. Once I uninstalled AzureAD and then Installed AzureADPreview (latest version 22.214.171.124) then everything worked as expected. Thank you
06-14-2018 12:27 PM
02-01-2019 02:21 AM
This worked for me. I had a new Win10 laptop and installing the preview (v126.96.36.199) would work but Get-AzureADPolicy didn't.
I just had to run "UnInstall-Module AzureAD" in a fresh elevated PowerShell console and then the preview cmdlets worked perfectly