Step by Step Directions for Techs

Category Archives: Migration

Get your USB drive bootable and ready to image with MDT

It isn’t hard, but you have to do a few things to prep a USB drive for use in imaging with MDT.  You need to mark the partition as active and you need to make sure it is formatted for NTFS.

  1. Plug in the USB drive.
  2. Click Start | Run
  3. Type “CMD”
  4. Press “OK”
  5. Type “diskpart” into the command prompt and press the enter key
  6. Type “list disk” and press the enter key.  This will list the available drives
  7. Determine which disk number is your USB drive (you can frequently tell by size).  If you are unable to determine it, unplug the drive and list the disks again to see which one is missing.  Plug it back in and list them again.  You should be able to figure it out by the differences.
  8. Type “select disk 1” (or whatever your disk was as determined above) and press the enter key.
  9. Type “list partition” and press the enter key to list the partions.
  10. Type “select partition 1” and press the enter key
  11. Type “active” and press the enter key

Here is the output from my window:


You then need to format the drive as NTFS.  You can do it here by:

  1. Type “format fs=ntfs QUICK” and press the enter key inside of diskpart. 
  2. You can do it through disk manager and do a quick format.

Type “Exit” to leave the DISKPART tool.

Now, you just need to copy the contents of your MDT content folder to the drive and you are set!  Don’t forget to boot off of it (by setting the BIOS or choosing an alternative boot device).

If you are using a SANDisk, you may need to do one more thing.  You need to get a copy of BOOTSEC (available in WAIK).  Open a command prompt and execute “Bootsect.exe /nt60 D:” (where D: is your USB drive) from the directory you put BOOTSEC into.

Happy imaging!

Silent install isn’t working, but I need to automate this!

Never fear, a script is here (kinda).

Recently I was working to automate the installation of a poorly written program.  For the life of me this thing would not install quietly.  Repackaging it failed and I was running out of time.  I choose to install the program and pass the appropriate keystrokes to it.

Note: This is not advised when rolling applications out if the user is at the keyboard.  One click to another application and this all goes haywire.

So what I did what create an install.vbs script that looks a bit like this:

Set objShell = WScript.CreateObject(“WScript.Shell”)

‘This pulls up the “Setup” window as the active window
Do Until Success = True
    Success = objShell.AppActivate(“Setup”)
    Wscript.Sleep 1000

‘Takes a bit before the application can take inputs.  This is 6 seconds
Wscript.Sleep 6000

objShell.SendKeys “{ENTER}”
Wscript.Sleep 1000

objShell.SendKeys “%A”
objShell.SendKeys “{ENTER}”
Wscript.Sleep 1000

objShell.SendKeys “{ENTER}”
Wscript.Sleep 1000

objShell.SendKeys “{ENTER}”
Wscript.Sleep 1000

objShell.SendKeys “{ENTER}”
Wscript.Sleep 1000

objShell.SendKeys “{ENTER}”
Wscript.Sleep 1000

‘This clicks the install button
objShell.SendKeys “{ENTER}”

‘It takes a little bit to install it
Wscript.Sleep 30000

‘Close configuration window by pressing Alt-D-E
objShell.SendKeys “^DE”

‘Click finish
Wscript.Sleep 5000
objShell.SendKeys “{ENTER}”

Once you have that, you launch the setup program (you can do that in this script or in another one.  However, if you do it from a batch file, you need to use  a start command (otherwise it waits for the process to finish before moving on):

start “” “%~dp0setup.exe”
start “” “%~dp0install.vbs”

Note: The %~dpo is a shortcut that uses the current directory it is being run out of instead of hard coding the paths.

As you can see, there is a bit of timing you have to get down.  That is just trial and error.  I used a virtual environment and snapshots to get the it working so I could always install on a “clean” system.

If there are other keystrokes you need, here is where I got them:

Migrating file server shares with permissions intact

When you are copying files from one server to another or one volume to another and need to retain the file permissions, robocopy is your guy.  In order to speed things up, I will frequently start multiple windows.  To do this, I will put together multiple lines into a single powershell script that opens multiple windows for me.  Call me lazy, but it works.

cmd.exe /c start cmd /k “ROBOCOPY \\ohsfsdc1\g$\Share1 D:\Share1 /MIR /SEC”
cmd.exe /c start cmd /k “ROBOCOPY \\ohsfsdc1\g$\Share2 D:\Share2 /MIR /SEC”
… and so on

Couple things about this:

  • I usually run it from the destination server (where I am copying things to).
  • You can use this to stage the files, and then rerun it later to grab the stragglers.
  • I don’t believe that it deletes files from the destination that were deleted at the source.
  • This only copies the folder level permissions.  If they have file level permissions (which they shouldn’t because they are evil), there is another robocopy command that you can run that will copy those individual permissions after the main copy has finished.

Exchange mailbox migrations moving at the speed of… well… not fast.

Migrating between Exchange 2007 and 2013 or Exchange 2010 and 2013?  Mailbox migration speeds can be unbearably slow.

Exchange 2013 (as well as older versions, including 2010) changed the number of concurrent mailbox moves to 2…  let’s change that to 5.  Beware of setting it too high as it could have a serious impact on the Exchange infrastructure.

  1. Pause migration jobs
  2. Open Notepad as an Administrator.
  3. Open Microsoft\Exchange Server\V15\Bin\MsExchangeMailboxReplication.exe.config
  4. Find “MaxActiveMovesPerTargetMDB
    Note, the setting appears twice.  The first time it is commented out with <!–  and –>.  Make sure you get the right setting!!!
  5. Change value from 2 to 5
  6. Save the config file
  7. Restart Microsoft Exchange Replication service (MSExchangeRepl)

This change has to be done on all the front end servers.  You should see that it will now migrate 5 mailboxes simultaneously.   You can also speed things up by migrating to multiple data stores simultaneously.  Some caution is needed when trying to max your migration speed as you can pretty easily overrun the storage (especially if it is local).

Good luck!