I am trying to fix my script below to pin an offline folder. I don 't get any errors, but it does not pin the folder. Can anyone please point me in the right direction for why this isn't working?
Dim strComputer, objWMIService, colItems, objItem
Const OffLineFilesPinControlFlagFill = &H00000001
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,authenticationLevel=Pkt}!\\" _
& strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery _
("SELECT * FROM Win32_OfflineFilesCache")
For Each objItem In colItems
objItem.Pin Array("\\SERVER1\SHARE"), OffLineFilesPinControlFlagFill, True
Next