Update CSE

This commit is contained in:
Przemyslaw Klys
2020-08-13 09:40:35 +02:00
parent 1974eb2a39
commit ec30c54577
5 changed files with 52 additions and 13 deletions
+16 -5
View File
@@ -1,7 +1,8 @@
function ConvertFrom-CSExtension {
[cmdletBinding()]
param(
[string] $CSE
[string[]] $CSE,
[switch] $Limited
)
$GUIDs = @{
# https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-gpreg/f0dba6b8-704f-45d5-999f-1a0a694a6df9
@@ -70,9 +71,19 @@ function ConvertFrom-CSExtension {
'{B1BE8D72-6EAC-11D2-A4EA-00C04F79F83A}' = 'EFS Recovery'
'{A2E30F80-D7DE-11d2-BBDE-00C04F86AE3B}' = 'Internet Explorer Settings'
}
if ($GUIDs[$CSE]) {
return $GUIDs[$CSE]
} else {
return $CSE
foreach ($C in $CSE) {
if (-not $Limited) {
if ($GUIDs[$C]) {
[PSCustomObject] @{ Name = $C; Description = $GUIDs[$C] }
} else {
[PSCustomObject] @{ Name = $C; Description = $C }
}
} else {
if ($GUIDs[$C]) {
$GUIDs[$C]
} else {
$CSE
}
}
}
}
+12 -7
View File
@@ -1,16 +1,21 @@
function Find-CSExtension {
[cmdletBinding()]
param(
[string] $CSE
[string[]] $CSE,
[string] $ComputerName
)
#List Group Policy Client Side Extensions, CSEs, from Windows 10
$Keys = Get-PSRegistry -RegistryPath "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions" -ComputerName AD3
$Keys = Get-PSRegistry -RegistryPath "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions" -ComputerName $ComputerName
foreach ($Key in $Keys.PSSubKeys) {
$Value = (Get-PSRegistry -RegistryPath "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\$Key" -ComputerName AD3).DefaultKey
if (-not $GUIDs[$Key]) {
"$Key $Value"
$RegistryKey = Get-PSRegistry -RegistryPath "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\$Key" -ComputerName $ComputerName
if ($CSE) {
foreach ($C in CSE) {
if ($RegistryKey.DefaultKey -eq $Key) {
[PSCustomObject] @{ Name = $Key; Description = $RegistryKey.DefaultKey }
}
}
} else {
[PSCustomObject] @{ CSE = $Key; Description = $RegistryKey.DefaultKey }
}
}
}