Forum Discussion
Andy_Bond
Mar 03, 2019Copper Contributor
Can't import SharePoint online Powershell module
when I use Import-Module Microsoft.Online.SharePoint.PowerShell it says PS C:\Windows\system32> Import-Module Microsoft.Online.SharePoint.PowerShell Import-Module : Could not load type 'Microsoft...
Glenn Goffin
Brass Contributor
I had the exact same problem, mine was caused by Microsoft.SharePoint.Client.dll installed in the Global Assembly Cache.
To resolve the issue,
(1) Navigate to C:\Windows\Microsoft.NET\assembly\GAC_MSIL
(2) Remove the Microsoft.SharePoint.* assemblies
(3) Uninstall the module with Uninstall-Module -Name Microsoft.Online.SharePoint.PowerShell
After reinstalling the module from the PowerShell gallery, the module worked flawlessly.
To resolve the issue,
(1) Navigate to C:\Windows\Microsoft.NET\assembly\GAC_MSIL
(2) Remove the Microsoft.SharePoint.* assemblies
(3) Uninstall the module with Uninstall-Module -Name Microsoft.Online.SharePoint.PowerShell
After reinstalling the module from the PowerShell gallery, the module worked flawlessly.
samartomar
Aug 20, 2020Copper Contributor
Thank you worked.