Share via

Install Microsoft Azure Active Directory Module for Windows PowerShell

Anonymous
2018-10-09T22:27:07+00:00

Trying to follow instructions to Install Microsoft Azure Active Directory Module for Windows PowerShell. So many instructions and deviations (even from MS pages) I am not sure I have it installed.

I do know that after following all instructions I do not have the option to select a PowerShell command window that is titled "Microsoft Azure Active Directory Module for Windows PowerShell".

Also I have found that I can get prompted for office 365 credentials, connect and perform PowerShell commands via regular PowerShell (run as administrator), but it appears some of the new command lets stop with errors.

So to start with the easy question: After going thru all the requirements for Azure Active Directory PowerShell, should I have an icon somewhere that allows me to invoke a PowerShell session and see a titled PowerShell window**"Microsoft Azure Active Directory Module for Windows PowerShell"?**

Please help.

This is October 9 2018 - Instructions seem outdated even from 2017?

Thank you

Steve

Microsoft 365 and Office | Subscription, account, billing | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

  1. Anonymous
    2018-10-10T02:34:02+00:00

    PowerShell command window with a title bar "Microsoft Azure Active Directory Module for Windows PowerShell" is either deprecated or obsolete.

    I still use the old Azure AD module for W indows, but yes, it was deprecated.

    You can try to download it from these links though:

    https://www.microsoft.com/en-us/download/detail...

    https://bposast.vo.msecnd.net/MSOPMW/Current/am...

    If your getting connection errors try to download the old version.

    If I want to perform Office 365 PowerShell commands like "Restore-MsolUser -UserPrincipalName <account>" , I need to authenticate using Connect-MsolService first.

    Yes .It is included in this connection command :

    $Creds = Get-Credential

    Connect-MsolService –Credential $Creds

    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powerShell-liveID... -Credential $Creds -Authentication Basic -AllowRedirection

    Import-PSSession $Session

    This script let you connect to MSOL and Exchange in the same session

    If I want to perform AzureAD PowerShell commands I need to authenticate using Connect-AzureAD.

    Yes . You can tell me which one and I can help you with it

    I also believe even though there is an AzureAD command for removing accounts (soft delete), I do not believe there is its counter part command for restoring?

    Soft delete:

    remove-MsolUser -UserPrincipalName user@example.com

    Hard Delete (delete from deleted)

    Remove-MsolUser -UserPrincipalName user@example.com -RemoveFromRecycleBin -Force

    Restore User (Soft deleted)

    Restore-MsolUser -UserPrincipalName user@example.com

    best regards !

    germain

    0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Anonymous
    2018-10-10T00:22:01+00:00

    Hello Stevelsd !

    In Windows 10 , open up Windows PS as administrator and run:

    1.    set-executionpolicy -scope currentuser -executionpolicy unrestricted –force
      

    2.       Install-Module –Name PowerShellGet –Force (wait for the green strip)

     
    

    3.       Install-Module –Name msonline

     

    4.       Then Connect with this one:

    $Creds = Get-Credential

    Connect-MsolService –Credential $Creds

    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powerShell-liveID... -Credential $Creds -Authentication Basic -AllowRedirection

    Import-PSSession $Session

    Let me know how it goes !

    germain

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2018-10-12T07:46:33+00:00

    Hi Stevelsd,

     Did you do those tests according to the advice of Germain? If the problem persists, you could come back and we will do our best to help you.

    Regards

    Sukie

    0 comments No comments
  3. Anonymous
    2018-10-10T01:46:00+00:00

    Thanks All

    Here is what I have discerned and some of this could be wrong but maybe not.

    PowerShell command window with a title bar "Microsoft Azure Active Directory Module for Windows PowerShell" is either deprecated or obsolete.

    If I want to perform Office 365 PowerShell commands like "Restore-MsolUser -UserPrincipalName <account>" , I need to authenticate using Connect-MsolService first.

    If I want to perform AzureAD PowerShell commands I need to authenticate using Connect-AzureAD.

    I also believe even though there is an AzureAD command for removing accounts (soft delete), I do not believe there is its counter part command for restoring?

    If I follow what I have mentioned above, there are no issues.  I am just coming into Office 365 so I am a number of years behind in how this all works.

    Thanks again

    Steve

    0 comments No comments
  4. Anonymous
    2018-10-10T00:58:10+00:00

    Nope but thanks for the effort.

    I can connect to my Office 365 domain and perform admin commands but I see some that fail and they are part of the V2 version. The question I asked might assist. Is the PowerShell command window with a title bar "Microsoft Azure Active Directory Module for Windows PowerShell" obsolete and all is done in a regular PowerShell session?

    Below is the one big error I got on the cred authentication.

    PS C:\WINDOWS\system32> Connect-MsolService –Credential $Creds

    PS C:\WINDOWS\system32> $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powerShell-liveID... -Credential $Creds -Authent

    ication Basic -AllowRedirection

    New-PSSession : [outlook.office365.com] Connecting to remote server outlook.office365.com failed with the following error message : The WinRM client sent a request to an HTTP

    server and got a response saying the requested HTTP URL was not available. This is usually returned by a HTTP server that does not support the WS-Management protocol. For more

    information, see the about_Remote_Troubleshooting Help topic.

    At line:1 char:12

    • $Session = New-PSSession -ConfigurationName Microsoft.Exchange -Conne ...

    +            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotingTransportException

        + FullyQualifiedErrorId : URLNotAvailable,PSSessionOpenFailed

    PS C:\WINDOWS\system32> Import-PSSession $Session

    Import-PSSession : Cannot validate argument on parameter 'Session'. The argument is null. Provide a valid value for the argument, and then try running the command again.

    At line:1 char:18

    • Import-PSSession $Session

    +                  ~~~~~~~~

        + CategoryInfo          : InvalidData: (:) [Import-PSSession], ParameterBindingValidationException

        + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.ImportPSSessionCommand

    0 comments No comments