We help IT Professionals succeed at work.

Remove Local Admin, Delete an Account, Add User

stlhost
stlhost asked
on
Looking for a way to remove 1 local account. Add an account with a password, set it to never expire and add it to the local admin group.

WMIC USERACCOUNT WHERE "Name='ctcpoweruser'" SET PasswordExpires=FALSE /EXPIRES:NEVER /PASSWORDCHG:NO /ADD

The account I need to remove is ctc and I need to add ctcpoweruser to the local admin group. If this can't be done with WMIC using some other command would be fine. I will be passing this all through a bat file that will psexec it out to all workstations
Comment
Watch Question

IT technician
Commented:
I don't know about wmic, but you can easily do it using the net user and net localgroup commands in batch files.
Take a look at this article for full instructions.