Thanks to all who replied, a few different ways of doing it, the vb &
jscript was the way to go for me :)
Tony Worrall
Hinz, Matthew wrote:
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.
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
unattended-info mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/unattended-info