Showing posts from December, 2013

Get Dell ESX host warranty info via PowerCLI version 3

Summary: Had a script that was doing a screen scrape of Dell's support page for warranty info.  Now they require a log in.  So it was time to finally revise my script to use Dell's wsdl (SOAP) interface. Example: Details: I was able to simplify the script a bit using the code provided by Jon Gurgul to pull from Dell's provided SOAP service.  I copied the code into a Get-DellAssetInformation.psm1 file so I could call the function as a module. The variable you should probably update is the $ServiceDescription variable to match the warranty type you expect from your boxes so you get an actual return of data. I simply plugged this into my existing code removing the screen scrape code and this is what I ended up with: Script: Add-PSsnapin VMware.VimAutomation.Core #Module code courtesy of Jon Gurgul Import-Module C:\myModuleDirectory\Get-DellAssetInformation.psm1 $VIServer = Connect-VIServer myvCenterServer $date = Get-Date $htmpath

Auto-Remediation vCenter Alarm

Summary: I've been dealing w/ issues on Emulex OCe11102-FM logging out of the vSAN Fabric and not recovering. Long story short, it's been a firmware problem and I was able to get a alpha firmware that fixed the issue. In the meantime, I had created a PowerCLI script to auto-remediate every hour if a degraded path was detected.  I wasn't fond of the solution, so I looked to vCenter alarms to see if I could have them do it for me.  Turns out they can, but there are caveats to this approach. What follows is an example of how to set something like this up and details specific to the errors/configuration I was dealing with.

SOAP(y) Powershell fun w/ BT Diamond's IPAM (Part 2)

Since my initial attempt using New-WebServiceProxy failed because it didn't like the XML return from IPControl, I needed to find out why.  This is where I downloaded SOAPUI to dig in and find out why.  More importantly, I found that I could use the info from it to plug into the Invoke-WebRequest cmdlet. [I'm going to be using Dell's web service as an example simply because it's easier from an example standpoint.  Dell's service actually works w/ the New-WebServiceProxy cmdlet.  The basic concept of what I'm doing is the exact same though.]

SOAP(y) Powershell fun w/ BT Diamond's IPAM (Part 1)

PreReq: API Access Powershell 2.0 + I'm using 3.0 now.  I assume these examples work in 2.0 as well, but I'm too lazy to test. This was a bit of an interesting exercise for me since I've mostly only ever used cmdlets.  I'm still using cmdlets, but calling SOAP based web services to gather information. Here is what I've been experimenting with: #Credentials are needed when working w/ a secure web service. $Creds = Get-Credential #I was able to find the correct API address by clicking the help link on the login page.  They seem to have a different web service per API instruction type.  In this case, I just want to 'get' address information thusly demonstrated below. $IPControlGetService = New-WebServiceProxy "https://myIPControlServerNameorIP/inc-ws/services/Gets?wsdl" -Credential $creds #This is where it gets interesting, from here I can essentially browse what properties and methods are available to me by calling the $IPC

RacADM, Powershell, and Kerberos KeyTabs

Summary: I was looking to automate configuration of iDRAC's (Dell Remote Admin Console) synonymous w/ iLOM and many other acronyms.  I also wanted to enable domain authentication in a somewhat secure manner.  By using a kerberos keytag, I'm able to in the very least obfuscate the username and password into a file for upload into the iDRAC.  What follows is a journey into a ridiculous realm. PreReqs: RACADM ktpass Powershell 3.0 (2.0 probably works too, but I was using 3.0 @ the time) Your root CA's cert This is so it AD Authentication can be setup Solution: It's not a complete solution, but hopefully it'll help you get started in your own endeavors.  Below assumes the iDRAC has been configured and is available on the network in default config. To generate a kerbero's keytab , you simply need the name and password of a service account (this is simply a Active Directory user account) in your domain. ktpass /pass ReallySecurePas5word /ptype K