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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.