Import-Module GroupPolicy
Write-Output "=== Kiosk GPO permissions ==="
Get-GPPermission -Name 'CSC - Nurse Station Kiosk' -All | ForEach-Object { Write-Output "  $($_.Trustee.Name) ($($_.Trustee.SidType)): $($_.Permission) denied=$($_.Denied)" }
Write-Output ""
Write-Output "=== Kiosk GPO links ==="
$gpo = Get-GPO -Name 'CSC - Nurse Station Kiosk'
Write-Output "  ID: $($gpo.Id)  Status: $($gpo.GpoStatus)"
# Check links via AD
$links = Get-ADOrganizationalUnit -Filter * -Properties gpLink | Where-Object { $_.gpLink -match $gpo.Id }
$links | ForEach-Object { Write-Output "  Linked: $($_.DistinguishedName)" }
Write-Output ""
Write-Output "=== Caregiver Workstation GPO permissions ==="
Get-GPPermission -Name 'CSC - Caregiver Workstation' -All | ForEach-Object { Write-Output "  $($_.Trustee.Name) ($($_.Trustee.SidType)): $($_.Permission) denied=$($_.Denied)" }
Write-Output ""
Write-Output "=== Caregiver Workstation GPO links ==="
$gpo2 = Get-GPO -Name 'CSC - Caregiver Workstation'
Write-Output "  ID: $($gpo2.Id)  Status: $($gpo2.GpoStatus)"
$links2 = Get-ADOrganizationalUnit -Filter * -Properties gpLink | Where-Object { $_.gpLink -match $gpo2.Id }
$links2 | ForEach-Object { Write-Output "  Linked: $($_.DistinguishedName)" }
