Showing posts with label windows deployment. Show all posts
Showing posts with label windows deployment. Show all posts

Tuesday, November 26, 2013

Moving Roaming User Profiles files to another Server using WSMT

I have tried using "robocopy" and even Windows backup to transfer roaming user profiles (RUP). There would be surely files that I couldn't move due to file permission and ownership preservation. In WS2012, there is a built-in Windows Server Migration Tool (WSMT) to facilitate the file transfer (including server roles).

Here are the steps in summary (click this link for full Technet guide):

Step 1: Install WSMT
Install WSMT feature using server manager on the target WS2012 server.  
Step 2: Register and deploy WSMT
Start an elevated cmd prompt from the WSMT tool. Create a deployment folder that is accessible to the source server. Depending on the OS of the source server, an example of the command for WS2012 (default on "C:\Windows\System32\ServerMigrationTools\") would be: 
SmigDeploy.exe /package /architecture amd64 /os WS12 /path [deployment folder path]
Copy the deployment folder to the source computer. Register and deploy the source computer by running .\Smigdeploy.exe
Step 3: Move local users and groups
To preserve local permissions, you may need to move the local users and group first. To export from the source computer: 
Export-SmigServerSetting -User All -Group -Path [storepath\UsersGroups] -Verbose
To import into the target server:
 Import-SmigServerSetting -User All -Group -Path -Verbose
Step 4: Start file moving
Before moving, permit both UDP 7000 and TCP 7000 on the windows firewall. On the target computer, start the reciever:
Receive-SmigServerData 
To begin file transferring, run the following WSMT cmdlet on the source computer 
Send-SmigServerData -ComputerName [DestinationServer] -SourcePath d:\users -DestinationPath d:\shares\users -Recurse -Include All -Force 
You may want to observe any errors at the progression update on the command prompt.

Friday, September 16, 2011

Part 5: Sysprep and Capture Server Image using MDT2010

In the part 4, I mentioned about using MDT2010 to perform Windows installation over the network share. After you have installed, configured and patched this reference computer, you may like to "clone" this image for subsequent server deployment.   

You may use MDT2010 to sysprep and capture this reference image. Initially, I thought of doing a PXE boot and capture the image after creating a new task sequence for sysprep and capture. But I was half-right. Instead, after creating the new task sequence, you have to login to your reference computer, map to the MDT network share and execute the sysprep and capturing LTI scripts as follows:

cscript \\mdtserver\DeploymentShare$\Scripts\LiteTouch.WSF

For step-by-step details, please click on "How to run a Sysprep and Capture Task Sequence from MDT2010".

Monday, August 8, 2011

Part 4: Lite-Touch Installation using MDT 2010 and WDS

Earlier in Windows Deployment Part 1, I mentioned about using WinPE and ImageX (with a network share) to build, capture and deploy OS images. Using the Windows DISM tool, you can also service the OS images whenever you need to update any application patches or drivers. This is a heavy imaging method and is tedious to manage in a long run. In part 2, I mentioned about using Windows Deployment Services to automate the OS image deployment. However, this method alone does not allow you to service your images or install applications automatically. Nevertheless, Microsoft calls both methods as "Heavy-Touch" installation.

Microsoft Deployment Toolkit (MDT) 2010 allows you to combine both methods (WinPE/ImageX and WDS) for Lite-Touch Installation (LTI). This toolkit automates the manual tasks for WinPE and ImageX processes. It also facilitates the new "thin image" deployment concept. "Thin image" deployment does not include all applications and drivers on the base OS image, as constrasted to the traditional "heavy image" approach. Instead, new applications, patches and drivers are installed dynamically when you perform OS deployment.

There are several good blog posts that show you the step-by-step. I found these series of blog posts particularly helpful. In summary, I would just mention the typical overall steps:
  1. Prepare the necessary infrastructure, including AD, DNS, DHCP, WDS and file servers.
  2. Download Windows AIK and MDT2010. Install them on a technician computer.
  3. Open up the Deployment Workbench. Create a deployment share.
  4. Import Operating System. Try not to use WDS images option. See this forum.
  5. Create a task sequence and follow the wizard. Typically, it's "Standard Client Task Sequence" for new deployment.
  6. Add the necessary applications and third-party device drivers.
  7. Update Deployment Share by right-clicking on the "MDT Deployment Share"
  8. Several files will be created on the network share. Add the newly created boot image to your WDS server.
  9. PXE boot your target computer (can be a VM for initial testing). Select the Lite Touch boot option.
  10. Resolve all installation errors (if needed). Thoroughly test the target computer.
  11. Upon successful deployment, you can choose to create another Task Sequence to sysprep and capture the image, which is completely optional (good for hybrid Thin-Thick imaging). You can use this new capture image for subsequent WDS deployment.

Thursday, May 26, 2011

Part 3: Network installation using WDS

On part 2, we have captured the new install image for new computer deployment. We're ready to perform PXE boot for new computer deployment. For better security, we should configure the PXE response to known computer only. Otherwise, any machines can be installed and joined to your domain without you knowing. If unused, the WDS server should be shut off.
To identify "known" PXE clients, you would have to pre-stage or pre-create the new computer accounts using the RSAT AD tools on the WDS computer. Install the AD tools using "Add Feature" of the Server Manager. If you pre-create from a Domain Controller, the "Next" button and "Managed Computer" page would be missing and you can't enter the GUID or MAC addresses (prefixed with 20 zeroes) of the new machine.
There is this nice blog post that outlined the detailed step-by-step.

Thursday, May 19, 2011

Part 2: Image capturing & deployment using WDS

In earlier part 1, I mentioned using WinPE to capture Windows image files for further deployment. Another more scalable way is to use Windows Deployment Services (WDS) to do the same job. Instead of using CD boot, you can do network PXE boot with DHCP. There are several good resources online that outlined the step-by-step, so I won't re-invent the wheels. I would just summarize the steps and the url links to find them. Before that, it is assumed that you have already "sysprep-ed" the Windows host to be captured and put it to shut-off mode.
  1. Setup WDS infrastructure by installing WDS server role. Other prerequisites include Active Directory infrastructure and DHCP.
  2. Add Boot Image (boot.wim) to WDS server. Create and add a capture image by right-clicking on the selected boot image.
  3. PXE boot the target system. From the start-up menu, choose to boot from the capture image.
  4. Capture the target image on volume. Upload the new image to WDS.
  5. You may now add the newly captured image as install image for subsequent Windows deployment.
  6. For detailed steps from step 2 to 6, click here.

Monday, February 14, 2011

Part 1: Using WinPE & ImageX to capture & deploy System Images

Windows Preinstallation Environment (or WinPE in short) is a lightweight operating system that you can boot up to capture system images, install drivers and system troubleshooting. Think of it like the bootable MS-DOS disk in the good old days. Unlike the 16-bit MS DOS that requires separate set of drivers, WinPE leverages on Win7 drivers. Furthermore, you can make and customise it freely using Windows Automated Installation Kits (WAIK) that is also freely available from Microsoft.

There are several online resources that teach you how to use WinPE. Nevertheless, here are the summary steps that I have compiled of using WAIK to capture & deploy system image.

0) Make a bootable WinPE CD, including ImageX toolkit.
1) Install OS, drivers, applications into a standard Dell PC
2) Run sysprep, click on "generalize" and quit.
3) Boot the PC into WinPE environment.
4) Use ImageX /capture to capture image. Save the wim image to a network folder
5) Boot new PC from WinPE.
6) Perform diskpart to create at least 2 partitions (first partition ~300MB for Win7/Win2K8R2 Bitlocker)
7) Map to the network folder that contains the WIM image.
8) Apply WIM image to new PC partition using ImageX /apply command.


Booting into WinPE

Do note that the WIM image can also be used in conjunction with Windows Deployment Services (WDS)., where it can be used as an Install Image. Think of an install image like a master image that can be installed and applied on bare-metal computers. Some of the useful online resources that outlined the detailed step-by-step include:

Of these, making bootable WinPE CD is the first step. When creating a new boot configuration file called BCD by using BCDEdit, the Microsoft Technet walkthrough contains command options for BCDEdit that are no longer valid with Windows 7. In particular, replace the "-" with "/". I have listed down the workable commands outlined in the walkthrough

Bcdedit /createstore c:\winpe-amd64\mount\boot\BCD
Bcdedit /store c:\winpe-amd64\mount\boot\BCD /create {bootmgr}
Bcdedit /store c:\winpe-amd64\mount\boot\BCD /set {bootmgr} device boot
Bcdedit /store c:\winpe-amd64\mount\boot\BCD /create /d “WINPE” /application osloader

The last command returns a GUID value. Substitute with this value in the following examples.

Bcdedit /store c:\winpe-amd64\mount\boot\BCD /set <GUID> osdevice boot
Bcdedit /store c:\winpe-amd64\mount\boot\BCD /set <GUID> device boot
Bcdedit /store c:\winpe-amd64\mount\boot\BCD /set <GUID> path \windows\system32\boot\winload.exe
Bcdedit /store d:\winpe-amd64\mount\boot\BCD /set <GUID> systemroot \windows
Bcdedit /store d:\winpe-amd64\mount\boot\BCD /set <GUID> winpe yes
Bcdedit /store d:\winpe-amd64\mount\boot\BCD /set <GUID> detecthal yes
Bcdedit /store d:\winpe-amd64\mount\boot\BCD /displayorder <GUID> -addlast