Office 365 pre-provision my site issue with Powershell
-
02-10-2020 - |
Question
I am creating personal sites using powershell csom.
My issue is on below line
$loader = [Microsoft.SharePoint.Client.UserProfiles.ProfileLoader]::GetProfileLoader($ctx)
I get following error.
$loader = [Microsoft.SharePoint.Client.UserProfiles.ProfileLoader]::GetProfileLoader($ctx)
Cannot convert argument "context", with value:
"Microsoft.SharePoint.Client.ClientContext", for "GetProfileLoader" to type "Microsoft.SharePoint.Client.ClientRuntimeContext": "Cannot convert the "Microsoft.SharePoint.Client.ClientContext" value of type "Microsoft.SharePoint.Client.ClientContext" to type "Microsoft.SharePoint.Client.ClientRuntimeContext"."
Solution
I was running into the same issues and it turned out I was referencing the wrong DLLs. I was also having issues with CreatePersonalSiteEnqueueBulk
not being recognized.
I was referencing the 15 version not the 16 version and also the 16 version I had was out of date. Be sure you are referencing the proper DLL and have the most up to date version. I'm now running 16.0.3104.1200 and these issues went away.