Jump to content

Automatically rename guest and admin accounts?


Recommended Posts

Hi,

Just getting my first unattended install CD together and one thing I haven't worked out how to do yet is make it so my install renames the Administrator and Guest account for me.

At the moment I have to use gpedit.msc to apply the changes after the install and I would really like them to be unattended.

Any ideas how I do this?

Link to comment
Share on other sites


I use a vbs file (created by a forum but I don't remember who !)

in your $OEM$\cmdlines.txt add this :

[Commands]
"Wscript Accounts.vbs"

and the $OEM$\Accounts.vbs :

On Error Resume Next

strComputer = "."

Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & "." & "\root\default:StdRegProv")

strComputer = WshNetwork.ComputerName

'Administrator
Set oMachine = GetObject("WinNT://" & strComputer)
Set oInfoUser = GetObject("WinNT://" & strComputer & "/Administrator,user")
set oUser = oMachine.MoveHere(oInfoUser.ADsPath,"***YourNewAdminName***")

'Guest
Set oMachine = GetObject("WinNT://" & strComputer)
Set oInfoUser = GetObject("WinNT://" & strComputer & "/Guest,user")
set oUser = oMachine.MoveHere(oInfoUser.ADsPath,"***YourNewGuestName***")

Link to comment
Share on other sites

You could also use the resource kit utility, cusrmgr.exe or create a security template, applied with secedit.exe or gpupdate utilities to rename the Administrator and Guest accounts.

I have used both and they work equally reliably.

Good luck.

Link to comment
Share on other sites

This actually worked fine.

VB script above,

ECHO.
ECHO Renaming User accounts
ECHO Please wait...
start /wait %systemdrive%\Install\accounts.vbs

Within my start.cmd script executed on the first logon after the install. [GUIRunOnce] in my winnt.sif

I now have every thing working fully unattended apart from initial partitioning (left that attended on purpose.) and more frustratingly the autologon after the main GUI XP install.

I still have to enter my password manually to logon and start the OEM installations.

[GuiUnattended]
   AdminPassword=MD5 Hash removed
   EncryptedAdminPassword=Yes
   AutoLogon=Yes
   AutoLogonCount=1
   OEMSkipRegional=1
   TimeZone=85
   OemSkipWelcome=1

any ideas why this fails?

Link to comment
Share on other sites

To autologon you must entry info in registry, and with this method the password appears in clear.

Windows Registry Editor Version 5.00 

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon]
"DefaultUserName"="LoginName"
"DefaultPassword"="RealPassword"
"AutoAdminLogon"="1"

Link to comment
Share on other sites

any ideas why this fails?
It's probably becuase the AutoLogon referred to a username which no longer exists!

No because this autologon occurs prior to the username rename script. It turns out that autologon only works if the password in stated in the winnt.sif in cleartext, encryption does not work.

Link to comment
Share on other sites

My mistake, I had not noticed that you were running your start.cmd after logon, i.e. at GUIRunOnce. The reason I didn't is because if you don't change the account name for the Administrator, before it logs on, the Profile folder for NewName will still be called Administrator. Making the change at some point up to and including cmdlines.txt would prevent this profile folder name difference.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...