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

WIMMount (HSM) causing cluster storage to go redirected (2012r2 DC)

Failed to delete the test record dcdiag-test-record in zone test.com

Azure MFA with Azure AD and RDS