Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: sysprep computername

12 Sep 2011   #1
i486dx266

Windows 7 Pro x64
 
 
sysprep computername

Windows 7 Pro x64 SP1. Trying to create image using WAIK and sysprep. Everything working fine except this: Want sysprep to prompt for computername during firstboot. Seems to work fine. Computer reboots and logs in as local admin. Checking and can confirm it is joined to the domain with computername given during firstboot. However, when logging on with a domain account i get this error: "the security database on the server does not have a computer account for this workstation trust" and when checking AD it is registered with a generic "WIN-g7ek58blabla" name instead of the given name. Here's the strange thing: When putting "<ComputerName>*</ComputerName>" in unattend.xml to make generic computername sysprep works just fine... no errors on login. Ideas?


My System SpecsSystem Spec
.
13 Sep 2011   #2
i486dx266

Windows 7 Pro x64
 
 

Anything? Anyone?
My System SpecsSystem Spec
13 Sep 2011   #3
i486dx266

Windows 7 Pro x64
 
 

Here's my unattend.xml and below the joindomain.vbs

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="generalize">
<component name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="blabla" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SkipRearm>1</SkipRearm>
</component>
</settings>
<settings pass="specialize">
<component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="blabla" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>1</Order>
<Path>net user administrator /active:no</Path>
</RunSynchronousCommand>
</RunSynchronous>
</component>
<component name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="blabla" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SkipAutoActivation>true</SkipAutoActivation>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="blabla" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<CopyProfile>false</CopyProfile>
<ShowWindowsLive>false</ShowWindowsLive>
<TimeZone>Romance Standard Time</TimeZone>
</component>
</settings>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="blabla" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<UILanguage>en-US</UILanguage>
<SystemLocale>nb-NO</SystemLocale>
<UserLocale>nb-NO</UserLocale>
<InputLocale>nb-NO</InputLocale>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="blabla" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<AutoLogon>
<Password>
<Value>blabla==</Value>
<PlainText>false</PlainText>
</Password>
<Enabled>true</Enabled>
<LogonCount>1</LogonCount>
<Username>admin</Username>
</AutoLogon>
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<CommandLine>cscript //b c:\windows\system32\slmgr.vbs /ipk xxxx-xxxx-xxxx-xxxx-xxxx</CommandLine>
<Order>1</Order>
<RequiresUserInput>false</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<CommandLine>cscript //b c:\windows\system32\slmgr.vbs /ato</CommandLine>
<Order>2</Order>
<RequiresUserInput>false</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<CommandLine>c:\temp\scripts\JoinDomain.vbs</CommandLine>
<Order>3</Order>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
</FirstLogonCommands>
<OOBE>
<HideEULAPage>true</HideEULAPage>
<NetworkLocation>Work</NetworkLocation>
<ProtectYourPC>1</ProtectYourPC>
</OOBE>
<UserAccounts>
<AdministratorPassword>
<Value>blabla</Value>
<PlainText>false</PlainText>
</AdministratorPassword>
<LocalAccounts>
<LocalAccount wcm:action="add">
<Password>
<Value>blabla==</Value>
<PlainText>false</PlainText>
</Password>
<Description>Local Administrator</Description>
<Group>Administrators</Group>
<Name>Admin</Name>
<DisplayName>Admin</DisplayName>
</LocalAccount>
</LocalAccounts>
</UserAccounts>
<RegisteredOrganization>RegisteredOrganization</RegisteredOrganization>
<RegisteredOwner>NO</RegisteredOwner>
</component>
</settings>
<cpifflineImage cpi:source="catalog:c:/sw_dvd5_win_pro_7w_sp1_64bit_english_-2_mlf_x17-59279/sources/install_windows 7 professional.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>

----------------------------------------------------------------
Call DoSomething

Sub DoSomething

Dim strPassword
Dim strDomain
Dim strUser

Const JOIN_DOMAIN = 1
Const ACCT_CREATE = 2
Const ACCT_DELETE = 4
Const WIN9X_UPGRADE = 16
Const DOMAIN_JOIN_IF_JOINED = 32
Const JOIN_UNSECURE = 64
Const MACHINE_PASSWORD_PASSED = 128
Const DEFERRED_SPN_SET = 256
Const INSTALL_INVOCATION = 262144

strDomain = "domain.name"
strUser = "uid"

Set objNetwork = CreateObject("WScript.Network")
strComputer = objNetwork.ComputerName

Set objComputer = GetObject("winmgmts:{impersonationLevel=Impersonat e}!\\" & strComputer & "\root\cimv2:Win32_ComputerSystem.Name='" & strComputer & "'")

Do
strPassword = InputBox("Enter password to join domain:", "Join to Domain", "password")
If strPassword = "" Then Exit Sub

ReturnValue = objComputer.JoinDomainOrWorkGroup(strDomain, strPassword, strDomain & "\" & strUser, NULL, JOIN_DOMAIN + ACCT_CREATE)

If ReturnValue = 1326 Then
MsgBox "Logon failure: unknown username or bad password."
End If

If ReturnValue <> 1326 Then Exit Do
Loop

If ReturnValue = 5 Then
MsgBox "Access is denied. Run from an elevated command prompt."
Exit Sub
ElseIf ReturnValue = 87 Then
MsgBox "The parameter is incorrect."
Exit Sub
ElseIf ReturnValue = 110 Then
MsgBox "The system cannot open the specified object."
Exit Sub
ElseIf ReturnValue = 1323 Then
MsgBox "Unable to update password."
Exit Sub
ElseIf ReturnValue = 1355 Then
MsgBox "The specified domain does not exist or could not be contacted."
Exit Sub
ElseIf ReturnValue = 2224 Then
MsgBox "The account already exists."
Exit Sub
ElseIf ReturnValue = 2691 Then
MsgBox "The machine is already joined to the domain."
Exit Sub
ElseIf ReturnValue = 2692 Then
MsgBox "The machine is not currently joined to the domain."
Exit Sub
End If

If ReturnValue = 0 Then
If MsgBox("Domain joined successfully. Restart machine?", vbQuestion + vbYesNo) = vbYes Then
Set OpSysSet = GetObject("winmgmts:{(Shutdown)}//./root/cimv2").ExecQuery("select * from Win32_OperatingSystem where Primary=true")
For Each OpSys in OpSysSet
OpSys.Reboot()
Next
Else
'Just quit
End If
End If

End Sub

My System SpecsSystem Spec
.

13 Sep 2011   #4
cluberti

Windows 10 Pro x64
 
 

After changing the name during firstboot, did you reboot for the change to take effect? If you look in the UI it will have "changed", but until a reboot (if you're prompting for a name), it will still be the sysprep name. Unless setup itself changes the name (which is done pre-boot), you *must* reboot before joining a domain.
My System SpecsSystem Spec
19 Sep 2011   #5
i486dx266

Windows 7 Pro x64
 
 

Yes, there is a prompt for a name during firstboot. Tis is during the sysprep process. It auto logs in ad local admin, we do some other stuff, then reboot. When logging in it still complains about the issue. We will drop this and go for generic names, which does work. We have no time to error seek this issue, but thanks for the help anyway :-)
My System SpecsSystem Spec
Reply

 sysprep computername




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Rogue computername.exe process
G'day, hoping that someone here can help me work out how to permanently fix this issue. Yesterday my computer revved up and stayed that way. I looked and the CPU usage through the task manager and it was sitting at about 51% but I didn't have any programs open. I then narrowed down the process...
Performance & Maintenance
Cannot access \\computername. You don't have permission....
Hi everyone, this is my first post. Let me first apologize for my english :-) I need your help because i'm getting crazy with some computer. My office lan is quite heterogeneous : some PCs are in a local domain, other not yet. One computer (let's call it PC-A) is a winxp professional SP2...
Network & Sharing
Sysprep - Windows 7 - unable to sysprep image that joins domain
Good morning all: Below is my unattend.xml. I am using the sysprep + win7 for creating virtual machines in Red Hat Enterprise Virtualization 3.0 but having difficulty getting them to auto-join the domain. My sysprep progression proceeds normally and completes. The initial boot of the image...
Virtualization
win7 after sysprep reboot always with sysprep box
hello, 1st sorry for my english (i'm french guy). I made a sysprep and all parameters are corrects. but after the reboot I have always the sysprep preparation tools box. for me the sysprep is correct but I don't know what's happended. in attachment my unattend.xml
Installation & Setup
Cannot connect a XP PC by ComputerName but IP..
My home network consists of one desktop (XP Home), one acer netbook (Win7 Starter) and a HP notebook (Win7 Home Premium). all computers with same workgroup name. recently, the HP notebook can no longer acess the XP by Name after I mess around with homegroup. when i type \\XPComputer it...
Network & Sharing
Accessing Computername\C$ from windows 7 Home
Hello, I have been running into this problem recently where i cannot access another computers hard drive from windows 7, knowing the username and password. I have tried using "Computername\Username" as the user name, along with "Username@computername" to no avail. What is really confusing me,...
Network & Sharing


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 07:52.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App