Dears
how can i use ADSI function command to create local account then add it to administrators group
for the list of machines remotely, i used the below script to delete local account is it possible to modify it
to create then add to administrators group.
Function Delete-User {
#Deletes a local user account on target computer
Param (
[string]$computer,
[string]$user
)
[ADSI]$server = "WinNT://$computer"
$server.delete("user",$user)
}
Import-Csv -path C:\temp\Accounts.csv | %{ Delete-User -computer $_.server -user $_.user }
Mohamed Soliman System Administrator +971552997724