?
Solved

Windows 7 Offline files - "Work online" programmatically

Posted on 2012-09-12
3
Medium Priority
?
2,936 Views
Last Modified: 2012-09-14
Hi,

Windows 7, using redirection folders that are made automatically available offline.
Our redirected folders are always offline (and they are keeped in sync with the server with the Windows Background Sync every 60 minutes).

For some reason (errors 502 - Access denied in event log, CSC cache locked by other user), I must put the redirected folders in an Online State, before login off.
Via the GUI, I click my redirected folders (for example Desktop or Documents) and I select "Work Online". This works well.

I want to use that in an logout-script (using VBS or Powershell).
I have tried using the informations described in the Workaround section of this Microsoft KB : http://support.microsoft.com/kb/2610379/en-us with no success.
I received no errors, but in the GUI, the "Work Online" has not changed to "Work Offline" : why ?

I have also tried with Powershell using the code :

$oWMI = [wmiclass]"\\localhost\root\cimv2:win32_offlinefilescache"
$oWMI.TransitionOnline("\\myDFS\myShare")

Open in new window

The following is returned :
__GENUS          : 2
__CLASS          : __PARAMETERS
__SUPERCLASS     :
__DYNASTY        : __PARAMETERS
__RELPATH        :
__PROPERTY_COUNT : 1
__DERIVATION     : {}
__SERVER         :
__NAMESPACE      :
__PATH           :
ReturnValue      : 0

Open in new window

... but again, I still have the “Work Online” button.

Is there any way to make the folder working online programatically ?

Thanks

OS version : Windows 7 Enterprise SP1 (x64)
PowerShell  version: v.1.0 (built-in with W7)
0
Comment
Question by:st-in
1 Comment
 

Accepted Solution

by:
st-in earned 0 total points
ID: 38399076
Problem solved. I was not using the correct path for TransitionOnline("\\myDFS\myShare"). The script is working.
0

Featured Post

Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Compliance and data security require steps be taken to prevent unauthorized users from copying data.  Here's one method to prevent data theft via USB drives (and writable optical media).
Microsoft Office 365 is a subscriptions based service which includes services like Exchange Online and Skype for business Online. These services integrate with Microsoft's online version of Active Directory called Azure Active Directory.
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question