VMware Cloud Community
tdubb123
Expert
Expert
Jump to solution

$esxcli

any idea how I can run this from powercli?

# esxcli hardware ipmi sel clear            ;  clear the IPMI SEL logs prior to restart WBEM service.

# esxcli system wbem set -e 0               ;   disable wbem service

# esxcli system wbem set -e 1               ;  enable wbem service

# /etc/init.d/sfcbd-watchdog restart 

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

In that case you don't need to pass anything, just call without a parameter

$esxcli.hardware.ipmi.sel.clear.Invoke()


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

View solution in original post

5 Replies
LucD
Leadership
Leadership
Jump to solution

Yes, use the Get-EsxCli cmdlet. See also PowerCLI 6.3 R1: Get-ESXCLI Why the V2?

PS: do you ever get back or reply to threads you launch?


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

0 Kudos
tdubb123
Expert
Expert
Jump to solution

I am stuck on one line

$esxcli = get-esxcli -vmhost $vmhost -V2

$esxcli.hardware.ipmi.sel.clear <-----

$esxcli.system.wbem.get.invoke()

$esxcli.system.wbem.set.createArgs()

$esxcli.system.wbem.set.Invoke(@{enable=$false})

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

everything else is working

Thanks. I will close out the other threads

Thanks

0 Kudos
LucD
Leadership
Leadership
Jump to solution

That should be

$arg = $esxcli.hardware.ipmi.sel.clear.CreateArgs()

# Set your values in $arg


$esxcli.hardware.ipmi.sel.clear.Invoke($arg)


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

0 Kudos
tdubb123
Expert
Expert
Jump to solution

what should $args be?  I just need to clear the sel log

0 Kudos
LucD
Leadership
Leadership
Jump to solution

In that case you don't need to pass anything, just call without a parameter

$esxcli.hardware.ipmi.sel.clear.Invoke()


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