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"."

Was it helpful?

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top