-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #245 from mbreakey3/xUserChanges
updating changes to xUser
- Loading branch information
Showing
11 changed files
with
1,417 additions
and
602 deletions.
There are no files selected for viewing
900 changes: 543 additions & 357 deletions
900
DSCResources/MSFT_xUserResource/MSFT_xUserResource.psm1
Large diffs are not rendered by default.
Oops, something went wrong.
18 changes: 9 additions & 9 deletions
18
DSCResources/MSFT_xUserResource/MSFT_xUserResource.schema.mof
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
[ClassVersion("1.0.0"), FriendlyName("xUser")] | ||
class MSFT_xUserResource : OMI_BaseResource | ||
{ | ||
[Key] string UserName; | ||
[write,ValueMap{"Present", "Absent"},Values{"Present", "Absent"}] string Ensure; | ||
[write] string FullName; | ||
[write] string Description; | ||
[write,EmbeddedInstance("MSFT_Credential")] string Password; | ||
[write] boolean Disabled; | ||
[write] boolean PasswordNeverExpires; | ||
[write] boolean PasswordChangeRequired; | ||
[write] boolean PasswordChangeNotAllowed; | ||
[Key,Description("The name of the User to Create/Modify/Delete")] String UserName; | ||
[Write,Description("An enumerated value that describes if the user is expected to exist on the machine"),ValueMap{"Present", "Absent"},Values{"Present", "Absent"}] String Ensure; | ||
[Write,Description("The display name of the user")] String FullName; | ||
[Write,Description("A description for the user")] String Description; | ||
[Write,Description("The password for the user"),EmbeddedInstance("MSFT_Credential")] String Password; | ||
[Write,Description("Value used to disable/enable a user account")] Boolean Disabled; | ||
[Write,Description("Value used to set whether a user's password expires or not")] Boolean PasswordNeverExpires; | ||
[Write,Description("Value used to require a user to change their password")] Boolean PasswordChangeRequired; | ||
[Write,Description("Value used to set whether a user can/cannot change their password")] Boolean PasswordChangeNotAllowed; | ||
}; |
Binary file modified
BIN
+1.73 KB
(370%)
DSCResources/MSFT_xUserResource/en-US/MSFT_xUserResource.schema.mfl
Binary file not shown.
43 changes: 20 additions & 23 deletions
43
DSCResources/MSFT_xUserResource/en-US/MSFT_xUserResource.strings.psd1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,23 @@ | ||
# Localized resources for MSFT_xUserResource | ||
# Localized resources for xUser | ||
|
||
ConvertFrom-StringData @' | ||
###PSLOC | ||
UserWithName=User: {0} | ||
RemoveOperation=Remove | ||
AddOperation=Add | ||
SetOperation=Set | ||
ConfigurationStarted=Configuration of user {0} started. | ||
ConfigurationCompleted=Configuration of user {0} completed successfully. | ||
UserCreated=User {0} created successfully. | ||
UserUpdated=User {0} properties updated successfully. | ||
UserRemoved=User {0} removed successfully. | ||
NoConfigurationRequired=User {0} exists on this node with the desired properties. No action required. | ||
NoConfigurationRequiredUserDoesNotExist=User {0} does not exist on this node. No action required. | ||
InvalidUserName=The name {0} cannot be used. Names may not consist entirely of periods and/or spaces, or contain these characters: {1} | ||
UserExists=A user with the name {0} exists. | ||
UserDoesNotExist=A user with the name {0} does not exist. | ||
PropertyMismatch=The value of the {0} property is expected to be {1} but it is {2}. | ||
PasswordPropertyMismatch=The value of the {0} property does not match. | ||
AllUserPropertisMatch=All {0} {1} properties match. | ||
ConnectionError = There could be a possible connection error while trying to use the System.DirectoryServices API's. | ||
MultipleMatches = There could be a possible multiple matches exception while trying to use the System.DirectoryServices API's. | ||
###PSLOC | ||
UserWithName = User: {0} | ||
RemoveOperation = Remove | ||
AddOperation = Add | ||
SetOperation = Set | ||
ConfigurationStarted = Configuration of user {0} started. | ||
ConfigurationCompleted = Configuration of user {0} completed successfully. | ||
UserCreated = User {0} created successfully. | ||
UserUpdated = User {0} properties updated successfully. | ||
UserRemoved = User {0} removed successfully. | ||
NoConfigurationRequired = User {0} exists on this node with the desired properties. No action required. | ||
NoConfigurationRequiredUserDoesNotExist = User {0} does not exist on this node. No action required. | ||
InvalidUserName = The name {0} cannot be used. Names may not consist entirely of periods and/or spaces, or contain these characters: {1} | ||
UserExists = A user with the name {0} exists. | ||
UserDoesNotExist = A user with the name {0} does not exist. | ||
PropertyMismatch = The value of the {0} property is expected to be {1} but it is {2}. | ||
PasswordPropertyMismatch = The value of the {0} property does not match. | ||
AllUserPropertisMatch = All {0} {1} properties match. | ||
ConnectionError = There could be a possible connection error while trying to use the System.DirectoryServices API's. | ||
MultipleMatches = There could be a possible multiple matches exception while trying to use the System.DirectoryServices API's. | ||
'@ |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
param | ||
( | ||
[Parameter(Mandatory)] | ||
[System.String] | ||
$ConfigurationName | ||
) | ||
|
||
<# | ||
Create a custom configuration by passing in whatever | ||
values you need. $Password is the only param that is | ||
required since it must be a PSCredential object. | ||
If you want to create a user with minimal attributes, | ||
every param except username can be deleted since they | ||
are optional. | ||
#> | ||
|
||
Configuration $ConfigurationName | ||
{ | ||
param | ||
( | ||
[System.String] | ||
$UserName = 'Test UserName', | ||
|
||
[System.String] | ||
$Description = 'Test Description', | ||
|
||
[System.String] | ||
$FullName = 'Test Full Name', | ||
|
||
[ValidateSet('Present', 'Absent')] | ||
[System.String] | ||
$Ensure = 'Present', | ||
|
||
[Parameter(Mandatory)] | ||
[System.Management.Automation.PSCredential] | ||
$Password, | ||
|
||
[System.Boolean] | ||
$Disabled = $false, | ||
|
||
[System.Boolean] | ||
$PasswordNeverExpires = $false, | ||
|
||
[System.Boolean] | ||
$PasswordChangeRequired = $false, | ||
|
||
[System.Boolean] | ||
$PasswordChangeNotAllowed = $false | ||
) | ||
|
||
Import-DscResource -ModuleName 'xPSDesiredStateConfiguration' | ||
|
||
Node Localhost { | ||
|
||
xUser UserResource1 | ||
{ | ||
UserName = $UserName | ||
Ensure = $Ensure | ||
FullName = $FullName | ||
Description = $Description | ||
Password = $Password | ||
Disabled = $Disabled | ||
PasswordNeverExpires = $PasswordNeverExpires | ||
PasswordChangeRequired = $PasswordChangeRequired | ||
PasswordChangeNotAllowed = $PasswordChangeNotAllowed | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.