$csv_path='C:\Users\Administrator\Desktop\users.csv'
$csv=Import-Csv -Path $csv_path -Encoding UTF8 -Delimiter ';'
$local_group_name="Remote Desktop Users"
foreach ($c in $csv) {
$password=ConvertTo-SecureString -String $c.Password -AsPlainText -Force
New-LocalUser -FullName $c.Name -Name $c.Login -Password $password
Add-LocalGroupMember -Group $local_group_name -Member $c.Login
}
$csv=Import-Csv -Path $csv_path -Encoding UTF8 -Delimiter ';'
$local_group_name="Remote Desktop Users"
foreach ($c in $csv) {
$password=ConvertTo-SecureString -String $c.Password -AsPlainText -Force
New-LocalUser -FullName $c.Name -Name $c.Login -Password $password
Add-LocalGroupMember -Group $local_group_name -Member $c.Login
}
Комментариев нет:
Отправить комментарий