Using PowerShell to self-update AD details

Step 1: Authenticate the user

Prompt the user for their username. This ensures only authorized users update their own details.

$Username = Read-Host "Enter your username"

Step 2: Allow users to edit their information

Prompt users for new details. This script collects updated contact information.

$PhoneNumber = Read-Host "Enter your new phone number"
$OfficeLocation = Read-Host "Enter your new office location"

Step 3: Update AD details

Modify the AD user attributes. This updates the user's mobile number and office location in AD.

Set-ADUser -Identity $Username -MobilePhone $PhoneNumber -Office $OfficeLocation Write-Host "Your details have been updated."

Step 4: Automate the update process

Run this script regularly using Task Scheduler. This ensures user details are updated on a scheduled basis.

$trigger = New-ScheduledTaskTrigger -Daily -At "08:00AM"
$action = New-ScheduledTaskAction -Execute "PowerShell.exe" -Argument "-File C:\Scripts\UpdateADDetails.ps1" Register-ScheduledTask -TaskName "UserSelfUpdate" -Trigger $trigger -Action $action -User "SYSTEM"

FAQs

1. How can users update their details in AD?

Update user details in AD using the script below:

Set-ADUser -Identity username -Email "newemail@domain.com" -OfficePhone "1234567890"

2. Can users update multiple attributes at once?

Yes, multiple attributes can be updated at once using the script below:

Set-ADUser -Identity username -Title "New Title" -Department "IT"

3. Is admin approval needed for these changes?

Admin approval depends on permissions. Some attributes require admin rights.

 
  • Step 1: Authenticate the user
  • Step 2: Allow users to edit their information
  • Step 3: Update AD details
  • Step 4: Automate the update process
  • FAQs

ADSelfService Plus trusted by

A single pane of glass for complete self service password management
Email Download Link