TPM が無効になっているユーザーのマシンで、TPM の有効化、アクティブ化、および所有権の取得に使用できる Powershell スクリプトに取り組んでいます。ご存じない方のために説明すると、TPM は Bitlocker が正しく機能するためのオンボード部品です。これまでの内容と、スクリプトを完成させる方法についていくつか質問があります。私はPowershellに非常に慣れていないので、質問が基本的なものである場合は事前にお詫び申し上げます. 私は周りを検索し、スクリプトのどこにいるかまですべてのヘルプを見つけました。私が見つけたもののほとんどは、スクリプトの一部としてパスワードを設定する必要があることを示していますが、ドメインコントローラーがその部分を処理しているため、それを回避しようとしています. 私も必要以上に遠くまで行くことができました。
これが私がこれまでに持っているものです:
# This script will find whether or not a specified PC\Laptop
# has its TPM enabled, activated, and owned
# All of these are needed in order for Bitlocker to work correctly.
# It will also enable, activate, and assign ownership if
# any of these parameters are not set correctly.
# THE MACHINE THIS IS RUN ON WILL NEED TO BE VPN'D OR PHYSICALLY CONNECTED TO THE DOMAIN
# This sets the variable $Tpm so the longer version of the command is no longer needed
$Tpm = Get-wmiobject -Namespace ROOT\CIMV2\Security\MicrosoftTpm -Class Win32_Tpm
# This Enables the TPM on the target mahcine
{$Tpm.IsEnabled().isenabled
if ($Tpm.IsEnabled().isenabled -eq "False") {$Tpm.Enable()}
else {write-host "TPM in Enabled"}
}
# This activates the TPM on the target machine
{$Tpm.IsActivated().isactivated
if ($Tpm.IsActivated().isactivated -eq "False") {$Tpm.Activate()}
else {write-host "TPM in Activated"}
}
# This takes ownership of the TPM on the target of the machine
# This portion will require user interaction since a acknoledgement
# will need to be confirmed on the screen.
# There are 3 parts to this portion, Clear, Take Ownership, Authorization
# This will clear the TPM so ownership can be established
{$Tpm.Clear()}
# This will take ownership of the TPM
私の質問は次のとおりです。
私が働かなければならないものに対して構文は正しいですか?
とにかくドメイン MBAM MDOP インスタンスによって Bitlocker が実行されているため、TPM を有効にしたら、さらに先に進む必要がありますか? その場合は、私の質問の残りを無視してください。
このような Powershell スクリプトを記述して、バッチ ファイルのようにこれらの複数の機能を順番に実行することはできますか?
すべてが正しければ、明確な段階にあり、TPM の所有権を取得する必要があります。ドメイン コントローラーがすべてのキーとパスキー文字列を保持するため、パスワードを入力する必要がない場合はどうすればよいですか? ユーザーが Bitlocker 用に独自のパスワードを作成することを許可したくありません。