Compartir a través de


UWF_Filter

Habilita o deshabilita el filtro de escritura unificado (UWF), restablece la configuración de UWF y apaga o reinicia el dispositivo.

Sintaxis

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

Miembros

En las tablas siguientes se enumeran los métodos y propiedades que pertenecen a esta clase.

Métodos

Métodos Descripción
UWF_Filter.Enable Habilita UWF en el siguiente reinicio.
UWF_Filter.Disable Deshabilita UWF en el siguiente reinicio.
UWF_Filter.ResetSettings Restaura la configuración de UWF al estado original que se capturó en tiempo de instalación.
UWF_Filter.ShutdownSystem Apaga de forma segura un sistema protegido por UWF, incluso si la superposición está llena.
UWF_Filter.RestartSystem Reinicia de forma segura un sistema protegido por UWF, incluso si la superposición está llena.

Propiedades

Propiedad Tipo de datos Calificadores Descripción
Identificación string [key] Un identificador único. Siempre se establece en UWF_Filter
CurrentEnabled Booleano [leer] Indica si UWF está habilitado para la sesión actual.
NextEnabled Booleano [leer] Indica si UWF está habilitado después del siguiente reinicio.

Observaciones

Debe usar una cuenta de administrador para realizar cambios en la configuración de UWF. Los usuarios con cualquier tipo de cuenta pueden leer la configuración actual.

Por ejemplo:

En el ejemplo siguiente se muestra cómo habilitar o deshabilitar UWF mediante el proveedor WMI en un script de PowerShell.

El script de PowerShell crea tres funciones para ayudar a habilitar o deshabilitar UWF. A continuación, se muestra cómo usar cada función.

La primera función, Disable-UWF, recupera un objeto WMI para UWF_Filter y llama al método Disable() para deshabilitar UWF después del siguiente reinicio del dispositivo.

La segunda función, Enable-UWF, recupera un objeto WMI para UWF_Filter y llama al método Enable() para habilitar UWF después del siguiente reinicio del dispositivo.

La tercera función, Display-UWFState, examina las propiedades del objeto UWF_Filter e imprime la configuración actual de UWF_Filter.

$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

Requisitos

Edición de Windows Se admite
Windows Home No
Windows Pro No
Windows Enterprise
Windows Education
Windows IoT Enterprise