0%
Modify a User Account

Modify a User Account

This guide shows you how to modify user account properties in Active Directory with PowerShell.

10-15 min

Guide to Modifying a User Account in Active Directory with PowerShell

This guide covers the main PowerShell commands for modifying the properties of a user account in Active Directory (AD). Whether you need to add information, replace values, or set a manager, the following commands help you manage users efficiently.


Commands for Modifying User Information

1. Add a description to a user account

To add a description to a user, use the following command:

# Ajoute une description au compte utilisateur "jlebon"
Set-ADUser -Identity jlebon -Description "Ceci est un compte de test"
  • Purpose: Add a description to the jlebon account.
  • Explanation:
    • Set-ADUser: Cmdlet for modifying a user's attributes in AD.
    • -Identity jlebon: Specifies the user to modify by identity name.
    • -Description: Field where you can provide a brief description of the account.

2. Add a custom attribute to a user

To add a custom attribute such as division, use the -Add option:

# Ajoute l'attribut "division" avec la valeur "Division test" pour l'utilisateur "jlebon"
Set-ADUser -Identity jlebon -Add @{division="Division test"}
Link copied!