any idea to script to run emcgrab.exe across multiple esxi using powershell.
the option to be used as below.
emcgrab.exe -host XXXXX(hostname) -user root -password XXXX -vmsupport -party XXX -customer XXX -case XXX -contact XXX -phone XXXX -email XXXX
Then you can do something like this.
It assumes there is 1 hostname per line, no blank lines.
$user = 'root'
$pswd = 'XXXX'
Get-Content -Path hostnames.txt | %{
emcgrab.exe -host $_ -user $user -password $pswd -vmsupport -party XXX -customer XXX -case XXX -contact XXX -phone XXXX -email XXXX
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You mean like this?
It assumes you are connected to the vCenter (Connect-VIServer).
$user = 'root'
$pswd = 'XXXX'
Get-VMHost | %{
emcgrab.exe -host $_.NetworkInfo.HostName -user $user -password $pswd -vmsupport -party XXX -customer XXX -case XXX -contact XXX -phone XXXX -email XXXX
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks for quick help.
similar to that but not connected to vcenter, list of host in a text file and loaded from there.
Then you can do something like this.
It assumes there is 1 hostname per line, no blank lines.
$user = 'root'
$pswd = 'XXXX'
Get-Content -Path hostnames.txt | %{
emcgrab.exe -host $_ -user $user -password $pswd -vmsupport -party XXX -customer XXX -case XXX -contact XXX -phone XXXX -email XXXX
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks Lucd, works perfectly!!!
LucD, Thank you Very much for the script , Its working like champ but its asking Yes and no for Legal agreement and for service request number for every host.
Please help me on this.
I don't know this emcgrab.exe, but with the help of Google, it looks as if there a number of parameters you can use to make it run silent.
Try adding the -quiet and -autoexec parameters.
If these don't work, check if the list of parameters includes those two.
You should be able to do that by adding the -h parameter.
But like I said, I don't know this command, nor do I have a copy to try it out.
Worst case, ask on one of the EMC fora.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi ,
I hope below link will help you understand this
EMC Community Network - DECN: EMC Grabs for ESXi
ftp://ftp.emc.com/pub/emcgrab/ESXi/Readme_ESXiGrab_v1.3.7.txt
Thank you Very Much RAJ and LucD
Its working now and I missed 2 switch for EMCGRAB