Active Directory Management Framework

Configuration driven Active Directory management.

Register-DMUser

SYNOPSIS

Registers a user definition into the configuration domains are compared to.

SYNTAX

Register-DMUser [-SamAccountName] <String> [[-Name] <String>] [[-GivenName] <String>] [[-Surname] <String>]
 [[-Description] <String>] [-PasswordNeverExpires] [[-UserPrincipalName] <String>] [-Path] <String>
 [[-Attributes] <Hashtable>] [[-AttributesResolved] <Hashtable>] [[-Enabled] <TriBool>] [[-Optional] <Boolean>]
 [[-OldNames] <String[]>] [[-Present] <TriBool>] [[-ContextName] <String>] [-ProgressAction <ActionPreference>]
 [<CommonParameters>]

DESCRIPTION

Registers a user definition into the configuration domains are compared to. This configuration is then compared to the configuration in AD when using Test-ADUser.

Note: Many properties can be set up for string replacement at runtime. For example to insert the domain DN into the path, insert “%DomainDN%” (without the quotes) where the domain DN would be placed. Use Register-DMNameMapping to add additional values and the placeholder they will be inserted into. Use Get-DMNameMapping to retrieve a list of available mappings. This can be used to use the same content configuration across multiple environments, accounting for local naming differences.

EXAMPLES

EXAMPLE 1

Get-Content .\users.json | ConvertFrom-Json | Write-Output | Register-DMUser

Reads a json configuration file containing a list of objects with appropriate properties to import them as user configuration.

PARAMETERS

-SamAccountName

SamAccountName of the user to manage. Subject to string insertion.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Name

Name of the user to manage. Subject to string insertion.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-GivenName

Given Name of the user to manage. Subject to string insertion.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Surname

Surname (Family Name) of the user to manage. Subject to string insertion.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Description

Description of the user account. This is required and should describe the purpose / use of the account. Subject to string insertion.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 5
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-PasswordNeverExpires

Whether the password should never expire. By default it WILL expire.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-UserPrincipalName

The user principal name the account should have. Subject to string insertion.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 6
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Path

The organizational unit the user should be placed in. Subject to string insertion.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 7
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Attributes

Additional attributes that should be applied to the user. Can be any attribute available to users, but some data types may not work out as intended. NOT Subject to string insertion.

Type: Hashtable
Parameter Sets: (All)
Aliases:

Required: False
Position: 8
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-AttributesResolved

Additional attributes that should be applied to the user. Can be any attribute available to users, but some data types may not work out as intended. Subject to string insertion.

Type: Hashtable
Parameter Sets: (All)
Aliases:

Required: False
Position: 9
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Enabled

Whether the user object should be enabled or disabled. Defaults to: Undefined

Type: TriBool
Parameter Sets: (All)
Aliases:
Accepted values: False, True, Undefined

Required: False
Position: 10
Default value: Undefined
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Optional

By default, all defined user accounts must exist. By setting a user account optional, it will be tolerated if it exists, but not created if it does not.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 11
Default value: False
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-OldNames

Previous names the user object had. Will trigger a rename if a user is found under one of the old names but not the current one. Subject to string insertion.

Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 12
Default value: @()
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Present

Whether the user should be present. This can be used to trigger deletion of a managed account. When set to ‘Undefined’, this will act exactly as if -Optional were set to $true

Type: TriBool
Parameter Sets: (All)
Aliases:
Accepted values: False, True, Undefined

Required: False
Position: 13
Default value: True
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-ContextName

The name of the context defining the setting. This allows determining the configuration set that provided this setting. Used by the ADMF, available to any other configuration management solution.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 14
Default value: <Undefined>
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES