/build/static/layout/Breadcrumb_cap_w.png

Scripting Question


I wan't to know how I can create a local account with admin rights on a clientpc.

04/04/2019 466 views

I'm using Specops os/deploy and during the deploy I wan't to create a local account with admin rights.

Many thanks in advance

Kind regards

Filip

 

0 Comments   [ + ] Show comments

Comments


All Answers

0

Save the following as a .bat file.

net user username Password /add /active:yes
net localgroup administrators username /add

And run during deployment.


Edit parts in Bold.

Answered 04/04/2019 by: Ziggi
Blue Belt

0

Powershell option (v5.1+)


$AccountNameParams = @{
Name = "AccountName"
Password = ('l337p@ssw0rd' | ConvertTo-SecureString -AsPlainText -Force)
FullName = "Account Name"
AccountNeverExpires = $true
PasswordNeverExpires = $true
Confirm = $false
}

New-LocalUser @AccountNameParams
Answered 04/04/2019 by: isudothings
Senior Purple Belt

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ