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
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.
Sign up to join this communityI 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
Should work more or less the same:
$identity = $web.EnsureUser($user)
$ctx.Load($identity)
$ctx.ExecuteQuery()
$Context = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
$replacedUser =$Context.Web.EnsureUser(domain\USER)
this worked