Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 8583

Unexpected Results using WMI to query Offline Files

$
0
0

I'm try to list offline files on a remote computer running Windows 7 x64.

If I execute the following command locally, I get expected results -- namely, a list of all the items in the local files cache.

$out = Get-Wmiobject -namespace root\cimv2 -Class Win32_OfflineFilesItem

foreach ($i in $out)

{format-table -Property ItemPath -autosize -inputobject $i }

results:

\\remotepc1\usershare\myfolder\document1.doc

\\remotepc1\usershare\myfolder\document2.doc

etc...

When I execute it remotely, adding computername, I get back a single item and the ItemPath contains only the server name -- or the root of the path.

$out = Get-Wmiobject -namespace root\cimv2 -Class Win32_OfflineFilesItem -computername remotepc1

foreach ($i in $out)

{format-table -Property ItemPath -autosize -inputobject $i }

results:

results:

\\remotepc1

 

My account is a domain admin and I've tried it with different credentials, but can't get it to work.  It doesn't throw an error.

Any ideas ?

Thank you.


Viewing all articles
Browse latest Browse all 8583

Trending Articles