Windows File Sync

Comments

3 comments

  • Mike Kercher

    Import-Module ActiveDirectory


    Function OfflineFilesStatus {

    $Computers = Get-ADComputer -Filter 'Operatingsystem -Notlike "*server*" -and enabled -eq "true"' -Properties dnshostname|Select dnshostname -ExpandProperty dnshostname

    Foreach ($Computer in $Computers)
    {Get-WMIObject win32_OfflineFilesCache -ComputerName $Computer|
    Select @{n="Computer";e={$Computer}}, @{n="Enabled";e={$_.Enabled}}, @{n="Active";e={$_.Active}}
        }
    }
     
    $report = OfflineFilesStatus|Sort-Object Computer
    $report|Export-CSV C:\Temp\OfflineFilesStatusReport.csv -NoTypeInformation

    0
    Comment actions Permalink
  • Emily Dullum

    This is the error message I am getting when I run that on a test machine:

    The specified module 'ActiveDirectory' was not loaded because no valid module file was found in any module directory.
       At line:1 char:1

    0
    Comment actions Permalink
  • Emily Dullum

    I figured a way to do this with a registry scan, report and then dynamic computer group.  If Offline File Sync is enabled, then the following registry key will be set to a value of 1:

    LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CSC\Start

    0
    Comment actions Permalink

Please sign in to leave a comment.