if (user.SchemaClassName == "User")
// Create user DirectoryEntry newUser = localMachine.Children.Add("JohnDoe", "User"); newUser.Properties["FullName"].Value = "John Doe"; newUser.Invoke("SetPassword", new object[] "P@ssw0rd" ); newUser.CommitChanges(); lusrmgr.exe
# Export all local users and groups $output = @() Get-LocalUser | ForEach-Object $output += [PSCustomObject]@ Username = $_.Name Enabled = $_.Enabled LastLogin = $_.LastLogon Groups = (Get-LocalGroup if (user