0

I want to get the User ID using PowerShell CSOM

I know its $replacedUser =$web.EnsureUser("domainName\Account") server side but I don't know how to do it client side

2 Answers 2

2

Should work more or less the same:

$identity = $web.EnsureUser($user)
$ctx.Load($identity)
$ctx.ExecuteQuery()
1
$Context = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
$replacedUser =$Context.Web.EnsureUser(domain\USER)

this worked

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.