Open a command prompt and enter the command:
DISM /online /Get-CurrentEdition
to find the current server edition.
After that enter the command:
DISM /online /Get-TargetEditions
to find the editions that your system can be upgraded to.
Finally enter the command
DISM /online /Set-Edition:ServerEnterprise /ProductKey:XXXX-XXXX-XXXX-XXXX-XXXX
to upgrade to enterprise version. Of course you must use your real enterprise product key.
If you have a KMS to activate your windows server then you can use the known KMS client key, so the command becomes:
DISM /online /Set-Edition:ServerEnterprise /ProductKey:489J6-VHDMP-X63PK-3K798-CPX3Y
For more information read the following article.
There is a possibility that after this upgrade procedure the system does not allow you to use memory above 4 GB and the allow remote desktop check box is disabled. In this case use the following procedure to fix this problem:
Open a command prompt
Type slmgr.vbs -ckms (this clears any KMS entry you have)
Type slmgr.vbs -upk (this removes any product key installed)
Type slmgr.vbs -ipk xxxxx-xxxxx-xxxxx-xxxxx-xxxxx (where the x’s is the new enterprise product key you will use)
Type slmgr.vbs -ato (this activates the server)
After this you must restart the server, so that you can utilize memory above 4 GB and to enable remote desktop check box in system properties.
Showing posts with label Windows Server 2008 R2. Show all posts
Showing posts with label Windows Server 2008 R2. Show all posts
Friday, February 1, 2013
Thursday, January 31, 2013
How to safely remove a USB disk from a windows server core installation
- On command prompt type "diskpart" and wait for the next prompt and then type "list volume". Take note of the number of your desired volume by watching its drive letter
- Type "select volume x", where x is the number of your USB storage.
- Then type "remove all dismount".
- Type "exit" to leave diskpart.
Wednesday, August 8, 2012
How to enable remoting in a windows server 2012 core
From a command line on the server machine enter
winrm qc
Press y to continue
If the server is not a domain member you can remotely manage it from a workstation adding workstation's ip in wsman trusted hosts using the command:
winrm set winrm/config/client @{TrustedHosts="x.x.x.x"}
where x.x.x.x is the IP address or the computer name of the workstation machine
In the workstation machine enable winrm using the command
winrm qc
and
winrm set winrm/config/client @{TrustedHosts="x.x.x.x"}
where x.x.x.x is the IP address or the computer name of the server machine
After that you can connect to the remote machine using the command
winrs -r:http://x.x.x.x:5985 -u:username "command"
where x.x.x.x is the IP address or the computer name of the server machine, username a user with admin persmissions on the server machine and command the command to execute on the server machine.
Example:
winrs -r:http://192.168.10.10:5985 -u:Administrator "cmd"
For more information take a look at the following post
winrm qc
Press y to continue
If the server is not a domain member you can remotely manage it from a workstation adding workstation's ip in wsman trusted hosts using the command:
winrm set winrm/config/client @{TrustedHosts="x.x.x.x"}
where x.x.x.x is the IP address or the computer name of the workstation machine
In the workstation machine enable winrm using the command
winrm qc
and
winrm set winrm/config/client @{TrustedHosts="x.x.x.x"}
where x.x.x.x is the IP address or the computer name of the server machine
After that you can connect to the remote machine using the command
winrs -r:http://x.x.x.x:5985 -u:username "command"
where x.x.x.x is the IP address or the computer name of the server machine, username a user with admin persmissions on the server machine and command the command to execute on the server machine.
Example:
winrs -r:http://192.168.10.10:5985 -u:Administrator "cmd"
For more information take a look at the following post
Labels:
Core,
Windows Server 2008 R2,
Windows Server 2012
How to rename the local Administrator account in server core
Enter this command to rename local Administrator account to a new name:
wmic UserAccount where Name="Administrator" call Rename Name="new-name"
In Windows Server 2012 Core we can utilize Powershell, so to find the Local Administrator account name we use the following command:
gwmi Win32_UserAccount | ? {$_.SID -Like 'S-1-5-*-500'}
In order to rename the Local Administrator account to another name we use the following command:
(gwmi Win32_UserAccount | ? {$_.SID -Like 'S-1-5-*-500'}).Rename("New-Name")
wmic UserAccount where Name="Administrator" call Rename Name="new-name"
In Windows Server 2012 Core we can utilize Powershell, so to find the Local Administrator account name we use the following command:
gwmi Win32_UserAccount | ? {$_.SID -Like 'S-1-5-*-500'}
In order to rename the Local Administrator account to another name we use the following command:
(gwmi Win32_UserAccount | ? {$_.SID -Like 'S-1-5-*-500'}).Rename("New-Name")
Labels:
Core,
Windows Server 2008 R2,
Windows Server 2012
Monday, December 12, 2011
How to reset domain admin password on a Windows Server 2008
- Boot onto DVD of Windows Server 2008
- Choose “Repair your computer”
- Launch cmd
- Go to c:\windows\system32
- Rename Utilman.exe to Utilman.exe.bak
- Copy cmd.exe to Utilman.exe
- Reboot on Windows
- Do the keyboard shortcut Windows + U when on the logon screen
- net user administrator Newpass123 inside the cmd
- log on with the domain admin account and this new pass
- change the password to remember it if needed
- Reboot on the DVD to put back the original Utilman.exe
Friday, October 21, 2011
How to add a DSRM startup option in Windows Server 2008 R2
From this blog post we should open an administrator command prompt and enter these lines:
bcdedit /copy {current} /d "Directory Services Restore Mode"
bcdedit /set {GUID} safeboot dsrepair
bcdedit /timeout 10
where {GUID} is the result of the first command.
bcdedit /copy {current} /d "Directory Services Restore Mode"
bcdedit /set {GUID} safeboot dsrepair
bcdedit /timeout 10
where {GUID} is the result of the first command.
Sunday, October 16, 2011
Exchange Management Console cannot close after installation of IE9
This is a quick fix: You must turn off Internet Explorer Enhanced Security Configuration using "Manage My Computer", add https://localhost to the IE9 trusted sites and reboot.
Saturday, October 15, 2011
How to enable SAN certificates in a Windows 2008 R2 Enterprise CA
Open a command prompt windows and enter these commands:
certutil –setreg policy\SubjectAltName enabled
certutil –setreg policy\SubjectAltName2 enabled
net stop certsvc
net start certsvc
Now you can submit your exchange SAN certificate request using this command line:
certreq -submit -attrib "CertificateTemplate:WebServer" c:\tmp\excertreq.req excert.cer
where excertreq.req is the request file and excert.cer is the issued certificate.
In case of error you must convert the .req file to ANSI format from Unicode using notepad.
For more info read Windows 2008 PKI / Certificate Authority (AD CS) basics and How to issue EV SSL certificates from an Enterprise CA
certutil –setreg policy\SubjectAltName enabled
certutil –setreg policy\SubjectAltName2 enabled
net stop certsvc
net start certsvc
Now you can submit your exchange SAN certificate request using this command line:
certreq -submit -attrib "CertificateTemplate:WebServer" c:\tmp\excertreq.req excert.cer
where excertreq.req is the request file and excert.cer is the issued certificate.
In case of error you must convert the .req file to ANSI format from Unicode using notepad.
For more info read Windows 2008 PKI / Certificate Authority (AD CS) basics and How to issue EV SSL certificates from an Enterprise CA
Friday, October 14, 2011
Troubleshooting "The RPC server is unavailable"
Please read the following article from Microsoft Technet Wiki
Thursday, October 13, 2011
How to disable EDNS probes in Windows Server 2008 R2 DNS server
Open a command line and enter this command
dnscmd /config /EnableEDNSProbes 0
You don't have to reboot the server.
dnscmd /config /EnableEDNSProbes 0
You don't have to reboot the server.
Sunday, August 28, 2011
Hyper-V gotsas
Please the following article from Microsoft
Labels:
Hyper-V,
Hyper-V R2,
Windows Server 2008 R2
Monday, July 25, 2011
USN and USN Rollback
Please read the following articles from Microsoft:
USN and USN Rollback
How to detect and recover from a USN rollback in Windows Server 2003, Windows Server 2008, and Windows Server 2008 R2
Force Domain Controller Removal
Clean Up Server Metadata
USN and USN Rollback
How to detect and recover from a USN rollback in Windows Server 2003, Windows Server 2008, and Windows Server 2008 R2
Force Domain Controller Removal
Clean Up Server Metadata
Friday, February 25, 2011
How to remove Service Pack 1 backup files from Windows 7
After a successful installation of Windows 7 SP1 you may want to save disk space deleting the backup files created by SP1 installer. After that you cannot uninstall SP1 from your computer.
From an elevated command prompt enter this command:
dism.exe /online /Cleanup-Image /spsuperseded
For more info read the Deployment Guide for Windows Server 2008 R2 with SP1 and Windows 7 with SP1
From an elevated command prompt enter this command:
dism.exe /online /Cleanup-Image /spsuperseded
For more info read the Deployment Guide for Windows Server 2008 R2 with SP1 and Windows 7 with SP1
Wednesday, January 26, 2011
Access Based Enumeration and DFS in Windows 2008 R2
Please read the following article from MS Technet Blogs
Thursday, January 13, 2011
How to connect to a SMB share in a Windows Server using an alias name
According to this Microsoft article when a client computer connects to a Microsoft Windows 2000-based computer or a Microsoft Windows Server 2003-based computer by using an alias name, the client may receive the following error message:
System error 52 has occurred.
A duplicate name exists on the network.
This problem can occur when you try to connect to the server by using a CNAME alias that is created in the DNS zone. For example, this problem may occur with a command similar to the following sample command
net view \\alias.domain name.com
where alias is a CNAME record that is created for the server in the domain name.com zone. The server is not "listening" on the alias, and therefore is not accepting connections to that name.
To resolve this problem in Windows Server 2003, follow these steps:
1. Create the CNAME record for the file server on the appropriate DNS server, if the CNAME record is not already present.
2. Apply the following registry change to the file server. To do so, follow these steps:
1. Start Registry Editor (Regedt32.exe).
2. Locate and click the following key in the registry:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanServer\Parameters
3. On the Edit menu, click Add Value, and then add the following registry value:
Value name: DisableStrictNameChecking
Data type: REG_DWORD
Radix: Decimal
Value: 1
4. Quit Registry Editor.
3. Restart your computer.
You may also have to set the SPN (Service Principal Name) for the Alias Name:
setspn -a host/aliasname targetserver
setspn -a host/aliasname.contoso.com targetserver
The registry key that is mentioned is applicable only to SMB 1.0. To communicate over the SMB2.0 protocol, or CIFS (Common Internet File System), you do not have to set the registry key. SMB 2.0 allows for the functionality described in this article to work by default without additional configuration. Computers that run Windows Server 2008, Windows Server 2008 R2, Windows Vista, and Windows 7 support both SMB 1.0 and SMB 2.0. Windows includes an SMB client component (Client for Microsoft Windows) and an SMB server component (File and Printer Sharing for Microsoft Windows). By default, SMB 2.0 is the file sharing protocol that is used when both client and server support it.
The SMB protocol revision to be used for file operations is decided during the negotiation phase. A Windows Vista or later client advertises to the server that it understands the new SMB 2.0 protocol. If the server understands SMB 2.0, SMB 2.0 is used for communication. Otherwise, the client and server use SMB 1.0. If SMB 1.0 is expected to be used, you can set the registry key that is mentioned above on Windows Server 2008, Windows Server 2008 R2, Windows Vista, or Windows 7.
System error 52 has occurred.
A duplicate name exists on the network.
This problem can occur when you try to connect to the server by using a CNAME alias that is created in the DNS zone. For example, this problem may occur with a command similar to the following sample command
net view \\alias.domain name.com
where alias is a CNAME record that is created for the server in the domain name.com zone. The server is not "listening" on the alias, and therefore is not accepting connections to that name.
To resolve this problem in Windows Server 2003, follow these steps:
1. Create the CNAME record for the file server on the appropriate DNS server, if the CNAME record is not already present.
2. Apply the following registry change to the file server. To do so, follow these steps:
1. Start Registry Editor (Regedt32.exe).
2. Locate and click the following key in the registry:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanServer\Parameters
3. On the Edit menu, click Add Value, and then add the following registry value:
Value name: DisableStrictNameChecking
Data type: REG_DWORD
Radix: Decimal
Value: 1
4. Quit Registry Editor.
3. Restart your computer.
You may also have to set the SPN (Service Principal Name) for the Alias Name:
setspn -a host/aliasname targetserver
setspn -a host/aliasname.contoso.com targetserver
The registry key that is mentioned is applicable only to SMB 1.0. To communicate over the SMB2.0 protocol, or CIFS (Common Internet File System), you do not have to set the registry key. SMB 2.0 allows for the functionality described in this article to work by default without additional configuration. Computers that run Windows Server 2008, Windows Server 2008 R2, Windows Vista, and Windows 7 support both SMB 1.0 and SMB 2.0. Windows includes an SMB client component (Client for Microsoft Windows) and an SMB server component (File and Printer Sharing for Microsoft Windows). By default, SMB 2.0 is the file sharing protocol that is used when both client and server support it.
The SMB protocol revision to be used for file operations is decided during the negotiation phase. A Windows Vista or later client advertises to the server that it understands the new SMB 2.0 protocol. If the server understands SMB 2.0, SMB 2.0 is used for communication. Otherwise, the client and server use SMB 1.0. If SMB 1.0 is expected to be used, you can set the registry key that is mentioned above on Windows Server 2008, Windows Server 2008 R2, Windows Vista, or Windows 7.
Sunday, December 19, 2010
How to image a Windows 2008 Server using WinPE and imagex
We have a windows server 2008 R2 that we want to image to another server.
First we must create a Windows PE boot CD, that it will be used for the imaging of the server.
In a windows 7 PC, running a 64-bit Windows (a technician computer according to Microsoft documentation) we install Windows AIK. After that we open an elevated Deployment Tools Command Prompt from Windows 7 Start Menu and we enter the following commands:
DISM /Cleanup-Wim
copype.cmd amd64 c:\winpe_amd64
copy c:\winpe_amd64\winpe.wim c:\winpe_amd64\ISO\sources\boot.wim
Dism /Mount-Wim /WimFile:C:\winpe_amd64\winpe.wim /index:1 /MountDir:C:\winpe_amd64\mount
Dism /image:C:\winpe_amd64\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\amd64\WinPE_FPs\winpe-wmi.cab"
Dism /image:C:\winpe_amd64\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\amd64\WinPE_FPs\en-us\winpe-wmi_en-us.cab"
Dism /image:C:\winpe_amd64\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\amd64\WinPE_FPs\winpe-scripting.cab"
Dism /image:C:\winpe_amd64\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\amd64\WinPE_FPs\en-us\winpe-scripting_en-us.cab"
Dism /image:C:\winpe_amd64\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\amd64\WinPE_FPs\winpe-hta.cab"
Dism /image:C:\winpe_amd64\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\amd64\WinPE_FPs\en-us\winpe-hta_en-us.cab"
Dism /image:C:\winpe_amd64\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\amd64\WinPE_FPs\winpe-wds-tools.cab"
Dism /image:C:\winpe_amd64\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\amd64\WinPE_FPs\en-us\winpe-wds-tools_en-us.cab"
copy /y "C:\Program Files\Windows AIK\Tools\amd64\imagex.exe" C:\winpe_amd64\mount\Windows\System32\
copy /y "C:\Program Files\Windows AIK\Tools\amd64\bcdboot.exe" C:\winpe_amd64\mount\Windows\System32\
copy /y "C:\Program Files\Windows AIK\Tools\PETools\amd64\BootSect.exe" C:\winpe_amd64\mount\Windows\System32\
copy /y "C:\Windows\System32\bcdedit.exe" C:\winpe_amd64\mount\Windows\System32\
If we have a folder with 3rd party drivers we can inject these drivers to windows PE image using the following command:
DISM /image:C:\winpe_amd64\mount /Add-Driver /driver:C:\tmp\drv\ /recurse
After the driver injection we unmount the wim file and commit changes using this command:
Dism /Unmount-Wim /MountDir:C:\winpe_amd64\mount\ /Commit
Then we copy the wim file to the iso folder of the working folder:
copy /y c:\winpe_amd64\winpe.wim c:\winpe_amd64\ISO\sources\boot.wim
Finally we create the bootable iso image entering this command:
oscdimg -n -bc:\winpe_amd64\etfsboot.com c:\winpe_amd64\ISO c:\winpe_amd64\winpe_amd64.iso
This ISO image can be written to a blank CD using a tool like ISO Recorder
Optionally we can create a bootable USB stick using the article How to create a bootable WinPE 2.0 USB key
Optionally we can use a tftp server to boot this WIM using these instructions:
Mount the Windows PE image to the \Mount folder of the working directory:
Dism /Mount-Wim /WimFile:C:\winpe_amd64\winpe.wim /index:1 /MountDir:C:\winpe_amd64\mount
Map a network connection to the root TFTP directory on the TFTP server and create a \Boot folder:
net use N: \\tftpServer\TFTPRoot
md N:\Boot
md N:\Boot\Fonts
Copy the PXE boot files from the mounted directory to the \Boot folder:
copy /y C:\winpe_amd64\mount\Windows\Boot\PXE\*.* N:\Boot
Copy the boot.sdi file to the PXE/TFTP server:
copy /y C:\Program Files\Windows AIK\Tools\PETools\amd64\boot\boot.sdi N:\Boot
Copy fonts files to Fonts directory:
copy /y C:\winpe_amd64\ISO\boot\fonts\*.* N:\Boot\Fonts\
Unmount the current Windows PE image and copy the bootable Windows PE image to the \Boot folder renaming this file to boot.wim:
Dism /Unmount-Wim /MountDir:C:\winpe_amd64\mount\ /Commit
copy c:\winpe_amd64\winpe.wim N:\Boot\boot.wim
Then we we must create a BCD store by using the BCDEdit tool. Using this link we create the following batch file to create the BCD store:
file name: createBCD.cmd
--------------------------------
Rem Creates BCD (boot configuration data) for Windows PE
set BCD-File=c:\tmp\BCD
del %BCD-File%
Bcdedit /createstore %BCD-File%
Bcdedit /store %BCD-File% /create {ramdiskoptions} /d "Ramdisk options"
Bcdedit /store %BCD-File% /set {ramdiskoptions} ramdisksdidevice boot
Bcdedit /store %BCD-File% /set {ramdiskoptions} ramdisksdipath \boot\boot.sdi
Bcdedit -store %BCD-File% -create {dbgsettings} /d "Debugger settings"
Bcdedit -store %BCD-File% -set {dbgsettings} debugtype serial
Bcdedit -store %BCD-File% -set {dbgsettings} baudrate 115200
Bcdedit -store %BCD-File% -set {dbgsettings} debugport 1
for /f "tokens=1-3" %%a in ('Bcdedit /store %BCD-File% /create /d "MyWinPE Boot Image" /application osloader') do set guid1=%%c
Bcdedit /store %BCD-File% /set %guid1% systemroot \Windows
Bcdedit /store %BCD-File% /set %guid1% detecthal Yes
Bcdedit /store %BCD-File% /set %guid1% winpe Yes
Bcdedit /store %BCD-File% /set %guid1% osdevice ramdisk=[boot]\boot\boot.wim,{ramdiskoptions}
Bcdedit /store %BCD-File% /set %guid1% device ramdisk=[boot]\boot\boot.wim,{ramdiskoptions}
Bcdedit /store %BCD-File% /create {bootmgr} /d "Windows BootManager"
Bcdedit /store %BCD-File% /set {bootmgr} timeout 30
Bcdedit /store %BCD-File% /set {bootmgr} displayorder %guid1%
Bcdedit /store %BCD-File% /enum all
--------------------------------
Running this batch file the BCD file is created. After that we can copy this file to the tftp server:
copy /y c:\tmp\BCD N:\Boot
After this we can use a tftp server like this to boot our PE image. I use these settings for the tftpd configuration:
TFTP Security: Standard
Advanced TFTP Options
Option negotiation
Translate Unix file names
Allow '\' As virtual root
Use anticipation window of 8192 bytes (optional for higher transfer rates)
We must also configure a DHCP server to give the boot client an IP address and this boot file: pxeboot.n12 (DHCP options 066 and 067)
Using the boot CD or the bootable USB stick or a tftp server we boot the PE image we created and we enter this command to find the partitions of our server:
diskpart
DISKPART> list disk
If we have only one disk this is disk 0 so we enter these commands:
DISKPART> select disk 0
DISKPART> list part
With this command we found the partitions we want to image. Usually there is a small System partition and a bigger Windows partition. Use the diskpart command "assign letter" to assign letters to these partitions so that we can use the imagex command to image these partitions:
imagex /capture C:\ D:\SystemPartition.wim "My System Partition"
imagex /capture D:\ D:\WindowsPartition.wim "My Windows Partition"
In this example C: is the system partition and D: is the Windows Partition.
Using the net use command map a network drive to a file server so that we can store these wim files to a network folder:
net use F: \\server\share
copy /y D:\SystemPartition.wim F:\Images
copy /y D:\WindowsPartition.wim F:\Images
In this example we copied the wim files to the Images folder in our file server.
Image restoration
We can restore these image files to another server using this procedure:
Boot the new server using one of the three aforementioned methods (boot CD, boot USB or tftp server)
Enter diskpart and create the partition scheme of the old server. For example:
diskpart
DISKPART>select disk 0
DISKPART>clean
DISKPART>create partition primary size=300
DISKPART>format quick fs=ntfs label="System"
DISKPART>assign letter="S"
DISKPART>active
DISKPART>create partition primary
DISKPART>format quick fs=ntfs label="Windows"
DISKPART>assign letter="W"
DISKPART>exit
If we are working with a UEFI based PC we use the following diskpart commands:
diskpart
DISKPART>select disk 0
DISKPART>clean
DISKPART>convert gpt
DISKPART>create partition efi size=100
DISKPART>format quick fs=fat32 label="System"
DISKPART>assign letter="S"
DISKPART>create partition msr size=128
DISKPART>create partition primary
DISKPART>format quick fs=ntfs label="Windows"
DISKPART>assign letter="W"
DISKPART>exit
For more info take a look at Technet documentation from Microsoft
We can also create a diskpart script using the above command an aply script using the command
diskpart /s
Use net use to create a network drive to map to the file server holding the the wim files:
net use F: \\server\share
After this we can apply the wim files to the new partitions:
imagex /apply F:\Images\SystemPartition.wim 1 S:\
imagex /apply F:\Images\WindowsPartition.wim 1 W:\
Finally use the BCDboot tool to copy common system partition files and to initialize boot configuration data:
W:\Windows\System32\bcdboot W:\Windows /l en-US
After this command we can reboot our new server to windows 2008 and make any customizations we want to do.
First we must create a Windows PE boot CD, that it will be used for the imaging of the server.
In a windows 7 PC, running a 64-bit Windows (a technician computer according to Microsoft documentation) we install Windows AIK. After that we open an elevated Deployment Tools Command Prompt from Windows 7 Start Menu and we enter the following commands:
DISM /Cleanup-Wim
copype.cmd amd64 c:\winpe_amd64
copy c:\winpe_amd64\winpe.wim c:\winpe_amd64\ISO\sources\boot.wim
Dism /Mount-Wim /WimFile:C:\winpe_amd64\winpe.wim /index:1 /MountDir:C:\winpe_amd64\mount
Dism /image:C:\winpe_amd64\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\amd64\WinPE_FPs\winpe-wmi.cab"
Dism /image:C:\winpe_amd64\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\amd64\WinPE_FPs\en-us\winpe-wmi_en-us.cab"
Dism /image:C:\winpe_amd64\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\amd64\WinPE_FPs\winpe-scripting.cab"
Dism /image:C:\winpe_amd64\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\amd64\WinPE_FPs\en-us\winpe-scripting_en-us.cab"
Dism /image:C:\winpe_amd64\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\amd64\WinPE_FPs\winpe-hta.cab"
Dism /image:C:\winpe_amd64\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\amd64\WinPE_FPs\en-us\winpe-hta_en-us.cab"
Dism /image:C:\winpe_amd64\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\amd64\WinPE_FPs\winpe-wds-tools.cab"
Dism /image:C:\winpe_amd64\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\amd64\WinPE_FPs\en-us\winpe-wds-tools_en-us.cab"
copy /y "C:\Program Files\Windows AIK\Tools\amd64\imagex.exe" C:\winpe_amd64\mount\Windows\System32\
copy /y "C:\Program Files\Windows AIK\Tools\amd64\bcdboot.exe" C:\winpe_amd64\mount\Windows\System32\
copy /y "C:\Program Files\Windows AIK\Tools\PETools\amd64\BootSect.exe" C:\winpe_amd64\mount\Windows\System32\
copy /y "C:\Windows\System32\bcdedit.exe" C:\winpe_amd64\mount\Windows\System32\
If we have a folder with 3rd party drivers we can inject these drivers to windows PE image using the following command:
DISM /image:C:\winpe_amd64\mount /Add-Driver /driver:C:\tmp\drv\ /recurse
After the driver injection we unmount the wim file and commit changes using this command:
Dism /Unmount-Wim /MountDir:C:\winpe_amd64\mount\ /Commit
Then we copy the wim file to the iso folder of the working folder:
copy /y c:\winpe_amd64\winpe.wim c:\winpe_amd64\ISO\sources\boot.wim
Finally we create the bootable iso image entering this command:
oscdimg -n -bc:\winpe_amd64\etfsboot.com c:\winpe_amd64\ISO c:\winpe_amd64\winpe_amd64.iso
This ISO image can be written to a blank CD using a tool like ISO Recorder
Optionally we can create a bootable USB stick using the article How to create a bootable WinPE 2.0 USB key
Optionally we can use a tftp server to boot this WIM using these instructions:
Mount the Windows PE image to the \Mount folder of the working directory:
Dism /Mount-Wim /WimFile:C:\winpe_amd64\winpe.wim /index:1 /MountDir:C:\winpe_amd64\mount
Map a network connection to the root TFTP directory on the TFTP server and create a \Boot folder:
net use N: \
md N:\Boot
Copy the PXE boot files from the mounted directory to the \Boot folder:
copy /y C:\winpe_amd64\mount\Windows\Boot\PXE\*.* N:\Boot
Copy the boot.sdi file to the PXE/TFTP server:
copy /y C:\Program Files\Windows AIK\Tools\PETools\amd64\boot\boot.sdi N:\Boot
Copy fonts files to Fonts directory:
copy /y C:\winpe_amd64\ISO\boot\fonts\*.* N:\Boot\Fonts\
Unmount the current Windows PE image and copy the bootable Windows PE image to the \Boot folder renaming this file to boot.wim:
Dism /Unmount-Wim /MountDir:C:\winpe_amd64\mount\ /Commit
copy c:\winpe_amd64\winpe.wim N:\Boot\boot.wim
Then we we must create a BCD store by using the BCDEdit tool. Using this link we create the following batch file to create the BCD store:
file name: createBCD.cmd
--------------------------------
Rem Creates BCD (boot configuration data) for Windows PE
set BCD-File=c:\tmp\BCD
del %BCD-File%
Bcdedit /createstore %BCD-File%
Bcdedit /store %BCD-File% /create {ramdiskoptions} /d "Ramdisk options"
Bcdedit /store %BCD-File% /set {ramdiskoptions} ramdisksdidevice boot
Bcdedit /store %BCD-File% /set {ramdiskoptions} ramdisksdipath \boot\boot.sdi
Bcdedit -store %BCD-File% -create {dbgsettings} /d "Debugger settings"
Bcdedit -store %BCD-File% -set {dbgsettings} debugtype serial
Bcdedit -store %BCD-File% -set {dbgsettings} baudrate 115200
Bcdedit -store %BCD-File% -set {dbgsettings} debugport 1
for /f "tokens=1-3" %%a in ('Bcdedit /store %BCD-File% /create /d "MyWinPE Boot Image" /application osloader') do set guid1=%%c
Bcdedit /store %BCD-File% /set %guid1% systemroot \Windows
Bcdedit /store %BCD-File% /set %guid1% detecthal Yes
Bcdedit /store %BCD-File% /set %guid1% winpe Yes
Bcdedit /store %BCD-File% /set %guid1% osdevice ramdisk=[boot]\boot\boot.wim,{ramdiskoptions}
Bcdedit /store %BCD-File% /set %guid1% device ramdisk=[boot]\boot\boot.wim,{ramdiskoptions}
Bcdedit /store %BCD-File% /create {bootmgr} /d "Windows BootManager"
Bcdedit /store %BCD-File% /set {bootmgr} timeout 30
Bcdedit /store %BCD-File% /set {bootmgr} displayorder %guid1%
Bcdedit /store %BCD-File% /enum all
--------------------------------
Running this batch file the BCD file is created. After that we can copy this file to the tftp server:
copy /y c:\tmp\BCD N:\Boot
After this we can use a tftp server like this to boot our PE image. I use these settings for the tftpd configuration:
TFTP Security: Standard
Advanced TFTP Options
Option negotiation
Translate Unix file names
Allow '\' As virtual root
Use anticipation window of 8192 bytes (optional for higher transfer rates)
![]() |
| tftpd settings |
![]() |
| dhcp options |
diskpart
DISKPART> list disk
If we have only one disk this is disk 0 so we enter these commands:
DISKPART> select disk 0
DISKPART> list part
With this command we found the partitions we want to image. Usually there is a small System partition and a bigger Windows partition. Use the diskpart command "assign letter" to assign letters to these partitions so that we can use the imagex command to image these partitions:
imagex /capture C:\ D:\SystemPartition.wim "My System Partition"
imagex /capture D:\ D:\WindowsPartition.wim "My Windows Partition"
In this example C: is the system partition and D: is the Windows Partition.
Using the net use command map a network drive to a file server so that we can store these wim files to a network folder:
net use F: \\server\share
copy /y D:\SystemPartition.wim F:\Images
copy /y D:\WindowsPartition.wim F:\Images
In this example we copied the wim files to the Images folder in our file server.
Image restoration
We can restore these image files to another server using this procedure:
Boot the new server using one of the three aforementioned methods (boot CD, boot USB or tftp server)
Enter diskpart and create the partition scheme of the old server. For example:
diskpart
DISKPART>select disk 0
DISKPART>clean
DISKPART>create partition primary size=300
DISKPART>format quick fs=ntfs label="System"
DISKPART>assign letter="S"
DISKPART>active
DISKPART>create partition primary
DISKPART>format quick fs=ntfs label="Windows"
DISKPART>assign letter="W"
DISKPART>exit
If we are working with a UEFI based PC we use the following diskpart commands:
diskpart
DISKPART>select disk 0
DISKPART>clean
DISKPART>convert gpt
DISKPART>create partition efi size=100
DISKPART>format quick fs=fat32 label="System"
DISKPART>assign letter="S"
DISKPART>create partition msr size=128
DISKPART>create partition primary
DISKPART>format quick fs=ntfs label="Windows"
DISKPART>assign letter="W"
DISKPART>exit
For more info take a look at Technet documentation from Microsoft
We can also create a diskpart script using the above command an aply script using the command
diskpart /s
Use net use to create a network drive to map to the file server holding the the wim files:
net use F: \\server\share
After this we can apply the wim files to the new partitions:
imagex /apply F:\Images\SystemPartition.wim 1 S:\
imagex /apply F:\Images\WindowsPartition.wim 1 W:\
Finally use the BCDboot tool to copy common system partition files and to initialize boot configuration data:
W:\Windows\System32\bcdboot W:\Windows /l en-US
After this command we can reboot our new server to windows 2008 and make any customizations we want to do.
Thursday, September 16, 2010
Slow mouse movement in a Windows Server 2008 R2 VM hosted in ESXi 4.1
When you create a Windows 2008 Server R2 VM hosted in a vSphere 4.x hypervisor you see that the mouse is not moving as fast as it does in a Windows 2003 Server VM. This is what you must do to resolve this issue:
- Power off the VM and change the total video RAM assigned to this VM using the Edit Settings menu. Set the Video card Display Memory to Auto-detect video settings.
- Power on the VM again and after you login to the system go to the Device Manager and install the following driver for the Video-Card: C:\Program Files\Common Files\VMware\Drivers\wddm_video
- Reboot the VM again.
Thursday, September 9, 2010
How to configure pagefile in windows 2008 Server Core
From http://www.hyper-v.nu/blogs/jaapwess/?p=41 we read:
To configure the pagefile on a Hyper-V Server Core or Hyper-V Server you can use the following commands:
wmic computersystem set AutomaticManagedPagefile=False
wmic pagefileset where name="c:\\pagefile.sys" set InitialSize=4000,MaximumSize=6000
It is possible to check the pagefile settings using the following command:
wmic pagefile get /format:list
To configure the pagefile on a Hyper-V Server Core or Hyper-V Server you can use the following commands:
wmic computersystem set AutomaticManagedPagefile=False
wmic pagefileset where name="c:\\pagefile.sys" set InitialSize=4000,MaximumSize=6000
It is possible to check the pagefile settings using the following command:
wmic pagefile get /format:list
Labels:
Core,
Hyper-V,
Hyper-V R2,
Windows Server 2008,
Windows Server 2008 R2
Friday, September 3, 2010
Windows 7 deployment articles
Read these blog posts:
Capture and Apply Windows Images
Apply Images by Using ImageX
BCDboot Command-Line Options
Deploy a System Recovery Image
http://mikespcbabble.com/WinPE3.aspx
http://blog.brianleejackson.com/sysprep-a-windows-7-machine-start-to-finish-v2
http://www.windowsnetworking.com/articles_tutorials/Deploying-Windows-7-Part19.html
http://blog.brianleejackson.com/formatting-winpe-3-0-usb-flash-drive-dism
http://edge.technet.com/Media/Deploy-Windows-7-The-Easy-Way-Using-WDS-MDT-and-AIK-Step-By-Step/
http://www.the-d-spot.org/wordpress/2009/11/01/windows-7-lite-touch-installation-with-mdt-2010/
http://www.the-d-spot.org/wordpress/2009/11/16/windows-7-lite-touch-installation-with-mdt-2010-part-2/
http://www.cluberti.com/blog/2009/08/10/mdt-2010-and-deployment-from-a-usb-key/
http://www.cluberti.com/blog/2009/08/12/adding-additional-boot-options-to-your-deployment-usb-key/
http://www.delltechcenter.com/page/Dell+Business+Client+Operating+System+Deployment+-+The+.CAB+Files
http://driverpacks.net/
Capture and Apply Windows Images
Apply Images by Using ImageX
BCDboot Command-Line Options
Deploy a System Recovery Image
http://mikespcbabble.com/WinPE3.aspx
http://blog.brianleejackson.com/sysprep-a-windows-7-machine-start-to-finish-v2
http://www.windowsnetworking.com/articles_tutorials/Deploying-Windows-7-Part19.html
http://blog.brianleejackson.com/formatting-winpe-3-0-usb-flash-drive-dism
http://edge.technet.com/Media/Deploy-Windows-7-The-Easy-Way-Using-WDS-MDT-and-AIK-Step-By-Step/
http://www.the-d-spot.org/wordpress/2009/11/01/windows-7-lite-touch-installation-with-mdt-2010/
http://www.the-d-spot.org/wordpress/2009/11/16/windows-7-lite-touch-installation-with-mdt-2010-part-2/
http://www.cluberti.com/blog/2009/08/10/mdt-2010-and-deployment-from-a-usb-key/
http://www.cluberti.com/blog/2009/08/12/adding-additional-boot-options-to-your-deployment-usb-key/
http://www.delltechcenter.com/page/Dell+Business+Client+Operating+System+Deployment+-+The+.CAB+Files
http://driverpacks.net/
Subscribe to:
Posts (Atom)

