I've been "playing" with some Dell hardware recently and as with everything I like to try and automate as many tasks as possible.
Dell have a really useful tool called Racadm which is a command line utility which you can call from a script to read and write various properties of Dell iDRAC and CMC (Chassis Management Controller).
However, since the latest iDRAC and CMC are built around WSMAN and DMTF standards, I prefer a more PowerShell only approach.
The key PowerShell command for querying is Get-CimInstance. Before we can use this command however we first need to establish a remote CIM Session to the hardware.
This is accomplished by using the New-CimSession and New-CimSessionOption cmdlets.
So...
Use some variables to store the IP, username and password for the iDRAC
$UserName="root"
$Password="calvin"
$DracIP="10.10.0.120"
Convert the username and password into a PS Credential
$SecurePass = ConvertTo-SecureString $Password -AsPlainText -Force
$DracCred = new-object -typename System.Management.Automation.PSCredential -argumentlist $UserName,$SecurePass
We can then create a new CimSessionOption object, which for the Dell Hardware the below works nicely
$cimop=New-CimSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck -Encoding Utf8 -UseSsl
Then using the above variables and new session object we can create a new CIM session to the iDRAC
$Dracsession=New-CimSession -Authentication Basic -Credential $DracCred -ComputerName $DracIP -Port 443 -SessionOption $cimop -OperationTimeoutSec 10000000
Once we have the session established, we can then use the Get-CimInstance cmdlets to query various properties by passing in a WSMAN/WinRM ResourceURI.
For example, if we just wanted to query the general BIOS properties, we could use the following URI: http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_SystemView
That would form the following command (cmdlet - session - resourceuri):
Get-CimInstance -CimSession $Dracsession -ResourceUri "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_SystemView"
Which supplies information like this:
This way if you assign the object to a variable ($BIOSINFO=Get-CimInst ...) then we can pull out specific items within scripts:
Again, you can do similar things with other hardware properties, for example I can use the resource URI for getting the network card information from a server (http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_NICView)
Drop this into a command:
$NICS=Get-CimInstance -CimSession $Dracsession -ResourceUri "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_NICView"
... and now we can get the various MAC Addresses of the various NICs
$NICS[0].PermanentMACAddress
$NICS[1].PermanentMACAddress
...
$NICS[6].PermanentMACAddress
$NICS[7].PermanentMACAddress
Hmm... Useful for SCVMM Bare Metal deployment scripting maybe?
The only thing that I struggled with this very simple method of querying the hardware for info, was the resource URI needed.
Well to help with this, the following bits of information from Dell are a god send:
DCIM Profile Library
http://en.community.dell.com/techcenter/systems-management/w/wiki/1906.dcim-library-profile.aspx
WinRM WebServices for Lifecycle Controller
http://en.community.dell.com/techcenter/extras/m/white_papers/20066174.aspx
Next time I'll post about using PowerShell to set the values rather than just query them.
1 comment:
In this day and age, email correspondence has become the most noteworthy piece of the present business. The truth of the matter is that we can’t live without email administrations and the vast majority of our budgetary exchanges rely upon it.
||Roadrunner Email Support
||Roadrunner Email Support Toll-free Number
||roadrunner technical support
||roadrunner support number
||roadrunner support
||roadrunner tech support phone number
||roadrunner email support phone number
||roadrunner phone number
||roadrunner customer service number
||Roadrunner Customer Service Number
||roadrunner customer service number
||roadrunner webmail support
||roadrunner email customer service
||roadrunner customer service phone number
||Roadrunner Email Support Number
||roadrunner support
||roadrunner contact number
||roadrunner customer support number
||roadrunner customer support phone number
||Roadrunner Technical Support Phone Number
||roadrunner support number
||roadrunner technical support phone number
||roadrunner technical support number
||roadrunner customer support
Post a Comment