dn007
Enthusiast
Enthusiast

to get list of machines without vmware log enabled

Jump to solution

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.

0 Kudos
1 Solution

Accepted Solutions
dn007
Enthusiast
Enthusiast

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>

View solution in original post

0 Kudos
3 Replies
Tibmeister
Expert
Expert

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.

0 Kudos
Ajay1988
VMware Employee
VMware Employee

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/

 

If you think your queries have been answered
Mark this response as "Correct" or "Helpful".

Regards,
AJ
0 Kudos
dn007
Enthusiast
Enthusiast

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>

0 Kudos