Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions content/manuals/enterprise/enterprise-deployment/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,15 @@ Here's an example script that creates the `docker-users` group and adds the curr
$Group = "docker-users"
$CurrentUser = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name

# Create the group
New-LocalGroup -Name $Group

# Add the user to the group
Add-LocalGroupMember -Group $Group -Member $CurrentUser
# Create the group only if it doesn't already exist
if (-not (Get-LocalGroup -Name $Group -ErrorAction SilentlyContinue)) {
New-LocalGroup -Name $Group
}

# Add the user to the group only if they aren't already a member
if (-not (Get-LocalGroupMember -Group $Group -Member $CurrentUser -ErrorAction SilentlyContinue)) {
Add-LocalGroupMember -Group $Group -Member $CurrentUser
}
```

> [!NOTE]
Expand Down