Windows Server 2008 R2 Blackscreen after enabling Hyper-V Role on Cisco UCS

Hyper-V R2 SP1

Today I had a strange problem on a Cisco UCS installation. After you enabled Hyper-V on a Windows Server 2008 R2 with SP1, you will get a black screen.

Cisco fixed this in the UCS Firmware version 2.0.1(t).

“After enabling Hyper-V in Windows 2008 R2 SP1 then rebooting, the server no longer shows a black KVM screen and a failure of windows startup and login.”

Release Notes for Cisco UCS Software, Release 2.0  

PowerShell 3.0: Show-Command

Powershell

Just a simple note about a new cmdlet in PowerShell 3.0. Show-Command is something very useful if you try out a new PowerShell Command. It shows all the options and possible parameters you have with the cmdlet.

Show-Command Get-Childitem

Show-Command

 

Powershell: Convert String to Scriptblock

If you use PowerShell remoting in some scripts you will se you cannot use a string to send it with the Invoke-Command cmdlet.

So you can simple convert a String to a Scriptblock

 $scriptBlock = [Scriptblock]::Create($string) 

Now here an example

$remoteCommand =
@"
Import-Module ActiveDirectory
New-ADOrganizationalUnit -name
"@

$scriptBlock = [Scriptblock]::Create($remoteCommand)

Invoke-Command -ComputerName AD01 -ScriptBlock $scriptBlock

Basically you could create a function for that.

function ConvertTo-Scriptblock  {
<#
 Function to Convert a String into a Script Block
#>
	Param(
        [Parameter(
            Mandatory = $true,
            ParameterSetName = '',
            ValueFromPipeline = $true)]
            [string]$string
        )
       $scriptBlock = [scriptblock]::Create($string)
       return $scriptBlock
}

PowerShell: Ping IP range

Powershell

Some you need to know which IP in a specific range is already in use. With Windows PowerShell there is a simple way to ping a IP range.

You can use the .Net class System.Net.Networkinformation.Ping to do this.


$ping = New-Object System.Net.Networkinformation.Ping
1..254 | % { $ping.send(“192.168.100.$_”) | select address, status } 

Commands for Windows Server Core & Hyper-V Core Server

For some KTSI projects I have been working a lot with Windows Server Core or Hyper-V Server. Now I had to do a lot of automation, so I made this little connection of commands. If you configure the server manually you can do the most important things with the sconfig utility.

Windows Server Core

Networking

Set Hostname

netdom renamecomputer %COMPUTERNAME% /NewName:<NewComputerName> 

Join Domain

netdom join %COMPUTERNAME% /domain:<DomainName> /userd:<UserName> /passwordd:*

Remove Domain

netdom remove

Rename Network Interface

netsh interface set interface name=”old name” newname=”new name”

Configure IP Address

netsh interface ipv4 set address name=”<Interface Name>” source=static address=<IPAddress> mask=<SubnetMask> gateway=<DefaultGateway>

Configure DNS Servers

netsh interface ipv4 add dnsserver name=”<Interface Name>” address=<DNS Server IP> index=1

Disable Firewall (not recommended)

netsh advfirewall set allprofiles state off

 

Remoting

Enable PowerShell Remoting

Enable-PSRemoting

Enable Remotedesktop

netsh advfirewall firewall set rule group=”remote desktop” new enable=yes

Enable Remote Administration

advfirewall firewall set rule group=”Remote Administration” new enable=yes

Enable Remote Firewall Administration

netsh advfirewall firewall set rule group=”Windows Firewall Remote Management” new enable=yes

Enable ICMP (Ping)

netsh firewall set icmpsetting 8

Enable Remote Disk Management

netsh advfirewall firewall set rule group=”Remote Volume Management” new enable=yes

 

Licensing

Enter License key

slmgr.vbs -ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

Activate Windows

slmgr.vbs -ato

 

Windows Update

Enable automatic updates

cscript C:'Windows'System32'Scregedit.wsf /au 4

Disable automatic updates

cscript C:'Windows'System32'Scregedit.wsf /au 1

 

Roles & Features

Get availibale features & roles

Dism /online /get-features /format:table

Enable feature & roles

Dism /online /enable-feature /featurename:<featurename>

 

Basics

Change Administrator password

net user administrator *

Restart Computer

shutdown /r /t 0

Logoff

logoff

More information about Server Core: TechNet