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(통합 쓰기 필터)에 대한 레지스트리 제외 목록에서 레지스트리 키를 제거합니다.

속성

속성 데이터 형식 한정자 Description
CurrentSession Boolean [key, read] 개체에 어떤 세션의 설정이 포함되어 있는지를 나타냅니다.
- True이면 현재 세션
- 에 대한 설정이 False이면 다시 시작한 다음 세션에 대한 설정입니다.
PersistDomainSecretKey Boolean [read, write] 도메인 비밀 레지스트리 키가 레지스트리 제외 목록에 있는지를 나타냅니다. 레지스트리 키가 제외 목록에 없으면 다시 시작한 후에도 변경 내용이 유지되지 않습니다.
- 제외 목록에 포함하려면 True이면 이고, 그렇지 않으면 False입니다
.
PersistTSCAL Boolean [read, write] TSCAL(터미널 서버 클라이언트 액세스 라이선스) 레지스트리 키가 UWF 레지스트리 제외 목록에 있는지를 나타냅니다. 레지스트리 키가 제외 목록에 없으면 다시 시작한 후에도 변경 내용이 유지되지 않습니다.
- 제외 목록에
포함하려면 True입니다. 그렇지 않으면 False로 설정합니다.

설명

PersistDomainSecretKeyPersistTSCAL 값의 변경 내용을 포함하여 레지스트리 제외의 추가 또는 제거는 다음에 다시 시작한 후에 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 No
Windows Pro No
Windows Enterprise Yes
Windows Education Yes
Windows IoT Enterprise