VMware Cloud Community
khaliqamar
Enthusiast
Enthusiast
Jump to solution

search in TASK

Hello,

I have deployed few hundreds  VMs but a large number of VMs did not succeed it sysprep and even did not failed sysprep but it is started.

Is it possible to write a script which can find shown below entries from (TASK & Event ) Events of the virtual machines.

Customization of VM <VM NAME>  succeeded. Customization log located at C:\Windows\TEMP\vmware-imc\guestcust.log in the guest OS.

Thanks in advance

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Try something like this

$entity = Get-VM
$start = (Get-Date).AddDays(-31)
Get-VIEvent -Entity $entity -Start $start |
where {$_ -is [VMware.Vim.CustomizationSucceeded]} |
Select CreatedTime,@{N="VM";E={$_.Vm.Name}},FullFormattedMessage,logLocation

It will return the entries for the last 31 days


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

Try something like this

$entity = Get-VM
$start = (Get-Date).AddDays(-31)
Get-VIEvent -Entity $entity -Start $start |
where {$_ -is [VMware.Vim.CustomizationSucceeded]} |
Select CreatedTime,@{N="VM";E={$_.Vm.Name}},FullFormattedMessage,logLocation

It will return the entries for the last 31 days


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
khaliqamar
Enthusiast
Enthusiast
Jump to solution

Thank you LucD

0 Kudos