Hi All,
I'm newbie to powercli.I'm started learning things which I can automate in my environment.I need to pull the OS, Version(2008,2012), edition(std,ent) ,Type of Database(MS,Mysql), DB version and DB edition(std,ent).
I'm seen script from Alan's blog(http://www.virtu-al.net/2009/10/12/powercli-more-hal-information/) which solve my first part of my question, but how about the database.
and one question while exporting the script to csv,i often see usage of "-NoTypeInformation",May I know why we are using it?
Thanks in Advance.
The NoTypeInformation switch on the Export-Csv cmdlet avoids that the CSV has a #type line at the start.
To query what database SW is installed inside the guest OS, you will have to retrieve the info from inside the guest OS.
There a few ways to do that:
1) Use the WMI interface remotely
Get-WmiObject -Class Win32_Product -ComputerName MyStation
2) Run a script inside the guest OS (requires VMware Tools) if remote WMI is not allowed
$cmd = 'Get-WmiObject -Class Win32_Product'
$vm = Get-VM -Name MyStation
Invoke-VMScript -ScriptText $cmd -ScriptType Powershell -VM $vm
In both case, you will get a list of the installed SW, and you will have to scan through the list to determine what is installed.
There are of course other options available, it all depends on how you can access the guest OS.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
The NoTypeInformation switch on the Export-Csv cmdlet avoids that the CSV has a #type line at the start.
To query what database SW is installed inside the guest OS, you will have to retrieve the info from inside the guest OS.
There a few ways to do that:
1) Use the WMI interface remotely
Get-WmiObject -Class Win32_Product -ComputerName MyStation
2) Run a script inside the guest OS (requires VMware Tools) if remote WMI is not allowed
$cmd = 'Get-WmiObject -Class Win32_Product'
$vm = Get-VM -Name MyStation
Invoke-VMScript -ScriptText $cmd -ScriptType Powershell -VM $vm
In both case, you will get a list of the installed SW, and you will have to scan through the list to determine what is installed.
There are of course other options available, it all depends on how you can access the guest OS.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference