PowerCLI

 View Only
Expand all | Collapse all

get service tag of ESX Server

  • 1.  get service tag of ESX Server

    Posted Jan 23, 2009 07:38 PM

    Hi,

    I was wondering, how can I get the service tag of remote ESX Server via powershell? Has anybody tried this?

    Thanks



  • 2.  RE: get service tag of ESX Server

    Posted Jan 23, 2009 08:43 PM

    Could this be what you are looking for ?

    (Get-VMHost <ESX-name> | Get-View).Summary.Hardware.OtherIdentifyingInfo[0].IdentifierValue
    



  • 3.  RE: get service tag of ESX Server

    Posted Jan 24, 2009 05:44 PM

    I tried, it gives me error message. I guess something to do with the syntax. Can you please have a look at it ?

    PS C:\&gt; (Get-VMHost 10.0.0.1 | Get-View).Summary.Hardware.OtherIdentifyingInfo[0].IdentifierValue

    Get-VMHost : 1/24/2009 12:43:23 PM Get-VMHost You are not currently connected to any servers. Please connect first usi

    ng Connect-VIServer or one of its aliases.

    At line:1 char:12

    + (Get-VMHost &lt;&lt;&lt;&lt; 10.0.0.1 | Get-View).Summary.Hardware.OtherIdentifyingInfo[0].IdentifierValue

    + CategoryInfo : ResourceUnavailable: (:smileyhappy: , ViServerConnectionException

    + FullyQualifiedErrorId : Core_BaseCmdlet_NotConnectedError,VMware.VimAutomation.Commands.GetVMHost



  • 4.  RE: get service tag of ESX Server

    Posted Jan 24, 2009 07:05 PM

    You should connect first.

    Connect-VIServer -Server  <VC-server> -User <user> -Password <passsword>
    

    If your current account has sufficient rights on the VC you can leave out the -User and -Password parameter.

    Or you can connect directly to an ESX server in a similar way.



  • 5.  RE: get service tag of ESX Server

    Posted Jan 26, 2009 02:37 PM

    I am sorry, can you please type the whole command. I am still learning this. I tried this command and it just connected to my virtual center server Connect-VIServer -Server 10.0.0.2.



  • 6.  RE: get service tag of ESX Server

    Posted Jan 26, 2009 02:45 PM

    Ok, here you go

    Connect-VIServer -Server  <VC-server> -User <user> -Password <passsword>
    (Get-VMHost <ESX-name> | Get-View).Summary.Hardware.OtherIdentifyingInfo[0].IdentifierValue
    

    You can execute these 2 lines, after each other, at the "VMware VI Toolkit (for Windows)" prompt.

    Or you can save them in a .ps1 file and then execute the script by doing

    .\<filename>.ps1
    

    from the "VMware VI Toolkit (for Windows)" prompt provided you are positioned in the directory where you saved the .ps1 file.



  • 7.  RE: get service tag of ESX Server

    Posted Aug 07, 2009 06:12 PM

    When I use your command, I get an error that the array is null. I can however, see the service tag in VC under Configuration | System - Service Tag.

    Any other cmdlets I can use?

    Thanks,

    Tim



  • 8.  RE: get service tag of ESX Server

    Posted Aug 07, 2009 06:53 PM

    All this info is vendor and hardware specific.

    Does the HostSystemInfo object contain a property with the Service Tag in there ?

    Try this

    (Get-VMHost <ESX-host> | Get-View).Hardware.SystemInfo
    



  • 9.  RE: get service tag of ESX Server

    Posted Aug 07, 2009 07:14 PM

    This is what I get:

    Vendor : Dell Inc.

    Model : PowerEdge 2950

    Uuid : 49954c4c-3810-1036-824e-b8c04d334b31

    OtherIdentifyingInfo :

    DynamicType :

    DynamicProperty :

    I don't see the Service Tag.



  • 10.  RE: get service tag of ESX Server

    Posted Aug 07, 2009 07:42 PM

    Could be that the VC uses CIM to get the Service Tag.

    Unfortunately I don't have a PowerEdge to look further.



  • 11.  RE: get service tag of ESX Server

    Posted Jul 31, 2011 01:56 PM

    @LucD: i need this Dell server's service tag info seriuosely. i need your help getting this done on mix of 200 ESXi & ESX 4.0 servers. can you do the needful?

    Br,

    Kris



  • 12.  RE: get service tag of ESX Server

    Posted Jul 31, 2011 06:09 PM

    Does the method described in Finding server tag on a Dell that is running VMWare ESX as host OS work for you ?

    If that doesn't work can you try the dmidecode command from an ESX console (see Find the service tag of a Dell server from the ESX console).

    In that case you can always use plink.exe to execute the dmidecode command and capture the output from a script.



  • 13.  RE: get service tag of ESX Server

    Posted Jul 31, 2011 06:57 PM

    Hi LucD,

    i'm very greatful to see your quicker response.

    ESXi versions are higher than the classic version. however the command "(Get-VMHost "fqdn" | Get-View).Summary.Hardware.OtherIdentifyingInfo[1].IdentifierValue" (used without quotes) from PowerCLI gives the blank output. i have tried with/without fqdn of the server after connecting to VC.

    i'm in vain?

    Br,

    Kris



  • 14.  RE: get service tag of ESX Server

    Posted Jul 31, 2011 08:42 PM


  • 15.  RE: get service tag of ESX Server

    Posted Aug 20, 2009 02:25 PM

    On a Dell PowerEdge, you can get the service tag with...

    Get-VMHost | Get-View | foreach {$_.Summary.Hardware.OtherIdentifyingInfo}

    ...or more specifically...

    (Get-VMHost | Get-View).Summary.Hardware.OtherIdentifyingInfo[1].IdentifierValue

    (These are after connecting with Connect-VIServer)



  • 16.  RE: get service tag of ESX Server

    Posted Aug 20, 2009 03:17 PM

    Brilliant!!! That was it. There are 7 hosts that it can't get the Service Tag from. Any ideas why? Whose particular hosts don't show a Service Tag in the VI Client either.

    Again, Thank you.

    Tim T



  • 17.  RE: get service tag of ESX Server

    Posted Aug 20, 2009 03:36 PM

    Do you get anything with...

    Get-VMHost | Get-View | foreach {$_.Summary.Hardware.OtherIdentifyingInfo}

    ...other than one element with "unknown" ?

    What model are the 7 that don't show up? I used this to retrieve service tags from two PowerEdge 2950's running ESXi 3.5. If there's nothing else accessible though (such as on a SuperMicro I'm running ESXi 4.0 on), it will just show a single element with IndentifierValue = unknown.



  • 18.  RE: get service tag of ESX Server

    Posted Mar 29, 2011 11:35 PM

    yes, I am using HP DL servers and the Bl server with ESX 4.0 but somehow I also couldn't get the result from that powershell command ?

    Get-VMHost : 30/03/2011 10:32:22 AM    Get-VMHost        VMHost with name 'SIESXP10' was not found, using the specified filter(s).   
    At C:\Temp\2e513be3-0124-40aa-a072-5e508ebd8ce9.ps1:1 char:12
    + (Get-VMHost <<<<  "SIESXP10" | Get-View).Summary.Hardware.OtherIdentifyingInfo[1].IdentifierValue
        + CategoryInfo          : ObjectNotFound: (:) [Get-VMHost], VimException
        + FullyQualifiedErrorId : Core_OutputHelper_WriteNotFoundError,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetVMHost
    Cannot index into a null array.
    At C:\Temp\2e513be3-0124-40aa-a072-5e508ebd8ce9.ps1:1 char:74
    + (Get-VMHost "SIESXP10" | Get-View).Summary.Hardware.OtherIdentifyingInfo[ <<<< 1].IdentifierValue
        + CategoryInfo          : InvalidOperation: (1:Int32) [], RuntimeException
        + FullyQualifiedErrorId : NullArray

    the server SIESXP10 can be ping from cmd prompt.



  • 19.  RE: get service tag of ESX Server

    Posted Mar 30, 2011 05:59 PM

    You probably have to specify the FQDN. Something like:

    (Get-VMHost "SIESXP10.yourdomain.com" | Get-View).Summary.Hardware.OtherIdentifyingInfo[1].IdentifierValue


    Regards, Robert