docs: Add backup-groupmembers.ps1
This commit is contained in:
@@ -1,22 +1,46 @@
|
|||||||
# Powershell
|
# Powershell
|
||||||
|
|
||||||
## `add-usertogroupwithlicense.ps1`
|
## Active Directory
|
||||||
|
|
||||||
|
### `add-usertogroupwithlicense.ps1`
|
||||||
|
|
||||||
This script is used to add a user to a license group and an application group in the local active directory.
|
This script is used to add a user to a license group and an application group in the local active directory.
|
||||||
|
|
||||||
### Usage
|
#### Usage
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
.\add-usertogroupwithlicense.ps1
|
.\add-usertogroupwithlicense.ps1
|
||||||
```
|
```
|
||||||
|
|
||||||
### Variables
|
#### Variables
|
||||||
|
|
||||||
- `dn`: The domain name of the local active directory.
|
- `dn`: The domain name of the local active directory.
|
||||||
- `license_group`: The name of the license group.
|
- `license_group`: The name of the license group.
|
||||||
- `application_group`: The name of the application group.
|
- `application_group`: The name of the application group.
|
||||||
- `user`: The name of the user to add to the groups.
|
- `user`: The name of the user to add to the groups.
|
||||||
|
|
||||||
## `add-usertogroupwithlicense.ps1`
|
### `backup-groupmembers.ps1`
|
||||||
|
|
||||||
This script is used to add a user to a license group and an application group in the local active directory.
|
This script is used to backup the members of a group in the local active directory. The script will create a CSV file with the members of the group.
|
||||||
|
|
||||||
|
#### Usage
|
||||||
|
|
||||||
|
##### Prepare the script
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
...
|
||||||
|
|
||||||
|
$server = "$($global_catalog.Name):3268"
|
||||||
|
|
||||||
|
$groups = @("Domain Admins", "Domain Users")
|
||||||
|
|
||||||
|
$csv_file = "backup_$(Get-Date -Format 'yyyy-MM-dd_HH-mm-ss').csv"
|
||||||
|
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Run the script
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
.\backup-groupmembers.ps1
|
||||||
|
```
|
||||||
|
Reference in New Issue
Block a user