PowerCLI

 View Only
  • 1.  Baseboard Management Controller info

    Posted Mar 18, 2015 08:45 AM

    Hi, I'm wanting to include the IP address of the iLO/Management Controller for an ESX host in a report, this information is available in vCenter, on the hardware status tab of the host, under Baseboard Management Controller. 

    I can't seem to find a way of retrieving that information using powercli.  Can anyone advise if this is possible and if so, how?   Cheers.



  • 2.  RE: Baseboard Management Controller info
    Best Answer

    Posted Mar 18, 2015 11:31 AM

    Does 3.  Re: Hardware sensors work for you ?



  • 3.  RE: Baseboard Management Controller info

    Posted Mar 18, 2015 04:07 PM

    Hi LucD, cheers for the reply.  I saw that script when I was initially searching for an answer and disregarded it as I thought it was connecting to the iLO IP which would defeat the object for me, but I can see now that's not the case.  I've given it a quick try and I get an error stating 'Basic Authentication is currently disabled in the client configuration', I'll look into it further tomorrow when I have some time and hopefully sort it out.  thanks.



  • 4.  RE: Baseboard Management Controller info

    Posted Mar 20, 2015 01:29 PM

    I've also written a generic function that is compatible with Powershell v2 as well you can use to query specific CIM information, such as IPMI/BMC details:

    https://github.com/alpacacode/Homebrewn-Scripts/blob/master/vmware-scripts/Get-CIMProperties.ps1

    For example, to just get the IP of the ESXi host BMC:

    (Get-CIMProperties -Target myesxihost.local -Username root | ? {$_.NAME -eq 'IPv4Address'}).Value



  • 5.  RE: Baseboard Management Controller info

    Posted Mar 20, 2015 02:05 PM

    Hi MKGuy, thanks for the suggestion however I've managed to get this working late yesterday.  I'm using the code that LucD provided but rather than supplying a username/password for the connection I'm using the AcquireCimServicesTicket method when connected to vcenter to authenticate the session.  It seems to work quite well and I can trawl through the ESX hosts connected to the VC quite easily.  It just means now that anyone running the script needs to be using powershell v3, but that's not too big a deal.

    Thanks LucD for the link!



  • 6.  RE: Baseboard Management Controller info

    Posted Mar 23, 2015 06:20 AM

    Hi Dawson,

    Could you please post the code you have modified for getting ILO IP by using AcquireCimServices Ticket Method .



  • 7.  RE: Baseboard Management Controller info

    Posted Mar 24, 2015 02:22 PM

    Sure, here you go.

    $h = Get-VMHost "HOST_NAME"

    $hv = $h | Get-View

    $CIMServicesTicket = $hv.AcquireCimServicesTicket()

    $Password = ConvertTo-SecureString $CIMServicesTicket.SessionId -AsPlainText -Force

    $Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $CIMServicesTicket.SessionId, $Password

    $CIOpt = New-CimSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck -Encoding Utf8 -UseSsl

    $Session = New-CimSession -Authentication Basic -Credential $Credential -ComputerName $hv.name -port 443 -SessionOption $CIOpt

    $ILO = Get-CimInstance -CimSession $Session -ClassName CIM_ServiceAccessPoint | Where {$_.SystemName -match "Management"}



  • 8.  RE: Baseboard Management Controller info

    Posted Mar 25, 2015 06:03 AM

    Hi Dawson,

    Thanks for posting the script,

    Still I am getting basic authentication error. Please find the error below.

    New-CimSession : The WinRM client cannot process the request. Basic

    authentication is currently disabled in the client configuration. Change the

    client configuration and try the request again.

    At line:1 char:12

    + $Session = New-CimSession -Authentication Basic -Credential $Credential

    -Compute ...

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ~~~

        + CategoryInfo          : NotEnabled: (:) [New-CimSession], CimException

        + FullyQualifiedErrorId : HRESULT 0x803380df,Microsoft.Management.Infrastr

       ucture.CimCmdlets.NewCimSessionCommand

        + PSComputerName        : ESXihost1.domain.com



  • 9.  RE: Baseboard Management Controller info

    Posted Mar 25, 2015 07:53 AM

    Hi, I ran into this problem but it turned out to be the Windows Remote Management service wasn't started on my client.  Once started you can run the command winrm get winrm/config to see if client\auth\basic is enabled or not.  If disabled you'll need to enable it, a quick google search should get you the command for this.



  • 10.  RE: Baseboard Management Controller info

    Posted Mar 25, 2015 10:55 AM

    I got it now, Thanks for your support.