1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
#Create users with passwords on a remote computers #Important #Need activate: #PS C:\Windows\System32\WindowsPowerShellv1.0> C:\Windows\System32\svchost.exe -k NetworkService #PS C:\Windows\System32\WindowsPowerShellv1.0> winrm quickconfig #Execute PowerShell as administrator #Content file user.txt: #(line 1)pepito,pass1 #(line 2)juanito,pass2 $userandpass=Get-Content C:\powershell\fichero.txt foreach($i in $userandpass) { $partiruserandpass=$i.Split(",") Invoke-Command{ net user $partiruserandpass[0] /add $partiruserandpass[1]} -Computername computer } |