Howdy--
There's probably a better way to do it, but I wrote a javascript script
to rename local accounts. I just put it in my \bin directory add a call
to it in the _bottom section of my unattend.txt file like so:
cscript %z%\bin\renameacct.js Administrator SomeOtherAccountName
-Matt
vv-- Begin Script (enableacct.js) --vv
/***********************************************************************
********
* renameacct.js
*
* Renames a local user account.
*
* Usage:
*
* cscript renameacct.js <OldAccountName> <NewAccountName>
*
\***********************************************************************
*******/
var computerName, oldUserName, newUserName;
var network = WScript.CreateObject("WScript.Network");
var computer, user;
oldUserName = WScript.Arguments(0);
newUserName = WScript.Arguments(1);
// Get the local computer name
computerName = network.ComputerName;
// Get the local computer object
computer = GetObject("WinNT://" + computerName);
try
{
user = GetObject("WinNT://" + computerName + "/" + oldUserName +
",user");
computer.MoveHere(user.ADsPath, newUserName);
}
catch (ex)
{
}
^^-- End Script --^^
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Tony
Worrall
Sent: Tuesday, January 18, 2005 8:54 AM
To: [email protected]
Subject: [Unattended] Renaming the administrator account
Hi all,
After the 'amazing' response to my first post to the list,
http://www.mail-archive.com/unattended-info%40lists.sourceforge.net/msg0
3087.html,
I thought I'd try another one, perhapsa littel easier this time? :)
How can I rename the default administrator account after unattended
install of any windows system?
TIA for any advice/help.
--
Tony Worrall
Privileged, confidential or patient identifiable information may be contained
in this message. This information is meant only for the use of the intended
recipients. If you are not the intended recipient, or if the message has been
addressed to you in error, do not read, disclose, reproduce, distribute,
disseminate or otherwise use this transmission. Instead, please notify the
sender by reply e-mail, and then destroy all copies of the message and any
attachments.
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
unattended-info mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/unattended-info