IntuneでWindows Sandboxを有効化する

Windows 11には「Windows Sandbox」という機能があります。

この機能は既定では無効化されているのでIntuneで有効化します。

1.PowerShellスクリプトの配布

1.Intune管理センターを開き、スクリプトを作成します。



2.任意の名前を設定し、「次へ」をクリックします。



3.下記の通り設定し、「次へ」をクリックします。

  • スクリプトの場所:<PowerShellスクリプトを指定>
  • このスクリプトをログオンしたユーザーの資格情報を使用して実行する:いいえ
  • スクリプト署名チェックを強制:いいえ
  • 64 ビットの PowerShell ホストでスクリプトを実行する:いいえ


スクリプトの中身は下記の通りです。

ファイル名:EnableWindowsSandbox.ps1
#Windowsの機能名
$WindowsFeature = "Containers-DisposableClientVM"

#Windowsの機能のステータス確認
try {
    $WindowsFeatureState = (Get-WindowsOptionalFeature -FeatureName $WindowsFeature -Online).State
}
catch {
    Write-Error "Failed to get the state of $WindowsFeature"
}

#Windowsの機能の有効化
if($WindowsFeatureState -eq "Enabled") {
    Write-Output "$WindowsFeature is Enabled"
} 
else {
    try {
        Enable-WindowsOptionalFeature -FeatureName $WindowsFeature -Online -NoRestart -ErrorAction Stop
        Write-Output "Successfully Enabled $WindowsFeature"
    }
    catch {
        Write-Error "Failed to Enable $WindowsFeature"
    }
}



4.任意の「割り当て」を設定し、「追加」をクリックします。




2.有効化の確認

「Windows Sandbox」が有効化されていることを確認します。

コメント

タイトルとURLをコピーしました