Skip to main content

Folder Share - Create or Remove

Summary

This script is built to create or remove shared folders on the target device.

Time Saved by Automation: 5 Minutes

Sample Run

Target: Windows Device

Please see the user parameters section below for additional information!

Sample Run

Dependencies

None

Variables

  • @PSOUT@ - Used to store results from the first Execute Script function and compare the results in the script.
  • @path@ - The path to the folder that needs to be shared.
  • @share@ - The name of the share.

Global Parameters

NameExampleRequiredDescription
ScriptEngineEnableLogger1FalseSetting this variable to 1 will provide improved logging while the script is running.

User Parameters

NameExampleRequiredDescription
PathC:/Labtech/TrueWhat the parameter represents. Please ensure there is a closing backslash like the example! This is required.
User"Domain/Username", "Username"TrueAlways wrap the username in double quotes: "username". If the user is a domain user, please include the domain name before the username. This list can be a comma-separated list with a comma and space between the users. See example.
Share//MachineName/ShareTrueThe name for the folder share.
RemoveShare1FalseIf left blank, this script will create the shared folder. If set to 1, the script will attempt to remove the share.
Permission1True1=Full Control, 2=Read and Change Access, 3=Read Only, 4=No Access.

Process

The script will execute a PowerShell script, passing the above parameters. The script will then check the output of the PowerShell script to determine if the process was successful or failed. On failures, the script will exit with appropriate error messages indicating what caused the failure.

Output

Script log messages.