<#
.SYNOPSIS
Ucs-Blade-Info, get blade info from one ore more UCS Domains and output as CSV
.DESCRIPTION
Ucs-Blade-Info, get blade info from one ore more UCS Domains and output as CSV
.NOTES
John McDonough, Cisco Systems, Inc. (jomcdono)
.PARAMETER Ucs
The UCS hostame or IP address
.PARAMETER UcsUser
A UCS user name
.PARAMETER UcsPass
The user's password
.EXAMPLE
Ucs-Blade-Info.ps1 -Ucs "10.10.20.30" -UcsUser admin -UcsPass admin123Ucs-Blade-Info.ps1 -Ucs "10.10.20.30,10.10.20.10" -UcsUser admin -UcsPass admin123
#>
param(
[Parameter(Mandatory=$true,HelpMessage="Enter a comma separated UCS hostname or IP address list")]
[string] $Ucs,
[Parameter(Mandatory=$true,HelpMessage="Enter UCS user")]
[string] $UcsUser,
[Parameter(Mandatory=$true,HelpMessage="Enter UCS user's Password")]
[string] $UcsPass
);
# Connect to UCS System
Import-Module CiscoUCSPS -ErrorAction SilentlyContinue
Set-UcsPowerToolConfiguration -SupportMultipleDefaultUcs:$true > $null;
$password = convertto-securestring -Force -AsPlainText $UcsPass;
$credentials = new-object -typename System.Management.Automation.PSCredential -argumentlist $UcsUser,$password;
$ucsms = $Ucs.Split(",");
Connect-Ucs $ucsms -Credential $credentials > $null;
"UCS,Server,Service profile,Adapter firmware,CIMC firmware,BIOS,Board controller firmware,Host firmware policy";
$Firmware = Get-UcsFirmwareRunning -Filter "dn -ilike sys/chassis-*/blade-*";
$ServiceProfiles = Get-UcsServiceProfile -AssocState associated;
$Blades = Get-UcsBlade;
$Blades | %{
$Blade = $_;
$AdapterFirmVer = $Firmware | ?{$_.dn -like $($Blade.dn + "/*") -and $_.Ucs -eq $Blade.Ucs -and $_.Type -eq "adaptor" -and $_.Deployment -eq "system"} | Select-Object -ExpandProperty Version;
$CimcFirmVer = $Firmware | ?{$_.dn -like $($Blade.dn + "/*") -and $_.Ucs -eq $Blade.Ucs -and $_.Type -eq "blade-controller" -and $_.Deployment -eq "system"} | Select-Object -ExpandProperty Version;
$BiosVer = $Firmware | ?{$_.dn -like $($Blade.dn + "/*") -and $_.Ucs -eq $Blade.Ucs -and $_.Type -eq "blade-bios"} | Select-Object -ExpandProperty Version;
$BoardControllerVer = $Firmware | ?{$_.dn -like $($Blade.dn + "/*") -and $_.Ucs -eq $Blade.Ucs -and $_.Type -eq "board-controller"} | Select-Object -ExpandProperty Version;
$HostFirmWarePolicy = $ServiceProfiles | ?{$_.dn -eq $Blade.AssignedToDn -and $_.Ucs -eq $Blade.Ucs} | Select-Object -ExpandProperty OperHostFwPolicyName;
$Blade.Ucs + "," + $Blade.dn + "," + $Blade.AssignedToDn + "," + $AdapterFirmVer + "," + $CimcFirmVer + "," + $BiosVer + "," + $BoardControllerVer + "," + $HostFirmWarePolicy;
}
Disconnect-Ucs;
Set-UcsPowerToolConfiguration -SupportMultipleDefaultUcs:$false > $null