Skip to content
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.

SNikalaichyk/cUserRightsAssignment

Repository files navigation

Build status

cUserRightsAssignment

The cUserRightsAssignment module contains the cUserRight DSC resource that provides a mechanism to manage user rights: logon rights and privileges.

You can also download this module from the PowerShell Gallery.

Resources

cUserRight

The cUserRight DSC resource provides a mechanism to manage user rights: logon rights and privileges.

Versions

1.0.2 (February 19, 2016)

  • General improvements.

1.0.1 (February 2, 2016)

  • General improvements.

1.0.0 (January 18, 2016)

  • Initial release with the following DSC resources:
    • cUserRight

Examples

Assign logon rights

This example shows how to use the cUserRight DSC resource to assign logon rights.

Configuration Sample_cUserRight
{
    Import-DscResource -ModuleName cUserRightsAssignment

    # Ensure the 'Log on as a service' logon right is assigned to the local 'Power Users' group.
    cUserRight GrantServiceLogonRight
    {
        Ensure = 'Present'
        Constant = 'SeServiceLogonRight'
        Principal = 'BUILTIN\Power Users'
    }

    # Ensure the 'Log on as a batch job' logon right is not assigned to the local 'Power Users' group.
    cUserRight RevokeBatchLogonRight
    {
        Ensure = 'Absent'
        Constant = 'SeBatchLogonRight'
        Principal = 'BUILTIN\Power Users'
    }
}

$OutputPath = Join-Path -Path ([System.IO.Path]::GetTempPath()) -ChildPath 'Sample_cUserRight'
Sample_cUserRight -OutputPath $OutputPath
Start-DscConfiguration -Path $OutputPath -Force -Verbose -Wait