项目作者: SNikalaichyk

项目描述 :
The cLocalFileShare DSC resource module.
高级语言: PowerShell
项目地址: git://github.com/SNikalaichyk/cLocalFileShare.git
创建时间: 2015-09-30T11:16:10Z
项目社区:https://github.com/SNikalaichyk/cLocalFileShare

开源协议:MIT License

下载


cLocalFileShare

The cLocalFileShare module contains the cLocalFileShare DSC resource that provides a mechanism to manage local file shares.

Supports Windows Server 2008 R2 and later.

You can also download this module from the PowerShell Gallery.

Resources

cLocalFileShare

  • Ensure: Indicates if the share exists. Set this property to Absent to ensure that the share does not exist. Setting it to Present (the default value) ensures that the share exists.
  • Name: Indicates the name of the share.
  • Path: Indicates the path to the location of the folder to share.
  • ConcurrentUserLimit: Indicates the number of users allowed to concurrently use the share. To set the limit at the maximum number, set this property to zero.
  • Description: Indicates an optional description for the share.
  • FullAccess: Indicates which accounts are granted Full Control permission to access the share.
  • ChangeAccess: Indicates which accounts are granted Change permission to access the share.
  • ReadAccess: Indicates which accounts are granted Read permission to access the share.
  • NoAccess: Indicates which accounts are denied access to the share.

Versions

1.0.1 (October 15, 2015)

  • Minor update.

1.0.0 (October 5, 2015)

  • Initial release with the following resources:
    • cLocalFileShare.

Examples

This configuration will create a directory and two local file shares.

  1. configuration Sample_cLocalFileShare
  2. {
  3. Import-DscResource -ModuleName PSDesiredStateConfiguration
  4. Import-DscResource -ModuleName cLocalFileShare
  5. File TestDirectory
  6. {
  7. Ensure = 'Present'
  8. DestinationPath = 'C:\TestDirectory'
  9. Type = 'Directory'
  10. }
  11. cLocalFileShare Share1
  12. {
  13. Ensure = 'Present'
  14. Name = 'Share-1'
  15. Path = 'C:\TestDirectory'
  16. Description = 'Created by the cLocalFileShare DSC resource'
  17. ConcurrentUserLimit = 10
  18. FullAccess = 'NT AUTHORITY\SYSTEM'
  19. ChangeAccess = 'BUILTIN\Administrators'
  20. ReadAccess = 'NT AUTHORITY\Authenticated Users'
  21. NoAccess = 'BUILTIN\Guests'
  22. DependsOn = '[File]TestDirectory'
  23. }
  24. cLocalFileShare Share2
  25. {
  26. Ensure = 'Present'
  27. Name = 'Share-2'
  28. Path = 'C:\TestDirectory'
  29. ConcurrentUserLimit = 0
  30. Description = 'Created by the cLocalFileShare DSC resource'
  31. ReadAccess = 'Everyone'
  32. DependsOn = '[File]TestDirectory'
  33. }
  34. }
  35. Sample_cLocalFileShare -OutputPath "$Env:SystemDrive\Sample_cLocalFileShare"
  36. Start-DscConfiguration -Path "$Env:SystemDrive\Sample_cLocalFileShare" -Force -Verbose -Wait
  37. Get-DscConfiguration