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

Generating Event ID 91, 44 with CA (In Event Viewer with source as Certsvc)

Windows server 2012 r2 inplace upgrade failed

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