Checking a valid user name of an account in Windows 7


hi

when creating account in windows 7, how check if user typed valid user name , if name exists on local computer?

thanks

bye


balubeto

this started:

$user = "user"  $computer = "computer"  $colusers = ([adsi]("winnt://$c,computer")).children | ? {$_.psbase.schemaclassname -eq "user"} | select -expand name  if ($colusers -contains $user) {    "$($user) exists"    }


Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

Azure MFA with Azure AD and RDS

Failed to setup initiator portal. Error status is given in the dump data.

Invalid pointer on gpresult /h gpreport.html