Wednesday, August 31, 2011

Activating Windows servers to KMS server

For people who use a Key Management Server (KMS), you don't need to fill in a serial number and activate with Windows 7/2008/2008R2 directly, but you use a separate server for this.

On the server you need to activate, open an administrative command prompt, and type:
slmgr.vbs /skms <kmsserver> (the part between brackets is the kms server in your organisation)

It will pop up a message saying the KMS server has been set correctly:









After this, type: slmgr.vbs /ato

If all goes well, it activates the server:












You may encounter an error:
 








 
In this case, check the following:
  • Can you ping the kms server?
  • Can you telnet to port 1688 on the kms server?
  • Is the time and date set correctly on the server you want to activate?
 I had the last one today, and forgot to check the date. The time was set correctly, but the date was 2 months off(doh!).

Tuesday, August 30, 2011

No Remote Desktop client access licenses available


That's what a colleague of mine got when trying to connect to a terminal server. I had seen this message a long time before, and found a solution back then, but every time I get this message, I need to go through my extensive mailbox and search for the answer, so I thought I'd post it here:

Here’s how you fix the error message:

-    Open up regedit on your machine (Start->Run->Type: regedit.exe)
-    Go to HKEY_LOCAL_MACHINE\Software\Microsoft\MSLicensing\Store
-    Click the LICENSE00x folder (probably LICENSE000)
-    Click File->Export, and export the LICENSE00x folder to a registry file
-    Now delete the LICENSE00x folder.
-    Try to log on again.

So far it worked every time for me and my colleagues.

Wednesday, August 24, 2011

Powershell selection stuff..

Something to remember for myself about selecting:


get-vm | gm as an example, shows all methods and properties you can do with get-vm.


get-vm | where {$_.PowerState -eq "PoweredOn" -and $_.Name -ne "PietjePuk" }

Shows all VM's that are powered on but not that one VM that is called "PietjePuk".
$_.Powerstate is one of the properties of the get-vm statement.

This is how you can select VM's based on different properties.

So get-vm | where {$_.MemoryMB -eq "4096"} shows you all vm's that have 4GB of memory.

-eq = equals
-ne = does not equal
-and = a secondary variable to select.

Tuesday, August 23, 2011

Active Route gets removed on Windows Server 2008 offline Cluster IP Address

An interface on a Windows 2008R2 cluster was no longer reachable. It was a management interface, and the machine was still up, but of course the server came up in the monitoring as not reachable. There was a persistent route present on the server, but somehow this route got removed from the active routing table.

Some searching by one of my colleagues turned up this article: http://blogs.technet.com/b/networking/archive/2009/05/21/active-route-gets-removed-on-windows-server-2008-offline-cluster-ip-address.aspx

Apparently when adding persistent routes on cluster nodes you need to make sure that you specify the interface as the destination rather than the next hop IP address. An example:

Adding a route as usual, open a command prompt: route add -p 10.10.0.0 mask 255.255.0.0 10.10.10.1

This would route all traffic to 10.10.x.x addresses via 10.10.10.1, and the only interface on the host (e.g. with host IP address 10.10.10.20) within that network range would use that route. However, this route could dissapear from the active routing table *despite having a persistent route* because the next hop specified is part (or could be part) of a clustered network.

With Windows 2008 (and R2) you need to add it a little bit differently for cluster nodes, according to the Technetblog:
    • Open up the Network and Sharing Center
    • Click Change adapater settings
    • Look at the interface you want the route for and note which the "Device Name" of the interface (see screenshot). As an example, the first interface in the screenshot is the one that needs the route. It has device name "Intel(R) PRO/1000 MT Network Connection #3"


    • Open up the command prompt as administrator
    • Type route print, and look at the first lines that show the interfaces:

    As you see the Intel interface with #3 at the end has a number in front of it: 21 in this case. This is the Interface Number

    • Now type the route you want, e.g.: route add -p 10.10.0.0 mask 255.255.0.0 0.0.0.0 if 21
    The trick is to add "0.0.0.0 if <interface number>" instead of the next hop address. Now, the route will stay and you will have your connectivity regardless if a Clustered IP Address is online or offline.

    Friday, August 19, 2011

    Updating VMWare Tools on all powered on Windows VM's

    Quick PowerCLI line to update the VMWare Tools all Windows VM's that are powered on without rebooting them:

    get-vm | where {$_.PowerState -eq "PoweredOn" -and $_.Guest.OSFullName -match "Microsoft Windows*" } | Update-Tools -NoReboot

    Oh how I love PowerCLI...

    Monday, August 15, 2011

    There are errors during the remediation operation

    "There are errors during the remediation operation" . I stared blankly at the screen. Why was this happening?

    I was trying to update an older vSphere 4.0 setup with update manager. The server was already in maintenance mode, but after clicking "Remediate" the error message came up almost immediately. A retry did not help. Quick googling came up with the following:

    http://www.vmware.com/support/vsphere4/doc/vsp_vum_40_rel_notes.html

    Host Patch and Upgrade Remediation Might Fail
    Host patch and upgrade remediation might fail with the message There are errors during the remediation operation if an inaccessible virtual machine exists on the host. The reason for this failure might be that the virtual machine files reside on a disconnected network storage.
    Workaround: Connect the disconnected network storage or remove the inaccessible virtual machine from the vSphere inventory.


    I checked the host, and indeed there was an inaccessible VM! It was a no longer used one, so I removed it from the inventory, and updating went fine after that.

    Where would we be without Google, right? ;-)

    Monday, August 1, 2011

    vm (invalid) and greyed out

    A number of vm's in a vSphere setup were showing VMWare Tools not running. Checking the vm's themselves showed that it was running. I tried reinstalling VMWare Tools, but when I clicked the "Install/Upgrade VMWare Tools" the vm turned gray, and was appended with "(invalid)"

    Some googling showed up this: http://communities.vmware.com/message/861038

    •  Log on to the host where the vm is running on
    • type: "service vmware-vpxa restart"
    • type: "service mgmt-vmware restart"

    The host and vm's that were running on there became disconnected in the interface for a few seconds, but after that came back, and the vm's VMWare Tools became OK. It turned out the vm's didn't need updating anyway.