+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 30
Windows 7 Thread, Unattended ComputerName + Join Domain - Windows 7 in Technical; Hello all, I know from discussions on here that many people have or are thinking about deploying Windows 7, changing ...
  1. #1

    Michael's Avatar
    Join Date
    Dec 2005
    Location
    Birmingham
    Posts
    9,262
    Thank Post
    242
    Thanked 1,572 Times in 1,252 Posts
    Rep Power
    340

    Unattended ComputerName + Join Domain - Windows 7

    Hello all,

    I know from discussions on here that many people have or are thinking about deploying Windows 7, changing from Windows XP. The Sysprep process however is very different with Windows 7 and by default there's no method to specify a computer name before joining your network domain. Below is how to do it all from start to finish:

    1. From your Windows 7 Pro SP1 disc (volume license) copy the install_Windows 7 PROFESSIONAL.clg file from the \Sources\ folder into: C:\Windows\System32\Sysprep\

    2. Download Mysysprep2 here (scroll down the page) and extract MySysprep.exe into: C:\Windows\System32\Sysprep\

    3. Open up Notepad and paste the code below. Save the file as Sysprep.cmd in C:\Windows\System32\Sysprep\
    Code:
    @echo off
    mysysprep /oobe /generalize /unattend:c:\windows\system32\sysprep\unattend.xml
    4. Open up Notepad and paste the code below. Save the file as unattend.xml in C:\Windows\System32\Sysprep\
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <unattend xmlns="urn:schemas-microsoft-com:unattend">
        <settings pass="oobeSystem">
            <component name="Microsoft-Windows-International-Core" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <InputLocale>en-GB</InputLocale>
                <SystemLocale>en-GB</SystemLocale>
                <UILanguage>en-US</UILanguage>
                <UILanguageFallback>en-GB</UILanguageFallback>
                <UserLocale>en-GB</UserLocale>
            </component>
            <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <OOBE>
                    <HideEULAPage>true</HideEULAPage>
                    <NetworkLocation>Work</NetworkLocation>
                    <ProtectYourPC>1</ProtectYourPC>
                </OOBE>
                <UserAccounts>
                    <LocalAccounts>
                        <LocalAccount wcm:action="add">
                            <Password>
                                <Value>dwBlAGwAYwBvAG0AZQBQAGEAcwBzAHcAbwByAGQA</Value>
                                <PlainText>false</PlainText>
                            </Password>
                            <Description>Local User</Description>
                            <DisplayName>LOCAL USERNAME</DisplayName>
                            <Group>administrators</Group>
                            <Name>LOCAL USERNAME</Name>
                        </LocalAccount>
                    </LocalAccounts>
                </UserAccounts>
                <TimeZone>GMT Standard Time</TimeZone>
                <RegisteredOrganization>SCHOOL NAME</RegisteredOrganization>
                <RegisteredOwner>SCHOOL NAME</RegisteredOwner>
                <ShowWindowsLive>false</ShowWindowsLive>
            </component>
        </settings>
        <settings pass="specialize">
            <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <ProductKey>FJ82H-XT6CR-J8D7P-XQJJ2-GPDD4</ProductKey>
                <ComputerName>%Please input a computer name%</ComputerName>
                <RegisteredOrganization>SCHOOL NAME</RegisteredOrganization>
                <RegisteredOwner>SCHOOL NAME</RegisteredOwner>
                <ShowWindowsLive>false</ShowWindowsLive>
                <TimeZone>GMT Standard Time</TimeZone>
            </component>
            <component name="Microsoft-Windows-UnattendedJoin" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <Identification>
                    <Credentials>
                        <Domain>DOMAIN</Domain>
                        <Username>ADMINISTRATOR</Username>
                        <Password>PASSWORD</Password>
                    </Credentials>
                    <JoinDomain>DOMAIN</JoinDomain>
                </Identification>
            </component>
        </settings>
        <cpi:offlineImage cpi:source="catalog:c:/windows/system32/sysprep/install_windows 7 professional.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
    </unattend>
    You just need to search/change the following:

    LOCAL USERNAME - A suitable local account, such as for teachers when they're working from home
    SCHOOL NAME - Enter your school name
    %Please input a computer name% - Leave this as it is!
    DOMAIN - Enter your domain name
    ADMINISTRATOR - Specify the domain administrator account (if renamed)
    PASSWORD - Specify the domain administrator password

    Run the Sysprep.cmd file and Sysprep will start as normal. When the computer reboots, it'll prompt you for a computer name (of your choice), then join your domain. Windows 7 is then ready to be activated with a KMS server.

    The machine will be added to the Computers container where you can move it as required. You can specify an OU, but as all networks are different, I've tried to keep this as simple as possible!

    I hope this helps some of you! Good luck with your Windows 7 deployment!

  2. 3 Thanks to Michael:

    projector1 (20th December 2011), reggiep (28th February 2012), stevenlong1985 (28th January 2013)

  3. #2

    Michael's Avatar
    Join Date
    Dec 2005
    Location
    Birmingham
    Posts
    9,262
    Thank Post
    242
    Thanked 1,572 Times in 1,252 Posts
    Rep Power
    340
    Another 'feature' of 2008 R2/Windows 7 is that there's no method to make 'Documents' and 'Computer' appear on the desktop for all users. The following reg file does the trick:

    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons]
    
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu]
    "\"{20D04FE0-3AEA-1069-A2D8-08002B30309D}\""=dword:00000000
    "\"{59031a47-3f72-44a7-89c5-5595fe6b30ee}\""=dword:00000001
    "\"{5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0}\""=dword:00000000
    
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel]
    "\"{20D04FE0-3AEA-1069-A2D8-08002B30309D}\""=dword:00000000
    "\"{5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0}\""=dword:00000001
    "\"{59031a47-3f72-44a7-89c5-5595fe6b30ee}\""=dword:00000000
    "{59031a47-3f72-44a7-89c5-5595fe6b30ee}"=dword:00000000
    "{20D04FE0-3AEA-1069-A2D8-08002B30309D}"=dword:00000000
    Save as DesktopIcons.reg, then include it within a logon script:

    Code:
    regedit.exe /s \\SERVERNAME\NETLOGON\DesktopIcons.reg

  4. #3

    Join Date
    Mar 2008
    Posts
    46
    Thank Post
    4
    Thanked 11 Times in 8 Posts
    Rep Power
    15
    Is first post suitable for 32bit & 64bit versions or is a separate unattended file needed for each?

  5. #4

    Michael's Avatar
    Join Date
    Dec 2005
    Location
    Birmingham
    Posts
    9,262
    Thank Post
    242
    Thanked 1,572 Times in 1,252 Posts
    Rep Power
    340
    Quote Originally Posted by Don__1 View Post
    Is first post suitable for 32bit & 64bit versions or is a separate unattended file needed for each?
    Yes as far as I am aware. Open it up in Notepad and do a search and replace for x86 to x64.

    You also need to make sure you're running the 64Bit version of MySysprep too.

  6. #5

    Join Date
    Mar 2008
    Posts
    46
    Thank Post
    4
    Thanked 11 Times in 8 Posts
    Rep Power
    15
    I thought AMD64 was used instead of X64.
    Asking because I use an unattended file with just X32 in it and it doesn't work for X64 systems.

  7. #6

    Michael's Avatar
    Join Date
    Dec 2005
    Location
    Birmingham
    Posts
    9,262
    Thank Post
    242
    Thanked 1,572 Times in 1,252 Posts
    Rep Power
    340
    Deploying wireless settings (as a startup script) is also straight forward as follows (including the security key):

    Code:
    <?xml version="1.0"?>
    <WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
    	<name>WIRELESS</name>
    	<SSIDConfig>
    		<SSID>
    			<hex>574952454C455353</hex>
    			<name>WIRELESS</name>
    		</SSID>
    	</SSIDConfig>
    	<connectionType>ESS</connectionType>
    	<connectionMode>auto</connectionMode>
    	<MSM>
    		<security>
    			<authEncryption>
    				<authentication>WPA2PSK</authentication>
    				<encryption>AES</encryption>
    				<useOneX>false</useOneX>
    			</authEncryption>
    			<sharedKey>
    				<keyType>passPhrase</keyType>
    				<protected>false</protected>
    				<keyMaterial>ENTERKEY</keyMaterial>
    			</sharedKey>
    		</security>
    	</MSM>
    </WLANProfile>
    Run it at startup as follows:

    Code:
    netsh wlan add profile filename="\\SERVERNAME\NETLOGON\WIRELESS\WIRELESS-SETTINGS.xml"

  8. 2 Thanks to Michael:

    Duke5A (1st May 2012), stevenlong1985 (28th January 2013)

  9. #7

    Michael's Avatar
    Join Date
    Dec 2005
    Location
    Birmingham
    Posts
    9,262
    Thank Post
    242
    Thanked 1,572 Times in 1,252 Posts
    Rep Power
    340
    Quote Originally Posted by Don__1 View Post
    I thought AMD64 was used instead of X64.
    Asking because I use an unattended file with just X32 in it and it doesn't work for X64 systems.
    I stand corrected, you are right! 64Bit XML files are AMD64 and 32Bit XML files are x86.

    Not quite sure why it's called AMD64, as 64Bit is for Intel and AMD and other manufacturers. You'd think they'd of stuck to x64 but there you go!

  10. #8
    tommej's Avatar
    Join Date
    Oct 2009
    Location
    Lincolnshire
    Posts
    706
    Thank Post
    38
    Thanked 138 Times in 102 Posts
    Rep Power
    78
    You left a product key in the original post, should probably remove that :x

  11. #9

    Join Date
    Mar 2008
    Posts
    46
    Thank Post
    4
    Thanked 11 Times in 8 Posts
    Rep Power
    15
    It is a KMS client key. Free for the world to use if you have a KMS server for it to communicate with.

  12. #10

    nephilim's Avatar
    Join Date
    Nov 2008
    Location
    Dunstable
    Posts
    12,100
    Thank Post
    1,640
    Thanked 1,961 Times in 1,435 Posts
    Blog Entries
    2
    Rep Power
    441
    No, not free, someone had to pay for it and could fraudulently set up a KMS server with the key

  13. #11

    Join Date
    Mar 2008
    Posts
    46
    Thank Post
    4
    Thanked 11 Times in 8 Posts
    Rep Power
    15
    Quote Originally Posted by nephilim View Post
    No, not free, someone had to pay for it and could fraudulently set up a KMS server with the key
    I don't think so, but we are going off topic.

  14. #12

    Join Date
    Feb 2011
    Location
    Liverpool
    Posts
    67
    Thank Post
    7
    Thanked 7 Times in 6 Posts
    Rep Power
    9
    I wish I'd seen this before I struggled to figure it out myself. I got it joining the domain and then changing the PC name, but it would only join the PC name on the computer, not in AD, so it wouldn't let the computer log in to the domani afterwards. Eventually got it sorted using a batch script on first (automatic) login, which uses netdom to join the domain, then auto activates Windows, then reboots the PC. It's then ready to use after it's come back up again.

  15. #13

    Michael's Avatar
    Join Date
    Dec 2005
    Location
    Birmingham
    Posts
    9,262
    Thank Post
    242
    Thanked 1,572 Times in 1,252 Posts
    Rep Power
    340
    Thank you all for your concern guys, it's nice to know people care on these forums

    KMS keys are available to the public here. A KMS key tells a newly imaged workstation to talk/activate Windows by communicating with your KMS server.

  16. #14

    nephilim's Avatar
    Join Date
    Nov 2008
    Location
    Dunstable
    Posts
    12,100
    Thank Post
    1,640
    Thanked 1,961 Times in 1,435 Posts
    Blog Entries
    2
    Rep Power
    441
    Can I do this without a KMS key, say for example with a MAK key?

  17. #15

    Michael's Avatar
    Join Date
    Dec 2005
    Location
    Birmingham
    Posts
    9,262
    Thank Post
    242
    Thanked 1,572 Times in 1,252 Posts
    Rep Power
    340
    Quote Originally Posted by nephilim View Post
    Can I do this without a KMS key, say for example with a MAK key?
    Yes, just change it for your MAK. You'll need to activate each workstation once however

SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Auto join domain using sysprep - Windows 7
    By ronnoco in forum Windows 7
    Replies: 80
    Last Post: 6th December 2012, 12:20 PM
  2. Replies: 8
    Last Post: 6th June 2011, 05:06 PM
  3. [Fog] Rename w/ serial # and join domain
    By Onslow in forum O/S Deployment
    Replies: 15
    Last Post: 20th July 2010, 09:42 AM
  4. Join Domain and Set Hostname
    By DanW in forum Scripts
    Replies: 1
    Last Post: 18th July 2009, 02:36 PM
  5. Cannot join domain, dns problems
    By pod in forum Windows Server 2000/2003
    Replies: 0
    Last Post: 14th February 2009, 03:04 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •