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.
Emma Bailey
Dec 24, 2019Iron Contributor
I just found this thread because I was having the same problem - thank you for these instructions Glenn Goffin, they did the trick for me!