question

shashanksaxena-6941 avatar image
0 Votes"
shashanksaxena-6941 asked JamesTran-MSFT commented

Not able to find Azure AD Preview command even after installing Preview module

Hello All,

I hope all are doing good.

I have installed AzureADPreview module in the powershell using command(Install-Module -Name AzureADPreview) and it went successfully but when I am trying to access Azure AD Preview command using the command( Get-Command -Module azureadpreview), I am not getting any output likewise we are getting in command(Get-Command -Module azuread).

Can anyone help me to troubleshoot this issue because I need to create Azure AD Policy and without preview, we are unable to do it.

Regards,
Shashank Saxena

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.

AndyDavid avatar image
0 Votes"
AndyDavid answered shashanksaxena-6941 commented

now Run:

 Import-Module azureadpreview


· 2
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.

Hello @AndyDavid ,

I have already tried this command and mentioned in the issue description as well.

0 Votes 0 ·
AndyDavid avatar image AndyDavid shashanksaxena-6941 ·

You said you ran
Install-Module -Name AzureADPreview

not:

  Import-Module azureadpreview
0 Votes 0 ·
JamesTran-MSFT avatar image
0 Votes"
JamesTran-MSFT answered JamesTran-MSFT commented

@shashanksaxena-6941
Thank you for your detailed post!

When running the Get-Command -Module azureadpreview cmdlet, you'll have to first login to Azure AD to get all the available commands associated with the Azure AD Preview module.

 #Install AzureADPreview Module using -Force since I already have it installed
 Install-Module -Name AzureADPreview -Force
    
 #Login to AzureAD
 Connect-AzureAD
        
 #View all available cmdlets
 Get-Command -Module azureadpreview

206198-image.png

Additional Link:
How To Install AzureAD Preview PowerShell Module - 3rd party link showing you how to Install the Preview Edition of the new AzureAD PowerShell Module.


I hope this helps!


If you have any other questions, please let me know.
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.


image.png (45.4 KiB)
· 2
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.

Thanks @JamesTran-MSFT for the reply, but I got what exactly the issue is. Under the Powershell, if we need to run Preview module, we need to uninstall Azure AD Module and then only we will get Preview commands.

0 Votes 0 ·
JamesTran-MSFT avatar image JamesTran-MSFT shashanksaxena-6941 ·

@shashanksaxena-6941
Thank you for following up on this, sharing your solution, and I'm glad that you were able to resolve your issue!


If you have any other questions, please let me know.
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 ·