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.
Allison Bates
Feb 17, 2020Brass Contributor
I have very same error/issue trying to load on a SharePoint 2019 server. I don't think it would be a good idea to delete all the Microsoft.SharePoint assemblies from this server. Any ideas if it will corrupt the SharePoint installation?
- ValerianHMay 12, 2020Copper Contributor
would be also very interesting for me whether "clearing" the GAC destroys SharePoint Server installation.