Allow local admin access

I need to allow local administrator access to a few users through BigFix. I executed the following command, but it was completed with exit code=2. After checking the affected machines, I found that the users were not added to the Administrators group. Could you please assist in creating a BigFix package to give the local admin access?

if {(exists (computer name) whose (it as string as lowercase = “hostname1” as lowercase))}
waithidden net localgroup “administrators” “user1@xyz.com” /add /Y
endif

if {(exists (computer name) whose (it as string as lowercase = “hostname2” as lowercase))}
waithidden net localgroup “administrators” “user2@xyz.com” /add /Y
endif

if {(exists (computer name) whose (it as string as lowercase = “hostname3” as lowercase))}
waithidden net localgroup “administrators” “user3@xyz.com” /add /Y
endif

This works.

action uses wow64 redirection false waithidden cmd.exe /C net localgroup Administrators DOMAIN\Username /add
Obviously change the domain\username values and then just deploy the fixlet to the servers you want.

I have changed the value and tested it on my machine, but it didn’t work. It is completed with an exit code=1.