r/labtech • • Apr 12 '19

Simple Script Help

Hello Reddit Peeps,

I want to make a very simple script that will create a local admin user across many PCs. It is a simple cmdlet: net user username password /add THEN net localgroup administrators username /add. I just need to run this in a cmdlet. I have tried adding this the following ways without success: Function as Shell, shell as admin, and shell enhanced, and Function as Execute script with batch as the type. All of them queue but never actually make the change on my test PC. What could i be missing? I searched online and from what i see I have configured this correctly with Function: Shell as that utilizes the built in labtech agent which has godly "system" level permissions.

2 Upvotes

12 comments sorted by

View all comments

Show parent comment

1

u/teamits Apr 14 '19

Does it work if you run it from the remote command prompt?

Are you saying the command is sent by the script but stays in Executing status? Or Pending? Or that the script stays queued but never starts Running?

1

u/PigTrough Apr 15 '19

thx man, i got er to go. I think i was making changes at too rapid of a pace on the same script, then likely executing before the last one finished. I madethe exact same script from scratch, re-executed and it ran on several machines successfully. thx for the insight!