UWF_Filter

Aktiviert oder deaktiviert den Unified Write Filter (UWF), setzt Konfigurationseinstellungen für UWF zurück und beendet oder startet Ihr Gerät neu.

Syntax

class UWF_Filter{
    [key]  string Id;
    [read] boolean CurrentEnabled;
    [read] boolean NextEnabled;
    UInt32 Enable();
    UInt32 Disable();
    UInt32 ResetSettings();
    UInt32 ShutdownSystem();
    UInt32 RestartSystem();
};

Member

In den folgenden Tabellen sind alle Methoden und Eigenschaften aufgeführt, die zu dieser Klasse gehören.

Methoden

Methoden BESCHREIBUNG
UWF_Filter.Enable Aktiviert UWF für den nächsten Neustart.
UWF_Filter.Disable Deaktiviert UWF beim nächsten Neustart.
UWF_Filter.ResetSettings Stellt die UWF-Einstellungen in den orig-Inalzustand zurück, der zur Installationszeit erfasst wurde.
UWF_Filter.ShutdownSystem Schließt ein durch UWF geschütztes System sicher herunter, auch wenn die Überlagerung vollständig ist.
UWF_Filter.RestartSystem Startet sicher ein System neu, das von UWF geschützt ist, auch wenn die Überlagerung vollständig ist.

Eigenschaften

Eigenschaft Datentyp Qualifizierer BESCHREIBUNG
Id Zeichenfolge [key] Eine eindeutige ID. Dies ist immer auf UWF_Filter festgelegt.
CurrentEnabled Boolean [read] Gibt an, ob UWF für die aktuelle Sitzung aktiviert ist.
NextEnabled Boolean [read] Gibt an, ob UWF nach dem nächsten Neustart aktiviert ist.

Bemerkungen

Sie müssen ein Administratorkonto verwenden, um Änderungen an den Konfigurationseinstellungen für UWF vorzunehmen. Benutzer mit einem beliebigen Konto können die aktuellen Konfigurationseinstellungen lesen.

Beispiel

Im folgenden Beispiel wird veranschaulicht, wie Sie UWF mithilfe des WMI-Anbieters in einem PowerShell-Skript aktivieren oder deaktivieren.

Das PowerShell-Skript erstellt drei Funktionen, um UWF zu aktivieren oder zu deaktivieren. Anschließend wird veranschaulicht, wie jede Funktion verwendet wird.

Die erste Funktion Disable-UWF, ruft ein WMI-Objekt für UWF_Filter ab und ruft die Disable() -Methode auf, um UWF nach dem nächsten Geräteneustart zu deaktivieren.

Die zweite Funktion Enable-UWFruft ein WMI-Objekt für UWF_Filter ab und ruft die Enable() -Methode auf, um UWF nach dem nächsten Geräteneustart zu aktivieren.

Die dritte Funktion Display-UWFStateuntersucht die Eigenschaften des UWF_Filter-Objekts und druckt die aktuellen Einstellungen für UWF_Filter aus.

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

# Create a function to disable the Unified Write Filter driver after the next restart.
function Disable-UWF() {

# Retrieve the UWF_Filter settings.
    $objUWFInstance = Get-WMIObject -namespace $NAMESPACE -class UWF_Filter;

    if(!$objUWFInstance) {
        "Unable to retrieve Unified Write Filter settings."
        return;
    }

# Call the method to disable UWF after the next restart.  This sets the NextEnabled property to false.

    $retval = $objUWFInstance.Disable();

# Check the return value to verify that the disable is successful
    if ($retval.ReturnValue -eq 0) {
        "Unified Write Filter will be disabled after the next system restart."
    } else {
        "Unknown Error: " + "{0:x0}" -f $retval.ReturnValue
    }
}

# Create a function to enable the Unified Write Filter driver after the next restart.
function Enable-UWF() {

# Retrieve the UWF_Filter settings.
    $objUWFInstance = Get-WMIObject -namespace $NAMESPACE -class UWF_Filter;

    if(!$objUWFInstance) {
        "Unable to retrieve Unified Write Filter settings."
    return;
    }

# Call the method to enable UWF after the next restart.  This sets the NextEnabled property to false.

    $retval = $objUWFInstance.Enable();

# Check the return value to verify that the enable is successful
    if ($retval.ReturnValue -eq 0) {
        "Unified Write Filter will be enabled after the next system restart."
    } else {
        "Unknown Error: " + "{0:x0}" -f $retval.ReturnValue
    }
}

# Create a function to display the current settings of the Unified Write Filter driver.
function Display-UWFState() {

# Retrieve the UWF_Filter object
    $objUWFInstance = Get-WmiObject -Namespace $NAMESPACE -Class UWF_Filter;

    if(!$objUWFInstance) {
        "Unable to retrieve Unified Write Filter settings."
        return;
    }

# Check the CurrentEnabled property to see if UWF is enabled in the current session.
    if($objUWFInstance.CurrentEnabled) {
        $CurrentStatus = "enabled";
    } else {
        $CurrentStatus = "disabled";
    }

# Check the NextEnabled property to see if UWF is enabled or disabled after the next system restart.
    if($objUWFInstance.NextEnabled) {
        $NextStatus = "enabled";
    } else {
        $NextStatus = "disabled";
    }
}

# Some examples of how to call the functions

Display-UWFState

"Enabling Unified Write Filter"
Enable-UWF

Display-UWFState

"Disabling Unified Write Filter"
Disable-UWF

Display-UWFState

Anforderungen

Windows-Edition Unterstützt
Windows Home Nein
Windows Pro Nein
Windows Enterprise Ja
Windows Education Ja
Windows IoT Enterprise Ja