Forum Discussion

LeonWG's avatar
LeonWG
Copper Contributor
Aug 20, 2024
Solved

AD Connect threw an exception Powershell 7

Hello, i have an issue with powershell 7 somehow when i start manually the Azure AD sync i recieve following message: "Start-ADSyncSyncCycle: The type initializer for 'System.Web.Util.Utf16StringVa...
  • LainRobertson's avatar
    Aug 20, 2024

    LeonWG 

     

    Hi, Leon.

     

    I'd expect - given its age - that the AAD Connect modules were not authored with PowerShell in mind (as distinct from Windows PowerShell, which is what they would have been targeting).

     

    There's many first-party modules which fit this profile.

     

    Try running your Import-Module like this instead.

     

    Import-Module -UseWindowsPowerShell -Name ADSync;

     

     

    This will allow it to leverage the .NET Framework rather than only what's available in .NET Core.

     

    Cheers,

    Lain

Resources