Introduction

The cFileShare module is a part of the ALM Ranger DevOps solutions (//VsarDevOps.codeplex.com), which consists of code as config guidance, quick reference posters and supporting resources. This module contains the cCreateFileShare and cSetSharePermissions resources. These DSC Resources allow configuration of a node’s file share and share permission Rules.

All of the ALM Ranger resources are provided AS IS, and are not supported through any Microsoft standard support program or service. The "c" in cFileShare stands for community, which means that these resources will be fix forward and monitored by the ALM Rangers.

Please leave comments, feature requests, and bug reports in the Q & A tab for this module.

If you would like to modify cFileShare module, feel free. When modifying, please update the module name, resource friendly name, and MOF class name (instructions below). As specified in the license, you may copy or modify this resource as long as they are used on the Windows Platform.

For more information about Windows PowerShell Desired State Configuration, check out the blog posts on the PowerShell Blog (this is a good starting point). There are also great community resources, such as PowerShell.org , or PowerShell Magazine . For more information on this and other ALM Ranger solutions, check out this blog post and aka.ms/vsarsolutions.

Installation

This module is hosted in an online gallery here, with other elements of the Powershell Desired State Configuration Resource Kit. To install the cFileShare module, run the following command from the PowerShell prompt in Administrator mode:

  • Install-Module -Name cFileShare

To confirm installation:

Requirements

This module requires the latest version of PowerShell (v4.0, which ships in Windows 8.1 or Windows Server 2012R2). To easily use PowerShell 4.0 on older operating systems, install WMF 4.0. Please read the installation instructions that are present on both the download page and the release notes for WMF 4.0.

Description

The xCFileShare module contains the cCreateFileShare and cSetSharePermissions DSC Resources. These DSC Resources allow you to easily configure and maintain your file shares and permissions by writing simple configurations.

Details

cCreateFileShare resource has following properties:

cSetSharePermissions resource has following properties:

  • ShareName::                          The desired share name
  •  FullAccessUsers::                  User or comma separated list of users with full access
  • ChangeAccessUsers::            User or comma separated list of users with change access
  • ReadAccessUsers::                User or comma separated list of users with read-only access

Renaming Requirements

When making changes to these resources, we suggest the following practice:

  1. Update the following names by replacing VSAR with your company/community name and replacing the "x" with "c" (short for "Community") or another prefix of your choice:
    • Resource folder (ex: VSAR_cSetSharePermissions) becomes Contoso_cSetSharePermissions)
    • Resource Name (ex: VSAR_cSetSharePermissions) becomes Contoso_cSetSharePermissions)
    • MOF class name (ex: VSAR_cSetSharePermissions) becomes Contoso_cSetSharePermissions)
    • Filename for the resource.schema.mof (ex: VSAR_cSetSharePermissions.schema.mof) becomes Contoso_cSetSharePermissions.schema.mof)
  2. Update module and metadata information in the module manifest
  3. Update any configuration that use these resources

We reserve resource and module names without prefixes ("x" or "c") for future use (e.g. "VSAR_cFileShare" or "FileShare"). If the next version of Windows Server ships with a "FileShare" resource, we don't want to break any configurations that use any community modifications. Please keep a prefix such as "c" on all community modifications.

Versions

1.0.0.1

 

 

Example: Alter Permissions

This configuration will set the permissions for users on a specified share.

The example code for Alter Permissions is located in "Sample - AlterPermissions.ps1" in the Examples folder of the module.

 

 

Example: Create Drop Share

This configuration will set the share name and path for a specified share.

The example code for Alter Permissions is located in "Sample - CreateDropShare.ps1" in the Examples folder of the module.

 

 

Example: Create Multiple Shares

This configuration will set the share name and path for multiple shares.

The example code for Alter Permissions is located in "Sample - CreateMultipleShares.ps1" in the Examples folder of the module.