-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathLenovo_BIOS_TPM.ps1
32 lines (26 loc) · 988 Bytes
/
Lenovo_BIOS_TPM.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<#
.SYNOPSIS
Enable TPM in Lenovo BIOS on ThinkPad
.DESCRIPTION
Enable TPM via WMI for Lenovo ThinkPads - Created by Mark Godfrey @Geodesicz
.LINK
http://www.tekuits.com
#>
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true,Position=1,HelpMessage="BIOSPass")]
[ValidateNotNullOrEmpty()]
[string]$BIOSPassword
)
# Get Settings
$settings = Get-WmiObject -Namespace root/wmi -Class Lenovo_BiosSetting
# Create Set Object
$SetBIOS = Get-WmiObject -Namespace root/wmi -Class lenovo_setbiossetting
# Create Save Object
$SaveBIOS = Get-WmiObject -Namespace root/wmi -Class lenovo_savebiossettings
# Set TPM Settings
$SetBIOS.SetBiosSetting("SecurityChip,Active,$BIOSPassword,ascii,us")
$SetBIOS.SetBiosSetting("PhysicalPresenceForTpmProvision,Disable,$BIOSPassword,ascii,us")
$SetBIOS.SetBiosSetting("PhysicalPresenceForTpmClear,Enable,$BIOSPassword,ascii,us")
# Save BIOS Settings
$SaveBIOS.SaveBiosSettings("$BIOSPassword,ascii,us")