PowerShell: Ping-Subnet

A couple a weeks ago I was hanging out in the PowerScripting Ustream waiting for the show to start. There were several of us caring on, when the interview subject Brandon Shell placed a call to scripting. He asked for a script to ping a subnet. There are many select-alive/ping-host scripts why write another one? The answer is simple pinging a target is easy, what Brandon was asking for was a fast way to generate the list of hosts. (Additionally, if you work with Active Directory then you can already see the usefulness in being able to ingest the subnets in sites and services as a parameter.) Shortly after Brandon made the request I opened my big mouth, and commented that the math was easy. The hard part is “threading”, as you know we can’t thread in PowerShell… but there are ways to perform concurrent operations. The PSJobs in V2 were purpose built for such a task. Unfortunately the *-job cmdlets use winrm as a backend, and require WS-MGMT to be installed/configured. As I was carrying on with this line of thought Brandon broke in, and informed me that the Get-WMIObject cmdlet in CTP3/V2 uses its own ‘backend’! He went on to inform me that all I needed was to tack on the –AsJob parameter… After a couple quick tests, I had a draft, and shortly thereafter a script!

Continue Reading »

Powershell
Scripting

Comments (4)

Permalink

Where in !@#%* does the text on tty11 come from?

You know the text I’m talking about…when you walk up to an ESX host and it has the hostname and IP address along with instructions to “press ALT-F1 to open the ESX Server Console, press ALT-F11 to return to this screen”.

Yeah, that text. Where does it come from? It’s not a typical tty…it has a screen saver (if you let it be for a while it’ll go blank). I can’t figure out for the life of me where it’s started, or where it get’s it’s data from…well I found some things…but not where the obviously non-dynamic (text other than ip address, hostname) data comes from.

The point of my looking for how it get’s that data is because we recently changed the IP addresses of all our ESX hosts. The console (and consequentially webAccess) were on a public LAN. For security reasons, we didn’t want this, so we put them on a private LAN. Nothing difficult…took care of the entire process from VI Client (add new console interface, set as primary, remove old console interface). I even went to the trouble (ok, I might have OCD) of physically standing in front of the box and moving the new vswif1 so that it’s named vswif0, just because it was irritating me.

Continue Reading »

ESX
VMware

Comments (3)

Permalink