Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

need to create a Batch file to run a ps1 file as administrator

$
0
0

Hello i need desperate help, i have this power shell command

 

$computer = [ADSI]"WinNT://$env:ComputerName"
 $user = $computer.Create("User", "ncuser")
 $user.setpassword("Welcome123")
 $user.put("description","")
 $user.SetInfo()

 

its to create a local user in multiple computers so i have added to a GPO but it doesnt run because it needs administrator rights. does anyone knows how can i accomplish this?

 

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles