Forum Discussion

gzygadlo's avatar
gzygadlo
Copper Contributor
Aug 19, 2021
Solved

AzureAD Powershell 7

Wondering if any version of PowerShell 7 will work with the AzureAD or AzureADPreview modules.  When I try to connect I get an error "One or more errors occurred"

 

I'm trying to move my environment from Windows Power 5.1 to Windows Powershell 7.  Currently running Powershell 7.2 Preview 7.  Maybe there is another module I need to use instead of AzureAD or AzureADPreview.

 

Thanks

  • gzygadlo The recommended approach, until those modules are fully compatible with newer versions of PowerShell, would be to import them with the -UseWindowsPowerShell option in your PowerShell 7 session. This will load the module in the version of PowerShell included with Windows, but using implicit remoting you can use it as if it were loaded in PowerShell 7.

     

    This is described on this webpage.

4 Replies

  • pvanberlo's avatar
    pvanberlo
    Steel Contributor

    gzygadlo The recommended approach, until those modules are fully compatible with newer versions of PowerShell, would be to import them with the -UseWindowsPowerShell option in your PowerShell 7 session. This will load the module in the version of PowerShell included with Windows, but using implicit remoting you can use it as if it were loaded in PowerShell 7.

     

    This is described on this webpage.

      • LainRobertson's avatar
        LainRobertson
        Silver Contributor

        Wolfgang_Bures_SV 

         

        A lot has changed since this was first posted in 2021.

         

        Nothing will likely be fixed in the AzureAD and AzureADPreview modules as they are now deprecated (having had their deprecation date postponed a few times already prior to March 2024).

         

         

        The only supported pathway moving forward is - as per pvanberlo's comment above - to leverage the Microsoft Graph modules (for which there are now two flavours these days: normal and beta - with beta frequently exposing significantly more data).

         

        Do not use AzureAD* for any new work, and for any existing work, you should already be planning how to migrate off them prior to March 2025 (at the time of writing).

         

        Also make sure for any existing AzurAD* modules installed that they're running at least the minimum version listed in the deprecation notice above.

         

        Cheers,

        Lain

Resources