none
Verify Offline Availability on a network share RRS feed

  • Question

  • Currently I have an application hosted in SCCM, that creates a symbolic link and sets offline availability via script post installation.

    I'm using a the following code in order to establish the offline availability:

            $o = New-Object -ComObject Shell.Application
            $o.Namespace("\\hspfp1\HTE$").self.verbs() |
                Where-Object {$_.Name -eq "Always &available offline"} |
                ForEach-Object {$_.DoIt()}
            }

    The issue is that is this code is executed twice, the offline availability is disabled.  I'm seeking a way to confirm the offline availability is set.  This was we can right a CI that if the application is stilled and offline availability is not set to execute again.  I've tried playing around with the wmi offlinefiles class without success.  Any assistance with this process would be great.  If any additional information is needed please let me know.

    • Moved by Bill_Stewart Tuesday, December 11, 2018 8:36 PM Not a scripting question
    Monday, April 2, 2018 12:43 PM

All replies

  • What does this mean: "was we can right a CI that if the application is stilled "

    What is a CI and what is "right a CI"? DO you mean right-click? The language is very odd and confusing.


    \_(ツ)_/

    Monday, April 2, 2018 1:10 PM
  •  $o = New-Object -ComObject Shell.Application
    $o.Namespace('\\hspfp1\HTE$').Self.InvokeVerb('Always available offline')

    When invoking remove the "&" from the string.


    \_(ツ)_/


    • Edited by jrv Monday, April 2, 2018 1:28 PM
    Monday, April 2, 2018 1:27 PM
  • The easiest way to check and set offline availability is with Get/Set-SmbShare

    get-smbshare | select Name, CachingMode

    Set-SmbShare -Name <sharename> -CachingMode [Programs|Manual|Documents]


    \_(ツ)_/

    Monday, April 2, 2018 2:53 PM
  • Configuration Item, looking for a way SCCM can ensure the offline availability is set.
    Monday, April 2, 2018 4:42 PM
  • Sorry to ask a stupid question, but I have PSVersion 5.1 installed and "get-smbshare" is not a recognized cmdlet. Am I missing something to ensure the SMBshare cmdlets are available?

    Edit*
    Looks like that cmdlet if available for Win 10 and Server 2016.  The systems that the offline availability needs to be check on is Win 7
    • Edited by ChrisCBJ Monday, April 2, 2018 5:06 PM
    Monday, April 2, 2018 4:43 PM
  • You need to ask your question in the SCCM forum.


    \_(ツ)_/

    Monday, April 2, 2018 4:43 PM
  • Sorry to ask a stupid question, but I have PSVersion 5.1 installed and "get-smbshare" is not a recognized cmdlet. Am I missing something to ensure the SMBshare cmdlets are available?

    That is only available on Windows 10 and later.


    \_(ツ)_/

    Monday, April 2, 2018 4:44 PM
  • Are you aware of any similar solution for the Win 7 OS?
    Monday, April 2, 2018 8:57 PM
  • No.  You can use the API in compiled code.


    \_(ツ)_/

    Monday, April 2, 2018 9:02 PM