Automation

 View Only
  • 1.  Capture task of Set-VMhostNetworkAdapter

    Posted Feb 18, 2021 09:47 PM

    I need to capture the status of several network changes to a csv. I have a function that gets the task Id, state, and event chain to log what is changed. For commands like Set-VDPortgroup and Set-NetworkAdapter, I am running them with the -RunAsync flag to capture their task. Unfortunately, there is no -RunAsync flag for Set-VMHostNetworkAdapter, so I cannot capture the task. 

    Is there an easier way to capture this information than parsing through all of the events for a host to find the right one? Seems messy.. 



  • 2.  RE: Capture task of Set-VMhostNetworkAdapter

    Posted Feb 19, 2021 06:14 AM

    I'm afraid not.

    You can fine-tune (filter) the collection of the events by using the event collector via the API.
    Like I did in my Get-VIEventPlus function in Get the vMotion/svMotion history