# Run as the logged-in user to see what GPOs apply to THEM
Write-Output "=== Who am I ==="
whoami
Write-Output ""
Write-Output "=== User GPO results ==="
gpresult /scope user /r 2>&1
Write-Output ""
Write-Output "=== User desktop contents ==="
$desk = [Environment]::GetFolderPath("Desktop")
Write-Output "Desktop path: $desk"
Get-ChildItem "$desk\*" -ErrorAction SilentlyContinue | ForEach-Object { Write-Output "  $($_.Name)" }
Write-Output ""
Write-Output "=== Event log: GP Preferences ==="
Get-WinEvent -LogName "Microsoft-Windows-GroupPolicy/Operational" -MaxEvents 20 -ErrorAction SilentlyContinue | Where-Object { $_.Message -match 'Shortcut|Preference|CSE|Extension' } | ForEach-Object { Write-Output "$($_.TimeCreated) [$($_.Id)] $($_.Message.Substring(0,[Math]::Min(200,$_.Message.Length)))" }
