Thanks, that seems to be the kind of thing im after. Strange however. Im connected to 60 or so hosts however only 27 seem to populate the output file. It does work as it should. However I get a bunch of errors like this in the console. Any ideas? The machines mentioned I can log onto fine with the Vsphere client and in addition the CLI tells me I'm connected to 60.....Thanks very much for your help.
Get-Datastore : 28.2.2013 20:39:49 Get-Datastore Server 192.X.X.X n
ot connected.
At line:1 char:14
+ get-datastore <<<< | Export-Csv "c:\dsreport.csv"
+ CategoryInfo : InvalidArgument: (:) [Get-Datastore], ViServerCo
nnectionException
+ FullyQualifiedErrorId : Client20_ConnectivityServiceImpl_TryVerifyIsConn
ected_NotConnected,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetDatasto
re