powershell active directory 48min

This commit is contained in:
2026-01-09 18:37:00 +01:00
parent cdac354904
commit 941d14b737
2 changed files with 61 additions and 0 deletions

View File

@@ -102,3 +102,52 @@ Set-ADUser -Identity "jpage" -Email "jimmy.page@mrsh.org" -OfficePhone "800-555-
Set-ADUser -Identity 'jpage' -Enabled:$false
```
### Set-ADAccountPassowrd
How to change password of an account
```powershell
Set-ADAccountPassowrd -Identity "jpage" -Reset -NewPassword (ConvertTo-SecureString "NewPassqord1" -AsPlainText -Force)
#for security the user have to set a new password at logon
Set-ADUser -Identity "jpage" -ChangePasswordAtLogon $true
```
###
### Unlock-ADAccount
Unlock a Active directory user
```powershell
Unlock-ADAccount -Identity 'jpage'
```
## Group
In Active Directory, groups are used to organize users, computers,
and other objects so administrators can manage permissions
and access more efficiently.
By assigning permissions to a group rather than to individual users,
changes can be made quickly by adding or removing members from the group.
Active Directory supports different group scopes and types, allowing
organizations to control access to resources such as files,
applications, and network services in a structured and scalable way.
### New-ADGroup
```powershell
New-ADGroup -Name "Guitar" -Path "OU=Students, OU=Rock, DC=mrsh, DC=org -GroupScope Gloabal"
```
### Add-ADGroupMember
```powershell
Add-ADGroupMember -Identity "Guitar" -Members "jpage"
```
### Get-ADGroup
```powershell
$Group = Get-ADGroup -Identity 'Guitar'
```