HI,
we have enabled vmware logs in our environment. But there may be some outliers which were skipped. We would like to know if there is any script to get a list of all VMs where vmware log is not enabled. So, that we can we can enabled those as well.
Thank you.
Thank you guys,
I was able to write something to get a list which had logging enabled and then compared it with all the VMs to get the delta list having without logging. I know this may not be an efficient way but it gets the work done 🙂
Connect-VIServer -Force -Protocol https -Server <servername> -User <username> -Password <password>
Get-VM |
Where {$_.ExtensionData.Config.Flags.enableLogging} |
Select Name, @{N="Logging Enabled";E={$_.ExtensionData.Config.Flags.enableLogging}} |
Export-Csv C:\Temp\report.csv -NoTypeInformation -UseCulture
Disconnect-VIServer -Force -Server <servername>
Have you tried to use the Code Capture feature of the vSphere Client? It may help to point you in the direction to determine what properties of the VM you need to look at. You would need to make a change to the logging of a VM in order to see what property is being changed, but test VM's are easy to create.
May be this will help .
https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Script-to-disable-VM-logging/td-p/2570...
https://www.lucd.info/2011/02/27/virtual-machine-logging/
Thank you guys,
I was able to write something to get a list which had logging enabled and then compared it with all the VMs to get the delta list having without logging. I know this may not be an efficient way but it gets the work done 🙂
Connect-VIServer -Force -Protocol https -Server <servername> -User <username> -Password <password>
Get-VM |
Where {$_.ExtensionData.Config.Flags.enableLogging} |
Select Name, @{N="Logging Enabled";E={$_.ExtensionData.Config.Flags.enableLogging}} |
Export-Csv C:\Temp\report.csv -NoTypeInformation -UseCulture
Disconnect-VIServer -Force -Server <servername>