Modifying Shares
There are three items that can be modified on a share: the maximum number of allowed users, the description, and the security settings. Two of these settings are very easy to modify: description and maximum allowed users. Modifying the security setting is a bit more of a challenge.
In the SetShareInfo.ps1 script, you create four variables that are used to hold information for the script. The first, $shareName, holds the name of the share that will be modified. Because WMI expects the name of the share to be enclosed in single quotes, include them here inside the double quotes. The next variable that is created is $wmiClass, which is used to hold the name of the WMI class to query. Since you are working with the Win32_Share class, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access