Author Archives: nerenther

PowerCLI: Getting vmhost uptime

I love a powershell challenge, and last week a colleague of mine asked me for assistance in getting the uptime of vmware hosts. My initial response did the trick: Get-View  -ViewType hostsystem -Property name,runtime.boottime | Select-Object Name, @{N=”UptimeDays”; E={((((get-date) – … Continue reading

Posted in PowerCLI, Powershell, VMware Tagged , , , , , ,

PowerCLI: Getting the status of vmware tools on all VMs

I’m sure I don’t need to explain to you guys why VMware tools is a good idea to have installed on your VMs, and probably not why it’s a good idea to keep VMware tools updated. However, I haven’t found … Continue reading

Posted in PowerCLI, Powershell, VMware Tagged , , , , ,

PowerCLI: Getting datastore alarms

Next in the series on getting alarms is getting datastore alarms. Again, the code is pretty similar: $Datastores = Get-View -ViewType Datastore -Property Name,OverallStatus,TriggeredAlarmstate $FaultyDatastores = $Datastores | Where-Object {$_.TriggeredAlarmState -ne “{}”} $progress = 1 $report = @() if ($FaultyDatastores … Continue reading

Posted in PowerCLI, Powershell, VMware Tagged , , , , ,

PowerCLI: Getting cluster alarms

The next step in my short series on getting vCenter alarms using PowerCLI is to get cluster alarms. Here’s the code: $Clusters = Get-View -ViewType ComputeResource -Property Name,OverallStatus,TriggeredAlarmstate $FaultyClusters = $Clusters | Where-Object {$_.TriggeredAlarmState -ne “{}”} $report = @() $progress … Continue reading

Posted in PowerCLI, Powershell, VMware Tagged , , , , ,

PowerCLI: Getting host alarms

Yesterday I wrote a post about getting vm alarms through PowerCLI. Today it’s time for getting host alarms The code is very similar to the one for getting vm alarms, since they both use get-view to grab all info: $VMHosts … Continue reading

Posted in PowerCLI, Powershell, VMware Tagged , , , , ,

PowerCLI: Getting vm alarms

A few weeks ago I started to put together a health check script for our vmware environments and the first thing I wanted to have in that report is a list of triggered alarms. To my surprise there was no … Continue reading

Posted in PowerCLI, Powershell, VMware Tagged , , , , ,

PowerCLI: Mount NFS stores on multiple hosts

Ever had a bunch of vmware hosts that you want to add a NFS datastore on? It can be quite time consuming to say the least. In our environment we have a couple of NFS stores that should be available … Continue reading

Posted in PowerCLI, Powershell, VMware Tagged , , ,

Powershell: Listing activated clients on KMS server

If you are using a KMS server for activating servers and clients in your environment, you may have noticed that there’s really no obvious way to get a list of all the clients that have been activated by the KMS … Continue reading

Posted in Microsoft, Powershell Tagged , ,

Powershell: Measuring latency on DNS queries

A little while ago we have some issues with one of our Exchange environments. The symptoms was that basically everything was slow, opening address books, owa, sending mails and so on. After some digging it occurred to me that this … Continue reading

Posted in Microsoft, Powershell Tagged , , , ,

Activate Server 2012 (R2) by telephone

The option for activating Server 2012 by phone is kinda hidden, so I have to write this down before I forget it: Win+R – SLUI 4

Posted in Microsoft Tagged , ,