I am trying to put a script together to change the local
Administrator password and rename the account. I have the
password change down, I just need to get the proper
syntax for renaming the account.
Your help is appreciated.
Hi
Several possible ways:
=======================================================
An option is to use the freeware utility BuiltIn.exe by Marty List. It handles
both the renaming part as well as changing the password. If you use it for both
tasks, you should run that as two separate callouts to BuiltIn.exe, because if
you do both of them in the same callout, and one of the tasks fail, the other
one fails as well.
http://www.optimumx.com/download/
builtin /?
<quote>
BuiltIn Account Manager [Version 1.10]
Displays or manages the builtin Administrator or Guest account, without knowing
what the current name is.
The syntax of this command is:
builtin [/details] [/newname:name] [/newpw:password] [/disabled:y|n]
[/account:Guest] [\\computer] [/domain:name]
/details: Displays the account details, instead of just the name.
/newname: Allows you to rename the account, 20 characters max.
/newpw: Allows you to change the account password, 256 characters max.
/disabled: Allows you to disable or enable the account. (If policy allows)
/account: Specifies the Guest account instead. (Default is Administrator)
\\computer Allows you to manage the account on a remote system.
/domain: Manages the domain account instead. (Overrides \\computer)
An argument of /? or -? displays this syntax and always returns 1.
A successful completion will return 0.
Copyright 2002 Marty List, Ma...@OptimumX.com
</quote>
=======================================================
Using vbscript/adsi or cusrmgr.exe is an also an option:
--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter