sync: auto-sync from HOWARD-HOME at 2026-05-20 17:08:25
Author: Howard Enos Machine: HOWARD-HOME Timestamp: 2026-05-20 17:08:25
This commit is contained in:
42
.claude/temp/frd-link.ps1
Normal file
42
.claude/temp/frd-link.ps1
Normal file
@@ -0,0 +1,42 @@
|
||||
$domain = 'cascades.local'
|
||||
$gpoName = 'CSC - Folder Redirection'
|
||||
$ouDN = 'OU=Administrative,OU=Departments,DC=cascades,DC=local'
|
||||
|
||||
Import-Module GroupPolicy -EA SilentlyContinue
|
||||
|
||||
# Link GPO to OU=Administrative
|
||||
try {
|
||||
New-GPLink -Name $gpoName -Domain $domain -Target $ouDN -LinkEnabled Yes -EA Stop
|
||||
Write-Output "[OK] Linked to $ouDN"
|
||||
} catch {
|
||||
if ($_.Exception.Message -like '*already*') {
|
||||
Set-GPLink -Name $gpoName -Domain $domain -Target $ouDN -LinkEnabled Yes -EA SilentlyContinue
|
||||
Write-Output "[OK] Link already existed — enabled"
|
||||
} else {
|
||||
Write-Output "[ERROR] $($_.Exception.Message)"
|
||||
}
|
||||
}
|
||||
|
||||
Write-Output ""
|
||||
Write-Output "=== Security Filter ==="
|
||||
Get-GPPermission -Name $gpoName -Domain $domain -All | ForEach-Object {
|
||||
Write-Output " $($_.Trustee.Name) [$($_.Trustee.TrusteeType)] — $($_.Permission)"
|
||||
}
|
||||
|
||||
Write-Output ""
|
||||
Write-Output "=== Links ==="
|
||||
$report = [xml](Get-GPOReport -Name $gpoName -Domain $domain -ReportType Xml)
|
||||
$links = $report.GPO.LinksTo
|
||||
if ($links) {
|
||||
foreach ($l in $links) {
|
||||
Write-Output " $($l.SOMPath) — Enabled: $($l.Enabled)"
|
||||
}
|
||||
} else {
|
||||
Write-Output " (none)"
|
||||
}
|
||||
|
||||
Write-Output ""
|
||||
Write-Output "=== SG-FolderRedirect members ==="
|
||||
Get-ADGroupMember -Identity 'SG-FolderRedirect' -EA SilentlyContinue | ForEach-Object {
|
||||
Write-Output " $($_.SamAccountName)"
|
||||
}
|
||||
Reference in New Issue
Block a user