VMware Cloud Community
dhanu2k7
Enthusiast
Enthusiast
Jump to solution

IMM Ip Address through PowerCLI

hello

I am exeucting following line from https://www.altaro.com/vmware/esxi-ilo-idrac-powercli/

Get-VMHostWSManInstance –Vmhost (Get-VMhost ESX01.tglab.lcl) –IgnoreCertFailures –Class OMC_IPMIIPProtocolEndpoint

but I am getting winrm error message

Get-WSManInstance : The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the

logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the

destination to analyze and configure the WinRM service: "winrm quickconfig".

At line:3 char:1

+ Get-WSManInstance -ConnectionURI ("https`://" + $h.Name + "/wsman") - ...

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

    + CategoryInfo          : InvalidOperation: (:) [Get-WSManInstance], COMException

    + FullyQualifiedErrorId : Exception,Microsoft.WSMan.Management.GetWSManInstanceCommand

i can able to see wsman is enabled and service is started in esxi what could be issue? 

Tags (1)
Reply
0 Kudos
1 Solution

Accepted Solutions
dhanu2k7
Enthusiast
Enthusiast
Jump to solution

Finally I found its bug in 6.7 u3

I  have 6.7 u3 environment and 6.5 Enviorment( we have lenovo/dell/Hp)

When I run wsman connection from powerCLI its getting connected successfully for 6.5 environment irrespective of any hardware vendor

but when I run wsman connection against to 6.7 its always failing, I guess something is changed in 6.7.

View solution in original post

Reply
0 Kudos
15 Replies
LucD
Leadership
Leadership
Jump to solution

What does a Test-NetConnection say?

Test-NetConnection -ComputerName <your-esx-node> -Port 443


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
dhanu2k7
Enthusiast
Enthusiast
Jump to solution

RemotePort             : 443

InterfaceAlias         :

SourceAddress          :

PingSucceeded          : True

PingReplyDetails (RTT) : 0 ms

TcpTestSucceeded       : True

no issue for 443 port, I am thinking something realted to basic authentication ?

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Could be, try adding the Verbose switch on the Get-WSManInstance cmdlet.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
dhanu2k7
Enthusiast
Enthusiast
Jump to solution

below is verbose log not much useful, I am getting two error message, when I run locally I can get remote IP and wbem and wsman all are running fine at esxi level. is this something to do with any ?pam authentication ? any bug in 6.7?

VERBOSE: 11/4/2020 12:46:22 PM Get-View Finished execution

Get-WSManInstance : The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation
for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM
service: "winrm quickconfig". get-vmhostwsinstance.ps1:44 char:9
+         Get-WSManInstance -Authentication basic -ConnectionURI $uri - ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Get-WSManInstance], COMException
    + FullyQualifiedErrorId : Exception,Microsoft.WSMan.Management.GetWSManInstanceCommand

Get-WSManInstance : <f:WSManFault xmlns:f="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault" Code="2150858770" Machine="xxxxxxxxxxxx.iom.schneider-electric.com"><f:Message>The client cannot connect to
the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the
destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig".
</f:Message></f:WSManFault>
ript\get-vmhostwsinstance.ps1:44 char:9
+         Get-WSManInstance -Authentication basic -ConnectionURI $uri - ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (http://schema.o...rotocolEndpoint:Uri) [Get-WSManInstance], InvalidOperationException
    + FullyQualifiedErrorId : WsManError,Microsoft.WSMan.Management.GetWSManInstanceCommand

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

I was able to get the same errors you are getting when I stop and disable the CIM service.

To fix it, I did the following

- connect to the ESXi node

Connect-VIServer -Server <esx-name>

- enable the CIM service

$esxcli = Get-EsxCli -VMHost <esx-name> -V2

$esxcli.system.wbem.set.invoke(@{enable=$true})

- start the CIM service

Get-VMHostService -VMHost <esx-name> |

where{$_.Key -eq 'sfcbd-watchdog'} |

Start-VMHostService -Confirm:$false


After that, I was able to call the function. For example

Get-VMHostWSManInstance -VMHost (Get-VMHost -Name homelab*) -class OMC_Card -ignoreCertFailures


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
dhanu2k7
Enthusiast
Enthusiast
Jump to solution

unfortunately I am facing same error with your same code,  as told before wbem and sfcbd-watchdog enabled and restarted

I desperately looking for solution because I cannot find anywhere solution to my question, please help

any special winrm configuration require to connect Esxi?

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

When you go to the Web Client, select the ESXi node, and then look at Monitor - Hardware Health, do you see information in there?

Btw, which vSphere/ESXi version are you running?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
dhanu2k7
Enthusiast
Enthusiast
Jump to solution

Yes I can able to see sensor health checks

esxi version 6.7 u3

I guess something related to basic authentication or winrm configuration but could not able to idenfity what could abe the issue

here is my winrm configuration

Config
    MaxEnvelopeSizekb = 500
    MaxTimeoutms = 60000
    MaxBatchItems = 32000
    MaxProviderRequests = 4294967295
    Client
        NetworkDelayms = 5000
        URLPrefix = wsman
        AllowUnencrypted = true
        Auth
            Basic = true
            Digest = true
            Kerberos = true
            Negotiate = true
            Certificate = true
            CredSSP = false
        DefaultPorts
            HTTP = 5985
            HTTPS = 5986
        TrustedHosts = *
    Service
        RootSDDL =xxxxxxx
        MaxConcurrentOperations = 4294967295
        MaxConcurrentOperationsPerUser = 1500
        EnumerationTimeoutms = 240000
        MaxConnections = 300
        MaxPacketRetrievalTimeSeconds = 120
        AllowUnencrypted = true
        Auth
            Basic = true
            Kerberos = true
            Negotiate = true
            Certificate = false
            CredSSP = false
            CbtHardeningLevel = Relaxed
        DefaultPorts
            HTTP = 5985
            HTTPS = 5986
        IPv4Filter = *
        IPv6Filter = *
        EnableCompatibilityHttpListener = false
        EnableCompatibilityHttpsListener = false
        CertificateThumbprint
        AllowRemoteAccess = true
    Winrs
        AllowRemoteShellAccess = true
        IdleTimeout = 7200000
        MaxConcurrentUsers = 2147483647
        MaxShellRunTime = 2147483647
        MaxProcessesPerShell = 2147483647
        MaxMemoryPerShellMB = 2147483647
        MaxShellsPerUser = 2147483647

C:\Windows\System32>

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

I'm afraid I'm out of ideas.
Perhaps you should ask on the site where you got the script from.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
dhanu2k7
Enthusiast
Enthusiast
Jump to solution

Do you have any script to get remote IMM ip address using wsman?

Reply
0 Kudos
dhanu2k7
Enthusiast
Enthusiast
Jump to solution

LucD

I created https listerner but now I am getting different error message acces denied, I guess you mentioned one of the site "\" causing issue but didn't understand how to eliminiate this access denied problem

Get-WSManInstance : Access is denied.

At line:1 char:17

+ ...             Get-WSManInstance -Authentication basic -ConnectionURI $u ...

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

    + CategoryInfo          : InvalidOperation: (:) [Get-WSManInstance], UnauthorizedAccessException

    + FullyQualifiedErrorId : Exception,Microsoft.WSMan.Management.GetWSManInstanceCommand

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

What post are you referring to?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
dhanu2k7
Enthusiast
Enthusiast
Jump to solution

Finally I found its bug in 6.7 u3

I  have 6.7 u3 environment and 6.5 Enviorment( we have lenovo/dell/Hp)

When I run wsman connection from powerCLI its getting connected successfully for 6.5 environment irrespective of any hardware vendor

but when I run wsman connection against to 6.7 its always failing, I guess something is changed in 6.7.

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

It might be the same as this problem OMIVV 5 not connecting to ESXi 6.7 U3 - Dell Community


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
dhanu2k7
Enthusiast
Enthusiast
Jump to solution

exactly I was reading same document, but replaced dell customised VIB from dell but I have Lenovo but issue with VMware they have to replace some VIB's

Reply
0 Kudos