Skip to content

MartinVokurek/xSmbShare

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build status

xSmbShare

The xSmbShare module contains the xSmbShare DSC resource for setting up and configuring an SMB share.

Contributing

Please check out common DSC Resources contributing guidelines.

Resources

xSmbShare

  • Name: Name of the SMB share.
  • Path: Path to the share.
  • Description: Description of the share.
  • ChangeAccess: Specifies which user will be granted modify permission to access the share.
  • ConcurrentUserLimit: Specifies the maximum number of concurrently connected users that the new SMB share may accommodate. If this parameter is set to 0, then the number of users is unlimited. The default value is 0.
  • EncryptData: Indicates that the share is encrypted.
  • FolderEnumerationMode: Specifies which files and folders in the new SMB share are visible to users.
  • FullAccess: Specifies which accounts are granted full permission to access the share.
  • NoAccess: Specifies which accounts are denied access to the share.
  • ReadAccess: Specifies which accounts are granted read permission to access the share.
  • Ensure: Specifies if the share should be added or removed.
  • ShareState: State of the share.
  • ShareType: Type of the share.
  • ShadowCopy: Specifies if this share is a ShadowCopy.
  • Special: Specifies if this share is a Special Share. Admin shares, default shares, IPC$ share are examples.

Versions

Unreleased

1.1.0.0

  • Fixed bug in xSmbShare resource which was causing Test-TargetResource to return false negatives when more than three parameters were specified.

1.0.0.0

  • Initial release with the following resources
    • xSmbShare

Examples

Ensure the an SMB share exists

This configuration ensures that there is a share with the description of "This is a test SMB Share".

Configuration ChangeDescriptionConfig
{
    Import-DscResource -Name MSFT_xSmbShare
    # A Configuration block can have zero or more Node blocks
    Node localhost
    {
        xSmbShare MySMBShare
        {
            Ensure = "Present" 
            Name   = "SMBShare1"
            Path = "C:\Users\Duser1\Desktop"  
            Description = "This is a test SMB Share"          
        }
    }
} 

ChangeDescriptionConfig

Ensure description and permissions for a share

This configuration ensures that the description and permissions for a share are as specified.

Configuration ChangeDescriptionAndPermissionsConfig
{
    Import-DscResource -Name MSFT_xSmbShare
    # A Configuration block can have zero or more Node blocks
    Node localhost
    {
        # Next, specify one or more resource blocks

        xSmbShare MySMBShare
        {
            Ensure = "Present" 
            Name   = "SMBShare1"
            Path = "C:\Users\Duser1\Desktop"  
            ReadAccess = "User1"
            NoAccess = @("User3", "User4")
            Description = "This is an updated description for this share"
        } 
    }
}
ChangeDescriptionAndPermissionsConfig

Remove an SMB share

This example ensures that the SMB share used in the previous examples does not exist.

Configuration RemoveSmbShareConfig
{
    Import-DscResource -Name MSFT_xSmbShare
    # A Configuration block can have zero or more Node blocks
    Node localhost
    {
        # Next, specify one or more resource blocks

        xSmbShare MySMBShare
        {
            Ensure = "Absent" 
            Name   = "SMBShare1"
            Path = "C:\Users\Duser1\Desktop"          
        }
    }
} 

RemoveSmbShareConfig

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PowerShell 100.0%