Quantcast
Channel: VMware Communities : Discussion List - Automation Tools
Viewing all articles
Browse latest Browse all 9071

How to get Task and Events on Datastore, Through Powercli ?

$
0
0

I was trying the below, but it trowed and error.

 

$datas = Get-Cluster -Name "xxxx" | Get-Datastore

foreach($ds in $datas){

    $dview = $ds | Get-View

    Get-VIEvent -Entity $dview |  ? {$_.FullFormattedMessage -match "Lost Access"}

}

 

 

 

Get-VIEvent : 10/17/2016 10:25:04 AM    Get-VIEvent        Events can be retrieved only for inventory objects. The entity of type 'VMware.VimAutomation.ViCore.Impl.V1.DatastoreManagement.VmfsDatastoreImpl' will be ignored.   

At line:1 char:1

+ Get-VIEvent -Entity $ds

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

    + CategoryInfo          : InvalidArgument: (:) [Get-VIEvent], InvalidArgument

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


Viewing all articles
Browse latest Browse all 9071

Trending Articles



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