Files
PowerShell-PSDscResources/Examples/Sample_Group_MembersToIncludeExclude.ps1
T
2016-10-07 23:52:02 -07:00

45 lines
1.0 KiB
PowerShell

<#
.SYNOPSIS
Creates a group with the specified name and members included or modifies the members of a group if
the named group already exists.
.PARAMETER GroupName
The name of the group to create or modify.
.PARAMETER MembersToInclude
The list of members the group should contain.
The default value is an empty list.
.PARAMETER MembersToExclude
The list of members the group should not contain.
The default value is an empty list.
#>
Configuration Sample_Group
{
param
(
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[String]
$GroupName,
[String[]]
$MembersToInclude = @(),
[String[]]
$MembersToExclude = @()
)
Import-DscResource -ModuleName 'PSDscResources'
Group Group1
{
GroupName = $GroupName
Ensure = 'Present'
MembersToInclude = $MembersToInclude
MembersToExclude = $MembersToExclude
}
}
Sample_Group