Category: Windows Server 8

Windows Server 2012: Hyper-V Snapshot Reminder

Windows Server 8

Last year I created a Windows PowerShell script for System Center Virtual Machine Manager which checks all the Virtual Machines for Snapshots and if you have any it will send you an E-Mail and it will remind you about that.
It were just some small changes from the SCVMM PowerShell cmdlets to the Windows Server 2012 PowerShell cmdlets.

Hyper-V Snapshots Reminder

 
# Get Snapshots
$snapshots = Get-VM | Get-VMSnapshot
 
# Check for existing Snapshots
if ($snapshots.count -gt 0){
 
    # Create the List of Snapshots
    $info = $snapshots | Format-Table VMName, Name -auto | Out-String
 
    # Mail Configuration
    # ==================
 
    # Configuration
    $emailFrom = "[email protected]"
    $emailTo = "[email protected]"
    $emailSubject = "VM Snapshot Reminder"
    $emailMessage = "You have still some snapshots: `n `n" + $info + "`n Greetings your Hyper-V Server"
    $smtpServer = "mail.server.com"
    $smtpUserName = "username" # This could be also in e-mail address format
    $smtpPassword = "password"
    $smtpDomain = ""
 
    # SMTP Object
    $smtp = New-Object System.Net.Mail.SmtpClient($smtpServer)
    $mailCredentials = New-Object System.Net.NetworkCredential
    $mailCredentials.Domain = $smtpDomain
    $mailCredentials.UserName = $smtpUserName
    $mailCredentials.Password = $smtpPassword
    $smtp.Credentials = $mailCredentials 
 
    # Send E-Mail
    $smtp.Send($emailFrom, $emailTo, $emailSubject, $emailMessage)
 }


Windows Server 2012: Doing multiple configuration changes on Hyper-V VMs via PowerShell

Windows Server 8

Over the weekend I was Setting up my lab for the RTM of System Center 2012. I created some Windows Server 2008 R2 Virtual Machines on my Windows Server 2012 beta Hyper-V server. After I had created all VMs and installed them, I realized I forgot to configure the limit for Dynamic Memory for the Hyper-V Virtual Machines.

Now here the new PowerShell module for Hyper-V which comes with Windows Server 2012 helped me save some time.

Hyper-V PowerShell

 

First I check the Dynamic Memory Maximum value for all my System Center 2012 Virtual Machines.

Get-VM -Name SC2012* | ft Name, MemoryMaximum

After that I changed the value from all my System Center 2012 Virtual Machines to 8GB

Get-VM -Name SC2012* | Set-VM -MemoryMaximumBytes 8589934592

btw. if you don’t know that 8GB are 8589934592 Bytes PowerShell can help you, check this out:

Get-VM -Name SC2012* | Set-VM -MemoryMaximumBytes 8GB

Windows Server 2012: Hyper-V PowerShell

Ben Armstrong, Virtualization Program Manager, did also a blog post on performing bulk configuration changes in Hyper-V via Windows PowerShell on his blog.

 



Windows Server 2012 – CDN (Consistent Device Naming)

Windows Server 8

There is a new feature coming with Windows Server 8 called Consistent Device Naming (CDN) which should make life in the datacenter a lot easier.

CDN

It allows to hardware vendors to consistently name NICs in the BIOS which means the Windows Server 8 can read this information and name NICs the same.

That means that the name of the NICs on the chassis can be the same name on the NICs in the OS.

CDN Consistent Device Naming

If you have ever worked with Hyper-V Clusters you are going love this feature.



Windows Server 2012: SMB 2.2 is now SMB 3.0

Last September at the Build Conference, Microsoft announced a new version of SMB (Server Message Block protocol), at this time the new Version was called SMB 2.2. Now some days ago at MMS 2012 (Microsoft Management Summit 2012) Microsoft announced the new name of the next generation server operating system, Windows Server 2012.

Now with this change and the Windows Server Team announced on their blog that the new name of the Server Message Block protocol will be SMB 3.0.

I think this makes totally sence, because the Team did a lot of work and this Version of SMB is a Major release.

Some of the new function of SMB 3.0 available in Windows Server 2012:

  • SMB for Server Applications
  • Active file sharing with SMB Scale Out
  • Scalable, fast, and efficient storage access with SMB Direct
  • Fast data transfers and network fault tolerance with SMB Multichannel
  • VSS for SMB file shares
  • Transparent Failover and node fault tolerance with SMB
  • Secure data transfer with SMB encryption
  • Faster access to documents over high latency networks with SMB Directory Leasing

You can get more Information about SMB 3.0 here:



News from MMS 2012

Yesterday there was the first Keynote at MMS2012 (Microsoft Management Summit). Microsoft made some really amazing announcements.

Microsoft System Center Logo

First Microsoft announced the General Global Availability (RTM) of System Center 2012. You can now download it here: http://aka.ms/syscntr

Windows Server 8

 

Second Microsoft announced the new Name of the next Server Version with the Codename Windows Server 8. It is Windows Server 2012. You can get the beta Version of Windows Server 2012 here: http://aka.ms/win8server

Windows 8 Logo

 

Microsoft also announced on the Windows Blog which Version will of Windows 8 will be available. There will be 4 Versions:

  • Windows 8
  • Windows 8 Pro
  • Windows RT
  • Windows Enterprise

You can check out more on the Windows Blog.

Yesterday Microsoft also released the Microsoft Deployment Toolkit (MDT) 2012. You can get it here: http://www.microsoft.com/download/en/details.aspx?id=25175&WT.mc_id=rss_windows_allproducts

Ah and by the way HALO4 is comming!

Thanks to John Weston for  getting all the Information together.



Replace netsh with Windows PowerShell – Basic network cmdlets

Some days ago I made a blog post about how you can replace diskpart.exe with the new cmdlets in Windows PowerShell v3. Now my next goal was to replace netsh with PowerShell.

Microsoft offers a lot of new cmdlets for networking tasks lets see what we have here. We got a lot of new PowerShell modules which are related to networking.

get-module

Now the two modules which sound really interesting are

NetAdapter
NetTCPIP

lets check which cmdlets are included

Get-Command -Module NetAdapter

net-adpater module

 Get-Command -Module NetTCPIP

Now lets start with NetAdpater.

List all Network Adapters

 Get-NetAdapter

get-netadapter

Just list Wireless Network Adapters

 Get-NetAdapter -Name *Wireless* 

get-netadapter wireless

Get more information VLAN ID, Speed, Connection status

 Get-NetAdapter | ft Name, Status, Linkspeed, VlanID 

get-netadapter information

Get driver information

 Get-NetAdapter | ft Name, DriverName, DriverVersion, DriverInformation, DriverFileName 

get-netadapter driver

Get adapter hardware information. This can be really usefull when you need to know the PCI slot of the NIC.

 Get-NetAdapterHardwareInfo 

get-netadapterhardwareinfo

Disable and Enable a Network Adapter

 Disable-NetAdapter -Name "Wireless Network Connection"
Enable-NetAdapter -Name "Wireless Network Connection" 

disable enable network adapter

Rename a Network Adapter

 Rename-NetAdapter -Name "Wireless Network Connection" -NewName "Wireless" 

rename network adapter

Now with the NetTCPIP PowerShell module we can work with IP settings

Get IP and DNS address information

 Get-NetAdapter -Name "Local Area Connection" | Get-NetIPAddress 

get-ipaddress

Get IP address only

 (Get-NetAdapter -Name "Local Area Connection" | Get-NetIPAddress).IPv4Address 

get-ipaddress only

Get DNS Server Address information

 Get-NetAdapter -Name "Local Area Connection" | Get-DnsClientServerAddress 

get-dnsserver

Set IP Address

 New-NetIPAddress -InterfaceAlias "Wireless" -IPv4Address 10.0.1.95 -PrefixLength "24" -DefaultGateway 10.0.1.1 

or if you want to change a existing IP Address

 Set-NetIPAddress -InterfaceAlias "Wireless" -IPv4Address 192.168.12.25 -PrefixLength "24"

Remove IP Address

 Get-NetAdapter -Name "Wireless" | Remove-NetIPAddress 

Set DNS Server

 Set-DnsClientServerAddress -InterfaceAlias "Wireless" -ServerAddresses "10.10.20.1","10.10.20.2"

Set interface to DHCP

 Set-NetIPInterface -InterfaceAlias "Wireless" -Dhcp Enabled

Now with this basic knowledge we can replace some of the basic netsh commands and ipconfig

netsh

ipconfig
netsh interface set interface "Local Area Connection" newname="Management"
netsh interface ipv4 set address "Management" static 192.168.10.101 255.255.255.0 192.168.10.1

Windows PowerShell

Get-NetAdapter
Rename-NetAdapter -Name "Local Area Connection" -NewName "Management"
New-NetIPAddress -InterfaceAlias "Management" -IPv4Address 192.168.10.101 -PrefixLength "24" -DefaultGateway 192.168.10.1


Microsoft Virtual Machine Converter Solution Accelerator Beta

Hyper-V R2 SP1

Microsoft released a beta of a new Solution Accelerator called “Microsoft Virtual Machine Converter”. The Converter helps you to migrate Virtual Machines from VMware vSphere to Microsoft Hyper-V.

About the Microsoft Virtual Machine Converter Solution Accelerator

The Microsoft Virtual Machine Converter (MVMC) provides a Microsoft-supported, freely available, standalone solution for converting VMware virtual machines (VMs) and VMware virtual disks (VMDKs) to Hyper-V virtual machines and Hyper-V virtual hard disks (VHDs). MVMC supports converting virtual machines using the following guest operating systems:

  • Windows Server 2003 with Service Pack 2
  • Windows Server 2003 R2 with Service Pack 2
  • Windows Server 2008 R2
  • Windows 7

The Microsoft Virtual Machine Converter converts VMware virtual machines created with:

  • VMware vSphere 4.1
  • VMware vSphere 5.0

To virtual machines for:

  • Windows Server 2008 R2 SP1 Hyper-V
  • Microsoft Hyper-V Server 2008 R2 SP1

The Microsoft Virtual Machine Converter:

  • Provides a quick, low-risk option for VMware customers to evaluate Hyper-V
  • Converts the virtual disks and the VMware VMs configuration, such as memory, virtual processor, and other machine settings from the source
  • Uninstalls the VMware tools on the source VM and installs the Hyper-V Integration Services as appropriate
  • Includes an easy-to-use wizard-driven GUI simplifying VM conversion
    Supports offline conversions of VMware virtual hard disks (VMDK) to a Hyper-V based virtual hard disk file format (VHD)
  • Includes a scriptable Command Line Interfaces (CLI) for performing machine conversion and offline disk conversion which integrates with datacenter automation workflows, such as those authored and executed within System Center Orchestrator. The command line can also be invoked through PowerShell.

 

Check it out on Microsoft Connect: https://connect.microsoft.com/site14/MVMC