Automation

 View Only
  • 1.  to get list of machines without vmware log enabled

    Posted Nov 07, 2021 12:00 AM

    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.



  • 2.  RE: to get list of machines without vmware log enabled

    Posted Nov 08, 2021 09:37 PM

    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.



  • 3.  RE: to get list of machines without vmware log enabled



  • 4.  RE: to get list of machines without vmware log enabled
    Best Answer

    Posted Nov 10, 2021 04:35 PM

    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>