Forum Discussion
Sakshi Amla
May 31, 2018Copper Contributor
Error while connecting to SharePoint online tenant through powershell
I am using below code to loop through all site collections in my tenant, search for a specific keyword and export the search results to csv. cls $host.Runspace.ThreadOptions = "ReuseThread" [S...
Manidurai Mohanamariappan
Jun 01, 2018Iron Contributor
It seems you are using old Microsoft.Online.SharePoint.Client.Tenant.dll, so you can get the new dll from new Sharepoint online PowerShell module.
https://www.microsoft.com/en-in/download/details.aspx?id=35588
After installation, you need to change assembly path in your script like
Add-Type -Path "C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.SharePoint.Client.Runtime.dll"
Add-Type -Path "C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.Online.SharePoint.Client.Tenant.dll" Note: Above script, I added my default installation path and you can find the SharePoint module installation path using Get-Module -ListAvailable