Looking for script to find all computers that have Offline file folder syncs active
I'm looking for a way to use kace to pull data showing me all the computers on my domain that have offline file folders enabled. I want to disable this function but would like to know who is actively using offline file folders before simply cutting them off.
I know I can run the follwoing command to pull that information but not sure how to put that into a report form within Kace.
Get-WMIObject win32_OfflineFilesCache -ComputerName "computer"
Answers (4)
The easiest way would be using a Custom Inventory Rule (abbreviated as CIR, see here for an example: https://support.quest.com/kb/4262543 ) to have this in your inventory.
Every check in the device is running this CIR and adds it to the inventory.
Then you can use the reporting wizard where you can find a "new" field with the NAME of the CIR and can be reported.
Please be aware that the report will be empty when you created the CIR freshly and the report.
Only over time, when the devices check in, the field will be filled.
I've placed the following into the custom inventory rule section but I have yet to see any devices.
RegistryValueEquals(HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CSC, Start, 0x00000001)
RegistryValueEquals(HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CscService, Start, 0x00000001)
I set my reg vaues to 1 and forced an inventory several times, but no devices show up.
I can run this locally
C:\Windows>reg.exe query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CSC /v Start /t REG_DWORD
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CSC
Start REG_DWORD 0x1
Comments:
-
sorry to ask that (since I never worked with offline files since the 1990s)
Are both Registry settings needed? if yes, use the AND-Operator (and write both in one line) or is only one of them used, then use the OR-Operator (in one line) - Nico_K 7 months ago
I was able to achieve what I need with the following CIR
ShellCommandTextReturn(cmd /q /c powershell.exe -command "Get-WMIObject win32_OfflineFilesCache")
This will return the following
Active : False
Enabled : False
I then ran a report and filtered for the word "True", which showed me any machine with active and enabled offline file cache