次の方法で共有


UWF_Servicing

このクラスには、統合書き込みフィルター (UWF) サービス モードを照会および制御できるプロパティとメソッドが含まれています。

構文

class UWF_Servicing {
    [key, read] boolean CurrentSession;
    [read] boolean ServicingEnabled;

    UInt32 Enable();
    UInt32 Disable();
    UInt32 UpdateWindows(
        [out] UInt32 UpdateStatus
    );
};

Members

次の表に、このクラスに属するメソッドとプロパティを示します。

メソッド

メソッド 説明
UWF_Servicing.Disable 統合書き込みフィルター (UWF) サービス モードを無効にします。
システムは、再起動後の次のセッションでサービス モードを終了します。
UWF_Servicing.Enable 統合書き込みフィルター (UWF) サービス モードを有効にします
システムは、再起動後の次のセッションでサービス モードに入ります。
UWF_Servicing.UpdateWindows Windows Updateを呼び出して、Windows 10 Enterpriseを実行しているデバイスの重要な更新プログラムとセキュリティ更新プログラムをダウンロードしてインストールします。

プロパティ

プロパティ データ型 修飾子 説明 &
CurrentSession ブール値 [キー、読み取り] サービスを有効にするタイミングを示します。
- 現在のセッションでサービスが有効になっている場合は True
- 再起動後のセッションでサービスが有効になる場合はFalse
ServiceEnabled ブール値 [read] システムが現在のセッションでサービス モードになっているか、再起動後の次のセッションでサービス モードになるかどうかを示します
- サービス が有効な場合は True
-それ以外の場合は False

注釈

このクラスには、現在のセッション用と再起動後の次のセッション用の 2 つのインスタンスしかありません。

次の例は、PowerShell スクリプトで Windows Management Instrumentation (WMI) プロバイダーを使用して、デバイスで UWF サービス モードを有効または無効にする方法を示しています。

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

# Define common parameters

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

# Enable UWF servicing

$nextSession = Get-WmiObject -class UWF_Servicing @CommonParams | where {
    $_.CurrentSession -eq $false
}

if ($nextSession) {

    $nextSession.Enable() | Out-Null;
    Write-Host "This device is enabled for servicing mode after the next restart."
}

# Disable UWF servicing

$nextSession = Get-WmiObject -class UWF_Servicing @CommonParams | where {
    $_.CurrentSession -eq $false
}

if ($nextSession) {

    $nextSession.Disable() | Out-Null;
    Write-Host "Servicing mode is now disabled for this device."
}

要件

Windows エディション サポートされています
Windows ホーム なし
Windows Pro なし
Windows Enterprise はい
Windows Education はい
Windows IoT Enterprise