TechShizz | All posts by rich

Migrating Server Roles with SmigDeploy

Get-WindowFeature - Name migration

Install-WindowsFeature -Name migration

cd \windows\system32\servermigrationtools

.\smigdeploy.exe /package /architecture /amd64 /os WS12R2 /path C:\Migration

#copy the Smig files to the Source Machine
Copy-Item -Path C:\Migration\SMT_ws12r2_amd64 -Destination \\srv2012-lab\c$\Migration

.NET 3.5 is required on the source machine for this to work, so the first step (if it is not already installed) is to install it.

#Check is .NET3.5 is installed
Get-WindowsFeature -Name net-framework-core

#Install .NET 3.5 if required. You will need a 2012R2 ISO mounted for the source files

Install-WindowsFeature net-framework-core -source D:\sources\sxs

#Import smig cmdlets into session
Add-PSSnapin Microsoft.Windows.ServerManager.Migration

#Stop DHCP (the role we're migrating)
Stop-Service -Name DHCP

#View roles and features eligible for migration
Get-SmigServerFeature

#Export the migration data
Export-SmigServerSetting -FeatureID DHCP -Path c:\migration\DHCPMigration -verbose

#Finally copy this exported data back over to the target server
Copy-Item -Path C:\migration\DHPCMigration -Destination \\srv2016-lab\c$\migration

Back over on the Target server we now need to Import the settings

#Import smig cmdlets into session
Add-PSSnapin Microsoft.Windows.ServerManager.Migration

#Install DHCP role and import settings
Import-SmigServerSetting -FeatureID DHCP -Path C:\migration\DHCPMigration -verbode -force

 

Using DISM to convert Server 2016 Evaluation License to a normal License

Scenario

We have a copy of server 2016 installed on an evaluation license and we want to license it with our company license. Datacenter edition of Server 2016 is required to do this conversion.

Solution

We can use the Automatic Virtual Machine Activation keys to convert the license. We use DISM to convert the license like this:

dism /online /Set-Edition:ServerStandardCor /ProductKey:C3RCX-M6NRP-6CXC9-TW2F2-4RHYD /AcceptEula

See More on Automatic Virtual Machine Activation https://technet.microsoft.com/en-us/library/dn303421(v=ws.11).aspx

AVMA keys
  

The following AVMA keys can be used for Windows Server 2012 R2.

Edition AVMA key
Datacenter Y4TGP-NPTV9-HTC2H-7MGQ3-DV4TW
Standard DBGBW-NPF86-BJVTX-K3WKJ-MTB6V
Essentials K2XGM-NMBT3-2R6Q8-WF2FK-P36R2

The following AVMA keys can be used for Windows Server 2016.

Edition AVMA key
Datacenter TMJ3Y-NTRTM-FJYXT-T22BY-CWG3J
Standard C3RCX-M6NRP-6CXC9-TW2F2-4RHYD
Essentials B4YNW-62DX9-W8V6M-82649-MHBKQ

Configure Remote Server Management via PowerShell

Scenario

We have two servers, server1 and server2.

Server1 is a DC and Server2 is a web server. We want to be able to use the IIS management console to administer Server2 from Server1.

To allow remote management of a server role we need to enable the via PowerShell. Below is an example for enabling the management of IIS.

First we need to modify the registry to allow the connection and then we need to set the server "WMSVC" to startup automatically. After the two comands below have been run from Server2, you can then add server2 via the IIS Management Console on Server1. 

Set-ItemProperty -Path "HKLM:\Software\Microsoft\WebManagement\Server" -Force -Restart
Set-Service WMSVC -StartupType Automatic

 

Migrate Server Roles with SmigDeploy

 

# view server migration tools feature
Get-WindowsFeature -Name migration

# install windows server migration tools
Install-WindowsFeature -Name migration

# navigate to smt directory
cd \windows\system32\servermigrationtools

# generate package for source machine
.\smigdeploy.exe /package /architecture amd64 /os WS12R2 /path C:\Nuggetlab

# copy package over to source machine
Copy-Item -Path c:\nuggetlab\SMT_ws12R2_amd64 -Destination \\srv2012-nug\c$\nuggetlab -Recurse


### complete steps on SRV2012-NUG (source machine) before going further ###

# import smig cmdlets into session
Add-PSSnapin Microsoft.Windows.ServerManager.Migration

# install DHCP role and import settings!
Import-SmigServerSetting -FeatureID DHCP -Path c:\nuggetlab\migration -Verbose -Force

 

Migrate Server Roles with SmigDeploy

 

# view server migration tools feature
Get-WindowsFeature -Name migration

# install windows server migration tools
Install-WindowsFeature -Name migration

# navigate to smt directory
cd \windows\system32\servermigrationtools

# generate package for source machine
.\smigdeploy.exe /package /architecture amd64 /os WS12R2 /path C:\Nuggetlab

# copy package over to source machine
Copy-Item -Path c:\nuggetlab\SMT_ws12R2_amd64 -Destination \\srv2012-nug\c$\nuggetlab -Recurse


### complete steps on SRV2012-NUG (source machine) before going further ###

# import smig cmdlets into session
Add-PSSnapin Microsoft.Windows.ServerManager.Migration

# install DHCP role and import settings!
Import-SmigServerSetting -FeatureID DHCP -Path c:\nuggetlab\migration -Verbose -Force