Powershell Commandlets - TrustedPlatformModule
Powershell Commandlets - TrustedPlatformModule
TrustedPlatformM
odule
By Les Lewis
SYNTAX
Clear-Tpm [[-OwnerAuthorization] <String>] [<CommonParameters>]
DESCRIPTION
The Clear-Tpm cmdlet resets the Trusted Platform Module (TPM) to its
default state. A reset removes the owner authorization value and any keys
stored in the TPM. To reset a TPM, you must provide a valid owner
authorization value. You can enter an owner authorization value or
specify a file that contains the value. If you do not provide a value,
the cmdlet attempts to use a value stored in the registry.
For more information on TPM, see the Trusted Platform Module Technology
Overview (http://technet.microsoft.com/en-us/library/jj131725.aspx) in
the TechNet library.
PARAMETERS
-File <String>
Specifies a file that contains the current owner authorization value for
the TPM. You can use the TPM Management Console to create this file.
Required?true
Position?named
Default valuenone
Accept pipeline input? false
Accept wildcard characters? false
-OwnerAuthorization [<String>]
Specifies the current owner authorization value for the TPM.
Required?false
Position?2
Default valuenone
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
String
This cmdlet accepts the owner authorization value for the TPM.
OUTPUTS
TpmObject
PS C:\> Clear-Tpm
TpmReady : False
TpmPresent : True
ManagedAuthLevel : Full
OwnerAuth :
OwnerClearDisabled : True
AutoProvisioning : Disabled
LockedOut : False
SelfTest : {191, 191, 245, 191...}
This command resets the TPM. The command uses the owner authorization
value stored in the registry instead of specifying a value or using a
value in a file.
This command resets the TPM by using the specified owner authorization
value.
This command resets the TPM by using the owner authorization value
included in the specified file.
RELATED LINKS
Online Version:
Get-Tpm
Initialize-Tpm
Unblock-Tpm
ConvertTo-TpmOwnerAuth
SYNOPSIS
Creates a TPM owner authorization value from a supplied string.
SYNTAX
ConvertTo-TpmOwnerAuth [-PassPhrase] <String> [<CommonParameters>]
DESCRIPTION
The ConvertTo-TpmOwnerAuth cmdlet creates a Trusted Platform Module (TPM)
owner authorization value based on a pass phrase string. A computer
requires an owner authorization value to manage a TPM.
For more information on TPM, see the Trusted Platform Module Technology
Overview (http://technet.microsoft.com/en-us/library/jj131725.aspx) in
the Technet library.
PARAMETERS
-PassPhrase <String>
Specifies a pass phrase string. This cmdlet converts the pass phrase to
an owner authorization value.
Required?true
Position?2
Default valuenone
Accept pipeline input? True (ByValue)
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
String
OUTPUTS
String
RELATED LINKS
Online Version:
Import-TpmOwnerAuth
Set-TpmOwnerAuth
Disable-TpmAutoProvisioning
SYNOPSIS
Disables TPM auto-provisioning.
SYNTAX
Disable-TpmAutoProvisioning [-OnlyForNextRestart] [<CommonParameters>]
DESCRIPTION
The Disable-TpmAutoProvisioning cmdlet disables Trusted Platform Module
(TPM) auto-provisioning. Provisioning is the process of preparing a TPM
to be used. You can disable provisioning completely or only for the next
restart. You can use the Enable-TpmAutoProvisioning cmdlet to enable
auto-provisioning.
For more information on TPM, see the Trusted Platform Module Technology
Overview (http://technet.microsoft.com/en-us/library/jj131725.aspx) in
the Technet library.
PARAMETERS
-OnlyForNextRestart [<SwitchParameter>]
Indicates that the cmdlet disables auto-provisioning only for the next
computer restart. During the restart after that, auto-provisioning
begins.
Required?false
Position?named
Default valuenone
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer,
PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
SwitchParameter
OUTPUTS
TpmObject
This cmdlet returns a TpmObject object that contains the following
information:
PS C:\> Disable-TpmAutoProvisioning
TpmReady : False
TpmPresent : True
ManagedAuthLevel : Full
OwnerAuth : OwnerClearDisabled : True
AutoProvisioning : Disabled
LockedOut : False
SelfTest : {191, 191, 245, 191...}
This command disables TPM auto-provisioning. You can use the Enable-
TpmAutoProvisioning cmdlet to enable auto-provisioning.
This command disables TPM auto-provisioning for the next restart. In the
next restart after that, auto-provisioning continues.
RELATED LINKS
Online Version:
Enable-TpmAutoProvisioning
Enable-TpmAutoProvisioning
SYNOPSIS
Enables TPM auto-provisioning.
SYNTAX
Enable-TpmAutoProvisioning [<CommonParameters>]
DESCRIPTION
The Enable-TpmAutoProvisioning cmdlet enables Trusted Platform Module
(TPM) provisioning to occur during auto-provisioning. Provisioning is the
process of preparing a TPM to be used. You can use the Disable-
TpmAutoProvisioning cmdlet to prevent auto-provisioning, either
permanently or for the next restart.
For more information on TPM, see the Trusted Platform Module Technology
Overview (http://technet.microsoft.com/en-us/library/jj131725.aspx) in
the Technet library.
PARAMETERS
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
TpmObject
PS C:\> Enable-TpmAutoProvisioning
TpmReady : False
TpmPresent : True
ManagedAuthLevel : Full
OwnerAuth : OwnerClearDisabled : True
AutoProvisioning : Enabled
LockedOut : False
SelfTest : {191, 191, 245, 191...}
RELATED LINKS
Online Version:
Disable-TpmAutoProvisioning
Get-Tpm
SYNOPSIS
Gets an object that contains information about a TPM.
SYNTAX
Get-Tpm [<CommonParameters>]
DESCRIPTION
The Get-Tpm cmdlet gets a TpmObject. This object contains information
about the Trusted Platform Module (TPM) on the current computer.
For more information on TPM, see the Trusted Platform Module Technology
Overview (http://technet.microsoft.com/en-us/library/jj131725.aspx) in
the Technet library.
PARAMETERS
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
TpmObject
PS C:\> Get-Tpm
TpmReady : False
TpmPresent : True
ManagedAuthLevel : Full
OwnerAuth :
OwnerClearDisabled : True
AutoProvisioning : Enabled
LockedOut : False
SelfTest : {191, 191, 245, 191...}
This command displays information about the TPM of the current computer.
RELATED LINKS
Online Version:
Clear-Tpm
Initialize-Tpm
Unblock-Tpm
Get-TpmEndorsementKeyInfo
SYNOPSIS
Gets information about the endorsement key and certificates of the TPM.
SYNTAX
Get-TpmEndorsementKeyInfo [[-HashAlgorithm] <String>]
[<CommonParameters>]
DESCRIPTION
The Get-TpmEndorsementKeyInfo cmdlet gets information about the
endorsement public key and certificates of the Trusted Platform Module
(TPM).
PARAMETERS
-HashAlgorithm [<String>]
Specifies the hash algorithm used for the public key. The acceptable
values for this parameter are: Sha256.
Required?false
Position?2
Default valuenone
Accept pipeline input? True (ByValue)
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer,
PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
String
This accepts the name of the algorithm, as a string, used to hash the
public key. Sha256 is the only supported algorithm.
OUTPUTS
EndorsementKeyObject
[Issuer]
CN=Contoso TPM CA1, OU=Contoso
Certification Authority, O=Contoso, C=KR
[Serial Number]
77A120A
[Not Before]
6/4/2012 6:35:58 PM
[Not After]
6/4/2022 6:35:57 PM
[Thumbprint]
77378D1480AB48FEA2D4E610B2C7EEF648FEA2
}
AdditionalCertificates : {}
This command gets information about the endorsement key of the TPM. The
command uses the Sha256 algorithm to hash the public key.
RELATED LINKS
Online Version:
Trusted Platform Module Cmdlets in Windows PowerShell
Get-TpmSupportedFeature
SYNOPSIS
Verifies whether a TPM supports specified features.
SYNTAX
Get-TpmSupportedFeature [[-FeatureList] <StringCollection>]
[<CommonParameters>]
DESCRIPTION
The Get-TpmSupportedFeature cmdlet verifies whether a Trusted Platform
Module (TPM) supports specified TPM features. Not all TPMs support all
features.
PARAMETERS
-FeatureList [<StringCollection>]
Specifies feature names as a string collection. The cmdlet verifies the
features that you specify. If you specify an empty collection, $Null,
or do not include this parameter, the cmdlet verifies all features.
Required?false
Position?2
Default valuenone
Accept pipeline input? True (ByValue)
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
StringCollection
OUTPUTS
StringCollection
This command verifies whether TPM supports the key attestation feature.
The cmdlet displays the string, key attestation, so TPM supports that
feature.
RELATED LINKS
Online Version:
Trusted Platform Module Cmdlets in Windows PowerShell
Import-TpmOwnerAuth
SYNOPSIS
Imports a TPM owner authorization value to the registry.
SYNTAX
Import-TpmOwnerAuth -File <String> [<CommonParameters>]
DESCRIPTION
The Import-TpmOwnerAuth cmdlet imports a valid Trusted Platform Module
(TPM) owner authorization value to the registry.
For more information on TPM, see the Trusted Platform Module Technology
Overview (http://technet.microsoft.com/en-us/library/jj131725.aspx) in
the Technet library.
PARAMETERS
-File <String>
Specifies a file that contains the current owner authorization value for
the TPM. You can use the TPM Management Console to create this file.
Required?true
Position?named
Default valuenone
Accept pipeline input? false
Accept wildcard characters? false
-OwnerAuthorization <String>
Specifies the current owner authorization value for the TPM.
Required?true
Position?2
Default valuenone
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
String
This command imports the owner authorization value in the specified file
to the registry.
RELATED LINKS
Online Version:
ConvertTo-TpmOwnerAuth
Set-TpmOwnerAuth
Initialize-Tpm
SYNOPSIS
Performs part of the provisioning process for a TPM.
SYNTAX
Initialize-Tpm [[-AllowClear]] [[-AllowPhysicalPresence]]
[<CommonParameters>]
DESCRIPTION
The Initialize-Tpm cmdlet performs part of the provisioning process for a
Trusted Platform Module (TPM). Provisioning is the process of preparing
a TPM to be used. You may need to perform other steps to fully provision
a TPM.
For more information on TPM, see the Trusted Platform Module Technology
Overview (http://technet.microsoft.com/en-us/library/jj131725.aspx) in
the Technet library.
PARAMETERS
-AllowClear [<SwitchParameter>]
Indicates that the provisioning process clears the TPM, if necessary, to
move the TPM closer to complying with Windows Server® 2012 standards.
Required?false
Position?2
Default valuenone
Accept pipeline input? false
Accept wildcard characters? false
-AllowPhysicalPresence [<SwitchParameter>]
Indicates that the provisioning process may send physical presence
commands that require a user to be present in order to continue.
Required?false
Position?3
Default valuenone
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
SwitchParameter
OUTPUTS
TpmProvisioningObject
The cmdlet returns an object with information about the state of the
provisioning process.
RELATED LINKS
Online Version:
Clear-Tpm
Get-Tpm
Unblock-Tpm
Set-TpmOwnerAuth
SYNOPSIS
Changes the TPM owner authorization value.
SYNTAX
Set-TpmOwnerAuth -File <String> -NewFile <String> [<CommonParameters>]
DESCRIPTION
The Set-TpmOwnerAuth cmdlet changes the current owner authorization value
of the Trusted Platform Module (TPM) to a new value. You can specify
the current owner authorization value or specify a file that contains the
current owner authorization value. If you do not specify an owner
authorization value, the cmdlet attempts to read the value from the
registry.
PARAMETERS
-File <String>
Specifies a file that contains the current owner authorization value for
the TPM. You can use the TPM Management Console to create this file.
Required?true
Position?named
Default valuenone
Accept pipeline input? false
Accept wildcard characters? false
-NewFile <String>
Specifies a file that contains the new owner authorization value for a
TPM.
Required?true
Position?named
Default valuenone
Accept pipeline input? false
Accept wildcard characters? false
-NewOwnerAuthorization <String>
Specifies a new owner authorization value for a TPM.
Required?true
Position?named
Default valuenone
Accept pipeline input? True (ByValue)
Accept wildcard characters? false
-OwnerAuthorization [<String>]
Specifies the current owner authorization value for a TPM.
Required?false
Position?1
Default valuenone
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
String
This cmdlet accepts the owner authorization value for the TPM.
OUTPUTS
TpmObject
This command replaces the current owner authorization value with the
specified owner authorization value. The command does not specify the
current owner authorization value, so the cmdlet attempts to find it in
the registry. This command does not import the owner authorization value
into the registry. After you run this command, you can use the Import-
TpmOwnerAuth cmdlet to import the new value into the registry, if
necessary.
This command replaces the current owner authorization value with the
owner authorization value in the specified file.
This command replaces the specified owner authorization value with a new
owner authorization value.
RELATED LINKS
Online Version:
ConvertTo-TpmOwnerAuth
Import-TpmOwnerAuth
Unblock-Tpm
SYNOPSIS
Resets a TPM lockout.
SYNTAX
Unblock-Tpm [[-OwnerAuthorization] <String>] [<CommonParameters>]
DESCRIPTION
The Unblock-Tpm cmdlet resets a Trusted Platform Module (TPM) lockout.
TPM locks itself to prevent tampering or attack. This is called a
lockout.
To end a TPM lockout, you must provide a valid owner authorization value.
You can enter an owner authorization value or specify a file that
contains the value. If you do not provide a value, the cmdlet attempts to
use a value stored in the registry.
For more information on TPM, see the Trusted Platform Module Technology
Overview (http://technet.microsoft.com/en-us/library/jj131725.aspx) in
the Technet library.
PARAMETERS
-File <String>
Specifies a file that contains the current owner authorization value for
the TPM. You can use the TPM Management Console to create this file.
Required?true
Position?named
Default valuenone
Accept pipeline input? false
Accept wildcard characters? false
-OwnerAuthorization [<String>]
Specifies the current owner authorization value for the TPM.
Required?false
Position?2
Default valuenone
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
TpmObject
NOTES
Be sure to understand the protection logic TPM uses. The TPM allows at
least one attempt to reset the TPM lockout by using the owner
authorization value. For more information, see the Reset the TPM Lockout
(http://technet.microsoft.com/en-us/library/dd851452.aspx) topic in
the Technet library.
This command resets a TPM lockout. The command specifies the owner
authorization value vjnuW6rToM41os3xxEpjLdIW2gA=.
RELATED LINKS
Online Version:
Clear-Tpm
Get-Tpm
Initialize-Tpm