Monday, May 12, 2014

Forward traffic from one interface to the other interface

Ran into this on ehow just now, while looking at doing the same for linux with netcat:

"netsh interface portproxy add v4tov4 listenport=111 listenaddress= connectport=222 connectaddress="

Very  handy if you want to push a certain kind of traffic from one network to another network (in my case I was looking at forwarding netflow traffic)

Thursday, April 17, 2014

VM Console from PowerCLI

Neat little trick within PowerCLI 5.5R1:

$VM = "your vm"

Get-VM $VM| Open-VMConsoleWindow

And now your webbrowser will open and a console will start.

Getting a list of vm's with OS'es

I wanted to do a Get-VM|select name, GuestOSFullname, but that doesn't work. So some googling gave me this little gem on the vmware forum:

New-VIProperty -Name GuestFullName -ObjectType VirtualMachine -ValueFromExtensionProperty 'Guest.GuestFullName' -Force

Now I can do a Get-VM | Select Name, GuestFullName and I get an overview of which machines have which OS.

I'm sure there are other ways of getting this too, but this was what I was looking for.

P.S., if I do Get-VM | Select Name,Guest , I do get the OS, but it is prepended with the hostname.

Tuesday, April 15, 2014

Add PowerCLI modules to Powershell console

I've recently become a fan of the Powershell ISE, especially from V3 on. To load VMware PowerCLI module and to have VMware cmdlets available in powershell console:

Add-PSSnapin VMware.VimAutomation.Core

The same can be done with the update manager:

Add-PSSnapin VMware.VumAutomation