18 January 2016

Install all RSAT tools with PowerShell

The Remote Server Administration Tools are available from the base Windows Server installation without the need to install the roles it supports.  If you want to set up a management server to administer all of your Windows infrastructure form a single console you can install all of them with a single PowerShell line

 Get-WindowsFeature RSAT* | Install-WindowsFeature   

Once installed you can confirm that they are all there by checking server manager tools or by running:

 Get-WindowsFeature RSAT*

11 August 2015

F5 GTM Zone Transfer Files

If you need to manually export a zone for some or other purpose you can simply grab the files form the GTM directly.

The zone files are located in


The files are named as follows


You can check the content of the file with nano or vi or you can SCP the file locally and save it there.

20 July 2015

Mac OSX Auto proxy configuration from the shell

If you are usinf a Mac and you are jumping between multiple proxy these commands may come in handy to switch various proxy setting on and off.

You can of course go in via the Setting GUI, but trust me, after a while it gets a bit old.

The two setting you will most likely want to turn on and off are

  • Auto Proxy Discovery
  • AutoMatic Proxy Configuration

You may also want to explicitly define the two below but auto is where you should be as ti configure a lot of stuff for you including exclusions.

  • Web (HTTP)
  • Secure Web Proxy (HTTPS)

Before you can specify any commands you need to know which network interface or network service you need to use.  To get the list run

sudo networksetup -listallnetworkservices

AutoProxy Discovery 

sudo networksetup -setproxyautodiscovery "Thunderbolt Ethernet" on


sudo networksetup -setproxyautodiscovery "Thunderbolt Ethernet" off

Automatic Proxy Configuration

Enable it

sudo networksetup -setautoproxystate "Thunderbolt Ethernet" on

Disable it

sudo networksetup -setautoproxystate "Thunderbolt Ethernet" on

Configure the URL

sudo networksetup -setautoproxyurl "Thunderbolt Ethernet" "http://utm02.domain.co.za:8080/wpad.dat"

Blank it 

sudo networksetup -setautoproxyurl "Thunderbolt Ethernet" " "

To manually specify the proxy

sudo networksetup -setwebproxy "Thunderbolt Ethernet" "webproxy" 8080 

with authentication

sudo networksetup -setwebproxy "Thunderbolt Ethernet" "webproxy" 8080 on username password

set the bypass or exclusions

sudo networksetup -setproxybypassdomains  "Thunderbolt Ethernet" "*.mydomain" "*.otherdomain" ""

25 May 2015

Retrive Hyper-V host details from within the VM

Normally it is not hard to keep track of where your VMs are running.   After all there are numerous consoles and tools to use during the various stages or environments a VM can be in.

If however you find yourself with a VM that is on the network and you cannot track down the host that owns it you can get some of the host information from the VM providing the guest services are installed and running

The Registry key that maintains this information in the VM is

HKLM:\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters


You can retrieve this info from  the registry or run the following PowerShell just to return the name

(Get-ItemProperty –path "HKLM:\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters").PhysicalHostName

09 April 2015

Find duplicate VMs in your SCVMM environement

Sometimes there is a reason for legitimately having duplicate VM names that would not cause a problem at all.  If you have a replicated VM you would have two, one on the other off.

You could also have a VM stored in the library that is the same name as a server that is currently deployed.

Then there are the duplicate VMs that your really want to find and get rid of.  These can be cause by a number of factors, most of them human.

To track down duplicates use the following

Get-SCVirtualMachine | group -Property name |? {$_.Count -gt 1} | % {$_.Group} | Select-Object Name,virtualmachinestate,IsPrimaryVM, IsRecoveryVM,ID  ,hostname,HostGrouppath  | Format-Table -AutoSize

It will give you an output similar to this

The green machines are an actual replicated pair and is not a problem.
The amber machines is a duplicate we would like to get rid of.

The command will also give you the unique ID.  You can remove the unwanted duplicate using the following

Get-SCVirtualMachine -ID "****copyfromoutput****" | Remove-SCVirtualMachine -Force