script help (local users accounts management) Create, update , remove

Hello,

I tried without success to play with existing procedures, that exist to play with local admin users and rights.

Can you take a look at my scripts tunning ?
it says “success” but modifications are not shown on computers, except the script to remove existing admin account…

Thanks

procedures.zip (1.82 KB)

Hi @bas_dsi,

Please run these attached scripts modified by our script developers and provide your feedback.

Kind Regards,
PremJK

modified procedures.zip (1.28 KB)

Thank you,
the script to update the account parameter is ok,
the script to create user fail, I suppose due to password integration,
maybe the password is not passed correctly ? maybe passing it as argument of the procedure will work better ?

HEllo,

I modified script, now working…

Is there a way to play with 2 parameters (name and password) in 1 command (using 2 variables in the script) to avoid to write inside the different commands the username?
(in fact technically it was not possible to create the account without a password, so I merged the 2 actions in 1 line).

createAdminAccount.zip (835 Bytes)

@bas_dsi You can amend the attached parametric script with the necessary commands to add, edit or remove user, add or remove from a group, set the password to never expire, etc

Add-Local-Admin-Account-to-an-EP-Parametrized.json (2.09 KB)