Uploaded image for project: 'OpenIDM'
  1. OpenIDM
  2. OPENIDM-12185

Scripted Powershell Connector Azure AD Sample Uses Deprecated Untrusted/Unsigned MSOnline Powershell Module



      When running the Azure AD with Powershell Connector sample it was discovered that the MSOnline module used by the scripts are deprecated and unsigned by Microsoft.

      The install link in the documentation https://docs.microsoft.com/en-us/previous-versions/azure/jj151815(v=azure.100) has many warnings about deprecation and the install link form that page https://docs.microsoft.com/en-us/collaborate/connect-redirect?DownloadID=59185 states that Microsoft Connect has been retired.

      Error encountered when trying to use the module and having to set unrestricted execution:

      PS C:\Users\user> import-module msonline
      import-module : Errors occurred while loading the format data file:
      C:\Program Files\WindowsPowerShell\Modules\msonline\\MSOnline.Format.ps1xml, , C:\Program Files\WindowsPowerShell\Modules\msonline\\MSOnline.Format.ps1xml: The file was
      skipped because of the following validation exception: File C:\Program Files\WindowsPowerShell\Modules\msonline\\MSOnline.Format.ps1xml cannot be loaded. The file C:\Program
      Files\WindowsPowerShell\Modules\msonline\\MSOnline.Format.ps1xml is not digitally signed. You cannot run this script on the current system. For more information about running
      scripts and setting execution policy, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170..
      At line:1 char:1
      + import-module msonline
      + ~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : InvalidOperation: (:) [Import-Module], RuntimeException
          + FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand
      PS C:\Users\user> Set-ExecutionPolicy -ExecutionPolicy Unrestricted;
      Execution Policy Change
      The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose you to the security risks described in the about_Execution_Policies help
       topic at https:/go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy?
      [Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): y
      PS C:\Users\user> import-module msonline
      PS C:\Users\user> Connect-MsolService

      Recommend moving connector to new Azure AD for Powershell Graph module `AzureAD` https://docs.microsoft.com/en-us/powershell/azure/active-directory/install-adv2?view=azureadps-2.0




            • Assignee:
              gael Gael Allioux
              jim.mitchener Jim Mitchener
            • Votes:
              0 Vote for this issue
              5 Start watching this issue


              • Created: