This post is about fixing Microsoft Teams PowerShell error: The ‘Connect-MicrosoftTeams’ command was found in the module ‘MicrosoftTeams’, but the module could not be loaded. For more Information, run “Import-Module MicrosoftTeams”.
The Initial Error
![](https://ictfella.com/wp-content/uploads/2022/05/connect-microsoftteams-found-in-the-module-but-could-not-be-loaded.png)
Tried uninstall and install again but not helping, we can see the module is correctly installed
PS C:\Windows\system32> Uninstall-Module MicrosoftTeams -AllVersions -Force
PS C:\Windows\system32> Install-Module MicrosoftTeams -MinimumVersion "2.0.0"-AllowClobber
PS C:\Windows\system32> Get-Module -ListAvailable -Name MicrosoftTeams
![](https://ictfella.com/wp-content/uploads/2022/05/uninstall-module-microsoftteams-all-versions-get-module.png)
Now we run “import-module MicrosoftTeams”, we found the root cause “running scripts is disabled on this system“
PS C:\Windows\system32> import-module MicrosoftTeams
![](https://ictfella.com/wp-content/uploads/2022/05/import-module-microsoftteams-canot-be-loaded-running-script-is-diabled.png)
The Fix
The fix is very straightforward: change the execution policy
PS C:\Windows\system32> Set-ExecutionPolicy Unrestricted
![](https://ictfella.com/wp-content/uploads/2022/05/microsoftteams-set-executionpolicy-unrestricted.png)
Useful Link
https://docs.microsoft.com/en-us/microsoftteams/teams-powershell-install
Hi there,
My suggestion is to choose ‘RemoteSigned’
This still allows to run local scripts but not (unintentionally) downloaded scripts.
So a slightly more secure option.
Thanks for the writeup that let me to dig deeper on this subject.