TestimoX

API Reference

Command

Set-ADXUser

Namespace ADPlayground.PowerShell
Outputs
ADPlayground.DirectoryMutationResult

Updates a single Active Directory user with typed parameters and custom attribute support.

Examples

Authored help example

Example 1: Update a user profile with department and contact details


Set-ADXUser -Identity 'marta.nowak' -Domain 'contoso.com' -DisplayName 'Marta Nowak' -Department 'Operations' -Title 'Senior Service Desk Analyst' -Office 'Krakow' -TelephoneNumber '+48 12 111 22 33' -Mobile '+48 501 222 333' -WhatIf
        

Example 2: Write extension attributes and clear obsolete fields on a service account


Set-ADXUser -Identity 'svc_sql_ops' -Domain 'contoso.com' -Description 'Owned by DBA automation' -Enabled $false -ExtensionAttribute @{ 1 = 'Tier1'; 7 = 'SQL' } -Attribute @{ employeeType = 'ServiceAccount' } -ClearAttribute info, pager
        

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.

Syntax

Set-ADXUser -Identity <string> [-Attribute <Hashtable>] [-ClearAttribute <string[]>] [-Company <string>] [-Department <string>] [-Description <string>] [-DisplayName <string>] [-Domain <string>] [-Enabled <bool>] [-ExtensionAttribute <Hashtable>] [-GivenName <string>] [-Initials <string>] [-Mail <string>] [-ManagedBy <string>] [-Mobile <string>] [-Office <string>] [-Surname <string>] [-TelephoneNumber <string>] [-Title <string>] [-UserPrincipalName <string>] [<CommonParameters>]
#

Parameters

Identity string requiredposition: 0pipeline: falsealiases: CommonName, DistinguishedName, DN, Name, SamAccountName, UPN
Gets or sets user identity (sAMAccountName, UPN, DN, or name). Mail and UserPrincipalName (long form) are intentionally excluded to avoid collisions with dedicated update parameters. UPN shorthand is retained for discoverability.
Attribute Hashtable optionalposition: namedpipeline: false
Gets or sets arbitrary custom attributes to write.
ClearAttribute string[] optionalposition: namedpipeline: false
Gets or sets attributes to clear.
Company string optionalposition: namedpipeline: false
Gets or sets company.
Department string optionalposition: namedpipeline: false
Gets or sets department.
Description string optionalposition: namedpipeline: false
Gets or sets description.
DisplayName string optionalposition: namedpipeline: false
Gets or sets displayName.
Domain string optionalposition: namedpipeline: falsealiases: DomainName
Gets or sets the optional domain DNS name.
Enabled bool optionalposition: namedpipeline: false
Gets or sets enabled state.
ExtensionAttribute Hashtable optionalposition: namedpipeline: false
Gets or sets extension attributes to write. Keys accept numeric indexes (1-15) or extensionAttribute1-15.
GivenName string optionalposition: namedpipeline: false
Gets or sets givenName.
Initials string optionalposition: namedpipeline: false
Gets or sets initials.
Mail string optionalposition: namedpipeline: false
Gets or sets mail.
ManagedBy string optionalposition: namedpipeline: false
Gets or sets managedBy.
Mobile string optionalposition: namedpipeline: false
Gets or sets mobile.
Office string optionalposition: namedpipeline: false
Gets or sets office (physicalDeliveryOfficeName).
Surname string optionalposition: namedpipeline: false
Gets or sets surname (sn).
TelephoneNumber string optionalposition: namedpipeline: false
Gets or sets telephoneNumber.
Title string optionalposition: namedpipeline: false
Gets or sets title.
UserPrincipalName string optionalposition: namedpipeline: false
Gets or sets userPrincipalName.

Outputs

ADPlayground.DirectoryMutationResult