Examples/Sample_xUser_CreateUser.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Configuration xUserExample
{
    param (
        [System.Management.Automation.PSCredential]
        $PasswordCredential
    )

    Import-DscResource -ModuleName xPSDesiredStateConfiguration

    xUser xUserExample
    {
        Ensure = 'Present'  # To ensure the user account does not exist, set Ensure to "Absent"
        UserName = 'SomeUserName'
        Password = $PasswordCredential # This needs to be a credential object
    }
}