SharePoint Online PowerShell – Resolving error – Import-Module: Could not load type ‘Microsoft.Online.SharePoint.TenantAdministration.OptInReportEntityEnum’ from assembly ‘Microsoft.Online.SharePoint.Client.Tenant, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c’

Hi All,
Greetings for the day!
Today new issue and solution!
Background
- I want to execute few SharePoint Online PowerShell CMDLETs.
- To execute SharePoint Online PowerShell CMDLETs, I was importing SharePoint Online PowerShell module – Microsoft.Online.SharePoint.PowerShell using Import-Module CMDLET
Import-Module Microsoft.Online.SharePoint.PowerShell
- While executing above CMDLET we were getting an error.
Error
Import-Module: Could not load type ‘Microsoft.Online.SharePoint.TenantAdministration.OptInReportEntityEnum’ from assembly ‘Microsoft.Online.SharePoint.Client.Tenant, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c’.

Solution
- After bit googling found simple steps.
- Uninstall the module and install again.
- Uninstalling the module
Uninstall-Module -Name Microsoft.Online.SharePoint.PowerShell -AllVersions
- Once module uninstalled successfully, we will install the module again.
Install-Module -Name Microsoft.Online.SharePoint.PowerShell
- As SharePoint Online PowerShell module installed successfully, we are able to import the module successfully as shown in figure below

REFERENCES
- PowerShell – Exploring Module CMDLETs – https://knowledge-junction.in/2022/12/12/__trashed-2/
Thanks for reading!!!
HAVE A FANTASTIC TIME AHEAD !!! LIFE IS BEAUTIFUL 🙂

You must be logged in to post a comment.