Surprise, it's me again! Today I have finished network share management module for PowerShell. I want to thank Shay Levy who helped me with module-related stuff.
With this module you will be able to:
- List share (or shares) from local or from remote computers;
- Create new share with various settings;
- Remove share (actually this not remove folder itself, but stops sharing);
- Add/Set/Remove share permissions (note that share permissions and NTFS rights are not the same).
Here are module installation instructions:
The ZIP file contains the module files only and you need to extract its content to one of two places:
- %USERPROFILE%\Documents\WindowsPowerShell\Modules
- %WINDIR%\System32\WindowsPowerShell\v1.0\Modules (need admin privileges)
- If the directory tree (of one of the above) doesn't exist then you should manually create it.
Check if the module is installed correctly, from your PowerShell session type:
PS C:\> Get-Module -ListAvailable
ModuleType Name ExportedCommands
---------- ---- ----------------
Manifest ShareUtils {}
PS C:\>
If you don't see the above result then the module was not installed correctly. Make sure the module directory exists under "%USERPROFILE%\Documents\WindowsPowerShell\Modules"
Importing the module:
PS C:\> Import-Module ShareUtils
Note: An elevated PowerShell session is needed to load the module. If the session is not elevated a warning message is written to the console and you won't be able to use any of the module’s functions.
PS C:\> Get-Command -Module shareutils
CommandType Name Definition
----------- ---- ----------
Filter Add-SharePermission ...
Function Get-Share ...
Function New-Share ...
Filter Remove-Share ...
Filter Remove-SharePermission ...
Filter Set-Share ...
Filter Set-SharePermission ...
PS C:\>
Each function (filter) has its own help. To get a help you may run the following command:
Get-Help <FunctionName>
And download link: