Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 176561

Error in deserializing body of reply message for operation 'RetrieveProperties' and Error in deserializing body of reply message for operation 'ReadPreviousEvents'

$
0
0

Hello everyone - i'm getting below errors while running script to get newly added VMs across multiple vCenters. Am i missing anything? please advise.

 

Errors:

 

Get-VIEvent : 8/13/2020 10:19:17 AM    Get-VIEvent        Error in deserializing body of reply message for operation 'RetrieveProperties'.   

At line:5 char:11

+ $events = Get-VIEvent -maxsamples 100000 -Start (Get-Date).AddDays(–1 ...

+           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Get-VIEvent], VimException

    + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetEvent

 

Get-VIEvent : 8/13/2020 10:19:24 AM    Get-VIEvent        Error in deserializing body of reply message for operation 'ReadPreviousEvents'.   

At line:5 char:11

+ $events = Get-VIEvent -maxsamples 100000 -Start (Get-Date).AddDays(–1 ...

+           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Get-VIEvent], VimException

    + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetEvent

 

Script:

 

Import-Module VMware.VimAutomation.Core

Connect-VIServer vCenter

$eventCollection = @()

 

$events = Get-VIEvent -maxsamples 100000 -Start (Get-Date).AddDays(–10) | where {$_.Gettype().Name-eq "VmCreatedEvent" -or $_.Gettype().Name-eq "VmBeingClonedEvent" -or $_.Gettype().Name-eq "VmBeingDeployedEvent" }

 

foreach ($event in $events)

{

$csvline = "" | Select EventTime, UserName, Datacenter, Cluster, Host, VM, Dvs, Description, vcenter

$csvline.EventTime = $event.CreatedTime

$csvline.UserName = $event.UserName

$csvline.Datacenter = $event.Datacenter.Name

$csvline.Cluster = $event.ComputeResource.Name

$csvline.Host = $event.Host.Name

$csvline.VM = $event.VM.Name

$csvline.Dvs = $event.Dvs.Name

$csvline.Description = $event.FullFormattedMessage

$csvline.vcenter = $event.VC.Name

$eventCollection += $csvline

}

$eventCollection | Export-csv -NoTypeInformation E:\output_file.csv

 

Thanks in advance.


Viewing all articles
Browse latest Browse all 176561

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>