Windows Server Migration Common Tasks and Information

Applies To: Windows Server 2008 R2

Administrators can use Windows Server Migration Tools to migrate server roles, features, shares, operating system settings, and other data to computers that are running Windows Server® 2008 R2. This document provides supplemental information about how to work with the Windows PowerShell cmdlets that make up Windows Server Migration Tools, and how to open and close Windows® Firewall ports.

Note

Your detailed feedback is very important, and helps us to make Windows Server Migration Guides as reliable, complete, and easy to use as possible. Please take a moment to rate this topic by clicking the stars in the upper-right corner of the page (1=poor, 5=excellent), and then add comments that support your rating. Describe what you liked, did not like, or want to see in future versions of the topic. To submit additional suggestions about how to improve Migration guides or utilities, post on the Windows Server Migration forum.

Who should use this guide

Information in this guide is most likely to benefit administrators who are performing migrations of any of the following.

Other guides and migration information are available on the Windows Server Migration Portal (https://www.microsoft.com/migration).

In this guide

  • Opening ports in Windows Firewall

  • Closing ports in Windows Firewall

  • Working with Windows PowerShell cmdlets

Opening ports in Windows Firewall

The following instructions are for opening ports in Windows Firewall. If your installed firewall is not a Microsoft® firewall, look in your guide about how to open firewall ports. Opening ports in Windows Firewall can be done through the command interface.

Important

Opening ports in your firewall can leave the server exposed to malicious attacks. Make sure that you understand firewall systems before you open ports.

To open Windows Firewall ports by using the command line (do one of the following):

  1. Open a Command Prompt window with elevated user rights, type the following, and then press ENTER.

    • On computers that are running Windows Server 2003, type:

      netsh firewall add allowedprogram program=%windir%\System32\WindowsPowerShell\v1.0\powershell.exe name="ServerMigration" mode=ENABLE
      
    • On computers that are running Windows Server® 2008 or Windows Server 2008 R2, type the following commands, in order, pressing ENTER after each command.

      1. netsh advfirewall firewall add rule name=ServerMigration(TCP-In) dir=in program=%windir%\System32\WindowsPowerShell\v1.0\powershell.exe action=allow protocol=TCP localport=7000
        
      2. netsh advfirewall firewall add rule name=ServerMigration(UDP-In) dir=in program=%windir%\System32\WindowsPowerShell\v1.0\powershell.exe action=allow protocol=UDP localport=7000
        
  2. If you have changed the default behavior of Windows Firewall to block all outgoing traffic on computers that are running Windows Server 2008 or Windows Server 2008 R2, you must explicitly enable outgoing traffic on UDP port 7000. To do this, open a Command Prompt window with elevated user rights, type the following, and then press ENTER.

    netsh advfirewall firewall add rule name=ServerMigration(UDP-Out) dir=out program=%windir%\System32\WindowsPowerShell\v1.0\powershell.exe action=allow protocol=UDP localport=7000
    

Closing ports in Windows Firewall

As a best practice, we recommend that you close Windows Firewall ports after the data transfer operation is finished.

To close Windows Firewall ports by using the command line (do one of the following):

  • On computers that are running Windows Server 2003, open a Command Prompt window, type the following, and then press ENTER.

    netsh firewall delete allowedprogram program=%windir%\System32\WindowsPowerShell\v1.0\powershell.exe
    
  • On computers that are running Windows Server 2008 or Windows Server 2008 R2, open a Command Prompt window with elevated user rights, type the following two commands. Press ENTER after each.

    netsh advfirewall firewall delete rule name=ServerMigration(TCP-In)
    
    netsh advfirewall firewall delete rule name=ServerMigration(UDP-Out)
    

Working with Windows PowerShell cmdlets

Cmdlets (pronounced command-lets) are built-in commands included with Windows PowerShell, installed by default as part of Windows Server 2008 R2. For more information about Windows PowerShell and how cmdlets work, see Windows PowerShell on the Microsoft Web site (https://go.microsoft.com/fwlink/?LinkID=122931).

Except where specifically noted, Windows PowerShell cmdlets are not case-sensitive.

You can obtain detailed Help about specific syntax, parameters, and usage guidelines for any installed Windows PowerShell cmdlet by typing Get-Help <cmdlet_name> -full in a Windows PowerShell session, in which cmdlet_name represents the name of the cmdlet for which you want help.

On computers that are running Windows Server 2008 or Windows Server 2008 R2, Windows PowerShell cmdlets that are part of Windows Server Migration Tools must be run in a Windows PowerShell session that was opened with elevated user rights. To do this, click Start, click All Programs, click Accessories, click Windows PowerShell, right-click the Windows PowerShell shortcut, and then click Run as administrator. You do not have to open a Windows PowerShell session with elevated user rights to run Windows Server Migration Tools on Windows Server 2003.

Although most commands for migration are Windows PowerShell cmdlets, you can run executable files in a Windows PowerShell session by adding an ampersand (&) before the executable file name. The ampersand is the call operator in Windows PowerShell.

If the executable file is not in the current directory, add the fully qualified path, as shown in the following examples. If an executable file name contains spaces, enclose the file name in quotation marks. If you are running the executable file from the current directory, precede the file name with .\.

  • Executable file that is not in the current directory: PS C:\> & C:\Windows\System32\notepad.exe

  • Executable file that is in the current directory: PS C:\Windows\System32> & .\notepad.exe

  • Executable file name that contains a space and is in the current directory: PS C:\Windows\System32> & ".\executable test.exe"