0

There is a class in WMI ROOT\CIMV2 named Win32_OfflineFilesHealth with property LastSuccessfulSyncTime. But the class is having no instances even if I have Offline files enabled and I'm using it.

What I'm doing wrong? Is there any other way to get date of last successful synchronization of my offline files in machine way?

1 Answers1

2

Start Event Viewer and go to Applications and services logs > Microsoft > Windows > Offline files. Then go to the View menu and choose Show analytic and debug logs which will give you some more logs than just the operational log (which is to no use to us by default). In the SyncLog log it will list for instance event ID 2006 whenever a failure occurs in the sync process.

or powershell

param($computer=”localhost”, $help)

function funline ($strIN)
{
 $num = $strIN.length
 for($i=1 ; $i -le $num ; $i++)
  { $funline += “=” }
    Write-Host -ForegroundColor yellow $strIN 
    Write-Host -ForegroundColor darkYellow $funline
}
function funHelp()
{
$helpText=@”
DESCRIPTION:
NAME: GetOffLineFiles.ps1 
Prints the offline files config on a local or remote machine.
PARAMETERS: 
-computer Specifies name of the computer upon which to run the script
-help     prints help file
SYNTAX:
GetOffLineFiles.ps1 -computer MunichServer
Lists offline files config on a computer named MunichServer
GetOffLineFiles.ps1 
Lists offline files config on local computer
GetOffLineFiles.ps1 -help ?
Displays the help topic for the script
“@
$helpText
exit
}
if($help){ funline(“Obtaining help …”) ; funhelp }
$outtxt = Get-WmiObject -Class win32_OfflineFilesCache `
        -computername $computer 
funline(“Offline files configuration $env:computername”)
format-table -Property active, enabled,location -autosize `
       -inputobject $outtxt
Ace
  • 419
  • 6