UWF_RegistryFilter
UWF(통합 쓰기 필터) 필터링에서 레지스트리 제외를 추가하거나 제거하고 레지스트리 변경 내용도 커밋합니다.
구문
class UWF_RegistryFilter{
[key, Read] boolean CurrentSession;
[Read, Write] boolean PersistDomainSecretKey;
[Read, Write] boolean PersistTSCAL;
UInt32 AddExclusion(
string RegistryKey
);
UInt32 RemoveExclusion(
string RegistryKey
);
UInt32 FindExclusion(
[in] string RegistryKey,
[out] boolean bFound
);
UInt32 GetExclusions(
[out, EmbeddedInstance("UWF_ExcludedRegistryKey")] string ExcludedKeys[]
);
UInt32 CommitRegistry(
[in] string RegistryKey,
[in] string ValueName
);
UInt32 CommitRegistryDeletion(
string Registrykey,
string ValueName
);
};
멤버
다음 표에는 이 클래스에 속하는 메서드 및 속성이 나와 있습니다.
메서드 | 설명 |
---|---|
UWF_RegistryFilter.AddExclusion | 레지스트리 키를 UWF의 레지스트리 제외 목록에 추가합니다. |
UWF_RegistryFilter.CommitRegistry | 지정된 레지스트리 키 및 값에 대한 변경 내용을 커밋합니다. |
UWF_RegistryFilter.CommitRegistryDeletion | 지정된 레지스트리 키 또는 레지스트리 값을 삭제하고 삭제를 커밋합니다. |
UWF_RegistryFilter.FindExclusion | 특정 레지스트리 키가 UWF에 의해 필터링되지 않도록 제외되는지 여부를 결정합니다. |
UWF_RegistryFilter.GetExclusions | UWF로 보호되는 시스템에서 모든 레지스트리 키 제외를 검색합니다. |
UWF_RegistryFilter.RemoveExclusion | UWF(통합 쓰기 필터)에 대한 레지스트리 제외 목록에서 레지스트리 키를 제거합니다. |
특성
속성 | 데이터 형식 | 한정자 | 설명 |
---|---|---|---|
CurrentSession | 부울 | [키, 읽기] | 개체에 대한 설정이 포함된 세션을 나타냅니다.
- True이면 현재 세션 - 에 대한 설정이 False이면 다시 시작하는 다음 세션에 대한 설정입니다. |
PersistDomainSecretKey | 부울 | [읽기, 쓰기] | 도메인 비밀 레지스트리 키가 레지스트리 제외 목록에 있는지를 나타냅니다. 레지스트리 키가 제외 목록에 없으면 다시 시작한 후에도 변경 내용이 유지되지 않습니다. - 제외 목록에 포함하려면 True입니다. 그렇지 않으면 False입니다 . |
PersistTSCAL | 부울 | [읽기, 쓰기] | 터미널 서버 TSCAL(클라이언트 액세스 라이선스) 레지스트리 키가 UWF 레지스트리 제외 목록에 있는지를 나타냅니다. 레지스트리 키가 제외 목록에 없으면 다시 시작한 후에도 변경 내용이 유지되지 않습니다.
- 제외 목록에 포함하려면 True입니다. 그렇지 않으면 False로 설정합니다. |
설명
PersistDomainSecretKey 및 PersistTSCAL 값의 변경 내용을 포함하여 레지스트리 제외의 추가 또는 제거는 UWF가 사용하도록 설정된 다음 다시 시작 후에 적용됩니다.
HKLM 레지스트리 루트의 레지스트리 키만 UWF 레지스트리 제외 목록에 추가할 수 있습니다.
UWF_RegistryFilter 사용하여 UWF 필터링에서 도메인 비밀 레지스트리 키 및 TSCAL 레지스트리 키를 제외할 수도 있습니다.
예제
다음 예제에서는 PowerShell 스크립트에서 WMI(Windows Management Instrumentation) 공급자를 사용하여 UWF 레지스트리 제외를 관리하는 방법을 보여 줍니다.
PowerShell 스크립트는 4개의 함수를 만든 다음, 이를 사용하는 방법을 보여 줍니다.
첫 번째 함수 인 Get-RegistryExclusions는 현재 세션과 다시 시작 후 다음 세션 모두에 대한 UWF 레지스트리 제외 목록을 표시합니다.
두 번째 함수 인 Add-RegistryExclusion은 디바이스를 다시 시작한 후 UWF 레지스트리 제외 목록에 레지스트리 항목을 추가합니다.
세 번째 함수 인 Remove-RegistryExclusion은 디바이스를 다시 시작한 후 UWF 제외 목록에서 레지스트리 항목을 제거합니다.
네 번째 함수 인 Clear-RegistryExclusions는 모든 UWF 레지스트리 제외를 제거합니다. UWF가 제외 필터링을 중지하기 전에 디바이스를 다시 시작해야 합니다.
$COMPUTER = "EMBEDDEDDEVICE"
$NAMESPACE = "root\standardcimv2\embedded"
# Define common parameters
$CommonParams = @{"namespace"=$NAMESPACE; "computer"=$COMPUTER}
function Get-RegistryExclusions() {
# This function lists the UWF registry exclusions, both
# for the current session as well as the next session after a restart.
# Get the UWF_RegistryFilter configuration for the current session
$currentConfig = Get-WMIObject -class UWF_RegistryFilter @CommonParams |
where {
$_.CurrentSession -eq $true
};
# Get the UWF_RegistryFilter configuration for the next session after a restart
$nextConfig = Get-WMIObject -class UWF_RegistryFilter @CommonParams |
where {
$_.CurrentSession -eq $false
};
# Display registry exclusions for the current session
if ($currentConfig) {
Write-Host ""
Write-Host "The following registry entries are currently excluded from UWF filtering:";
$currentExcludedList = $currentConfig.GetExclusions()
if ($currentExcludedList.ExcludedKeys) {
foreach ($registryExclusion in $currentExcludedList.ExcludedKeys) {
Write-Host " " $registryExclusion.RegistryKey
}
} else {
Write-Host " None"
}
} else {
Write-Error "Could not retrieve UWF_RegistryFilter.";
}
# Display registry exclusions for the next session after a restart
if ($nextConfig) {
Write-Host ""
Write-Host "The following registry entries will be excluded from UWF filtering after the next restart:";
$nextExcludedList = $nextConfig.GetExclusions()
if ($nextExcludedList.ExcludedKeys) {
foreach ($registryExclusion in $nextExcludedList.ExcludedKeys) {
Write-Host " " $registryExclusion.RegistryKey
}
} else {
Write-Host " None"
}
Write-Host ""
}
}
function Add-RegistryExclusion($exclusion) {
# This function adds a new UWF registry exclusion.
# The new registry exclusion takes effect the next time the device is restarted and UWF is enabled.
# $exclusion is the path of the registry exclusion
# Get the UWF_RegistryFilter configuration for the next session after a restart
$nextConfig = Get-WMIObject -class UWF_RegistryFilter @CommonParams |
where {
$_.CurrentSession -eq $false
};
# Add the exclusion
if ($nextConfig) {
$nextConfig.AddExclusion($exclusion) | Out-Null;
Write-Host "Added exclusion $exclusion.";
} else {
Write-Error "Could not retrieve UWF_RegistryFilter";
}
}
function Remove-RegistryExclusion($exclusion) {
# This function removes a UWF registry exclusion.
# The registry exclusion is removed the next time the device is restarted
# $exclusion is the path of the registry exclusion
# Get the UWF_RegistryFilter configuration for the next session after a restart
$nextConfig = Get-WMIObject -class UWF_RegistryFilter @CommonParams |
where {
$_.CurrentSession -eq $false
};
# Try to remove the exclusion
if ($nextConfig) {
try {
$nextConfig.RemoveExclusion($exclusion) | Out-Null;
Write-Host "Removed exclusion $exclusion.";
} catch {
Write-Host "Could not remove exclusion $exclusion."
}
} else {
Write-Error "Could not retrieve UWF_RegistryFilter";
}
}
function Clear-RegistryExclusions() {
# This function removes all UWF registry exclusions
# The registry exclusions are removed the next time the device is restarted
# Get the configuration for the next session
$nextConfig = Get-WMIObject -class UWF_RegistryFilter @CommonParams |
where {
$_.CurrentSession -eq $false
};
# Remove all registry exclusions
if ($nextConfig) {
Write-Host "Removing all registry exclusions:";
$nextExcludedList = $nextConfig.GetExclusions()
if ($nextExcludedList) {
foreach ($registryExclusion in $nextExcludedList.ExcludedKeys) {
Write-Host "Removing:" $registryExclusion.RegistryKey
$nextConfig.RemoveExclusion($registryExclusion.RegistryKey) | Out-Null
}
} else {
Write-Host "No registry exclusions to remove."
}
Write-Host ""
}
}
# Some examples of using the functions
Clear-RegistryExclusions
Get-RegistryExclusions
Add-RegistryExclusion "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer"
Add-RegistryExclusion "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers\(Default)"
Get-RegistryExclusions
Remove-RegistryExclusion "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer"
Get-RegistryExclusions
Clear-RegistryExclusions
요구 사항
Windows 버전 | 지원함 |
---|---|
Windows Home | 아니오 |
Windows Pro | 아니오 |
Windows Enterprise | 예 |
Windows Education | 예 |
Windows IoT Enterprise | 예 |