From cdac354904bd987642f641725173cf1603679643 Mon Sep 17 00:00:00 2001 From: mrsh Date: Thu, 8 Jan 2026 17:15:44 +0100 Subject: [PATCH] Adding Set-ADUser --- ...ell with Active Directory in Less than 2 hours.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/3.Active_Directory/Learn Powershell with Active Directory in Less than 2 hours.md b/3.Active_Directory/Learn Powershell with Active Directory in Less than 2 hours.md index 4a355de..792376d 100644 --- a/3.Active_Directory/Learn Powershell with Active Directory in Less than 2 hours.md +++ b/3.Active_Directory/Learn Powershell with Active Directory in Less than 2 hours.md @@ -74,7 +74,7 @@ New-ADUser -Name "Jimmy Page" -SamAccountName "jpage" -UserPrincipalName "jpage@ `-Path "OU=Rock , OU=Students, OU=LedZep, DC=mrsh, DC=org" -AccountPassword (ConvertTo-SecureString "Music123" -AsPlainText -force) -Enabled $true ``` -## Get-ADUser +### Get-ADUser For fetching informations about a user @@ -92,3 +92,13 @@ $ADUser.UserPrincipalName $ADUser = Get-Aduser -Identity "jpage" | Select-Object Name,SamAccountName,UserPrincipalName ``` + +### Set-ADUser + +Change property of an user + +```powershell +Set-ADUser -Identity "jpage" -Email "jimmy.page@mrsh.org" -OfficePhone "800-555-0000" + +Set-ADUser -Identity 'jpage' -Enabled:$false +```