次の方法で共有


WEDF_ProtectedProcess (Industry 8.1)

7/8/2014

Review the syntax, members, and examples of the WEDF_ProtectedProcess WMI provider class for Windows Embedded 8.1 Industry (Industry 8.1).

This class exempts windows that are created in specific processes from the default action that Dialog Filter performs. Dialog Filter still blocks windows that are in the blocked window list, even if they are created by a protected process.

Syntax

class WEDF_ProtectedProcess {
    [key] uint32 id;
    string processName;
    [Static] uint32 GetProtectedProcess (
         [Out, EmbeddedInstance("WEDF_ProtectedProcess")] string cmdletOutput[]
    );
    [Static] uint32 Clear();
    [Static] uint32 RemoveProtectedProcess (
        [In] uint32 process[]
    );
    [Static] uint32 AddProtectedProcess (
        [In, EmbeddedInstance("WEDF_ProtectedProcess")] string processes[],
        [Out] uint32 cmdletOutput[]
    );
};

Members

The following tables list the methods and properties that belong to this class.

Methods

Method

Description

WEDF_ProtectedProcess.AddProtectedProcess

Adds an array of WEDF_ProtectedProcess objects to the list of protected processes that are exempt from the default action specified for Dialog Filter.

WEDF_ProtectedProcess.Clear

Removes all processes from the list of protected processes for Dialog Filter.

WEDF_ProtectedProcess.GetProtectedProcess

Gets an array of WEDF_ProtectedProcess objects that represents the protected processes that are exempt from the default action specified for Dialog Filter.

WEDF_ProtectedProcess.RemoveProtectedProcess

Removes specified processes from the list of protected processes for Dialog Filter.

Properties

Property

Data type

Qualifiers

Description

id

uint32

[key]

A unique identifier for the protected process configuration.

processName

string

The full path of the protected process (for example, “C:\Program Files\Internet Explorer\iexplore.exe”).

Remarks

You typically protect processes when the Dialog Filter default action is set to close all top-level windows by default.

Example

The following example demonstrates how to add and remove processes from the Dialog Filter protected process list by using the Windows Management Instrumentation (WMI) provider in a Windows PowerShell script.

$COMPUTER = "localhost"
$NAMESPACE = "root\standardcimv2\embedded"

# Define common parameters

$CommonParams = @{"namespace"=$NAMESPACE; "computer"=$COMPUTER}

# Create a handle to the class instance so that we can call the static methods

$classProtectedProcess =  [wmiclass]"\\$COMPUTER\${NAMESPACE}:WEDF_ProtectedProcess"

function Add-ProtectedProcess($processPath) {

# Add a process to the list of protected processes

    Set-WMIInstance -class WEDF_ProtectedProcess -arguments @{processName=$processPath} @CommonParams | Out-Null
        
    Write-Host "Added protected process $processPath";
}

function Remove-ProtectedProcess($processPath) {

# Remove a process from the list of protected processes

    $processEntry = Get-WmiObject -class WEDF_ProtectedProcess @CommonParams | where {
        $_.processName -eq $processPath
    }

# If the process is protected, remove it from the list of protected processes

    if ($processEntry) {
        $classProtectedProcess.RemoveProtectedProcess($processEntry.id) | Out-Null
    }
        
    Write-Host "Removed protected process $processPath";
}

# Demonstrate how to clear, add, and remove protected processes

$classProtectedProcess.Clear()

Add-ProtectedProcess "C:\Program Files\Microsoft Security Client\msseces.exe"
Add-ProtectedProcess "C:\Program Files\internet explorer\iexplore.exe"

Remove-ProtectedProcess("C:\Program Files\internet explorer\iexplore.exe") 

See Also

Reference

Dialog Filter WMI provider reference

Concepts

Dialog Filter