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)

Group policy default policy cannot be edited because network name not found

Windows server 2012 r2 inplace upgrade failed