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 +```