Enable the Trusted Platform Module on a Dell OMCI client

 
More TPM madness For Dell users only:
Begin vbScript
 
‘**********************************************************************
‘*** Name: SampleTrustedPlatformModule.vbs
‘*** Purpose: To Enable the Trusted Platform Module on a Dell OMCI client.
‘*** Usage: cscript.exe //nologo SampleTrustedPlatformModule.vbs <systemname>
‘*** Make sure to open a cmd.com shell as administrator in Vista otherwise UAC will
‘***  cause it to error out.
‘***
‘*** NOTE: Replace the word yourpassword at the end of line 51 (inside the
‘*** quotes) with the correct BIOS password if one is set.
‘***
‘*** To only Activate the TPM comment out line 70 “objInstance.Properties_.Item(strPropNameTpmON).Value = 3”
‘**********************************************************************
Option Explicit
‘*** Declare variables
Dim strNameSpace
Dim strComputerName
Dim strClassName
Dim strKeyValue
Dim objInstance
Dim strPropNameTpmON
Dim strPropNameTpmActivation
Dim strPropValue
‘*** Check that the right executable was used to run the script
‘*** and that all parameters were passed
If (LCase(Right(WScript.FullName, 11)) = "wscript.exe" ) Or _
    (Wscript.Arguments.Count < 1) Then
    Call Usage()
    WScript.Quit
End If
‘*** Initialize variables
strNameSpace = "root/Dellomci"
strComputerName = WScript.Arguments(0)
strClassName = "Dell_Configuration"
strKeyValue = "Configuration"
‘*** Retrieve the instance of Dell_Configuration class (there should
‘*** only be 1 instance).
Set objInstance = GetObject("WinMgmts:{impersonationLevel=impersonate,AuthenticationLevel=pktprivacy}//" &_
    strComputerName & "/" & strNameSpace & ":" & strClassName & "=" &_
    Chr(34) & strKeyValue & Chr(34))
‘*** Verify the BIOS Admin Password to enable changes to BIOS settings
‘*** Replace ‘password’ in the next line with the BIOS Admin password
objInstance.Properties_.Item("Password").Value = "dell123"
objInstance.Properties_.Item("PasswordEncrypted").Value = 0
objInstance.Put_
‘*** Initialize variables
strClassName = "Dell_SMBIOSSettings"
strKeyValue = "0"
strPropNameTpmON = "TrustedPlatformModule"
strPropNameTpmActivation = "TrustedPlatformModuleActivation"
‘*** Retrieve the instance of Dell_SMBIOSSettings class (there should
‘*** only be 1 instance).
Set objInstance = GetObject("WinMgmts:{impersonationLevel=impersonate,AuthenticationLevel=pktprivacy}//" &_
    strComputerName & "/" & strNameSpace & ":" & strClassName & "=" &_
    Chr(34) & strKeyValue & Chr(34))
‘*** Set the value of TrustedPlatformModule to ‘3’ ("Enabled")
‘*** Set the new value for the property and save the instance
objInstance.Properties_.Item(strPropNameTpmON).Value = 3
‘*** Set the value of TrustedPlatformModuleActivation to ‘3’ ("Activated")
‘*** Set the new value for the property and save the instance
objInstance.Properties_.Item(strPropNameTpmActivation).Value = 3
objInstance.Put_
‘*** If any errors occurred, let the user know
If Err.Number <> 0 Then
    WScript.Echo "Enabling Trusted Platform Module failed."
End If
‘*** Sub used to display the correct usage of the script
Sub Usage()
Dim strMessage
strMessage = "incorrect syntax. You should run: " & vbCRLF & _
    "cscript.exe /nologo SampleTrustedPlatformModule.vbs <systemname>"
WScript.Echo strMessage
End Sub
Advertisements

One thought on “Enable the Trusted Platform Module on a Dell OMCI client

  1. If you need to use Powershell for this same feature just use the following script

    param($computername)
    (gwmi DCIM_BIOSService -namespace root\dcim\sysman -computername $Computername).SetBIOSAttributes($null,$null,”Trusted Platform Module”,”2″)
    RESTART-COMPUTER -computername $Computername -force

    TPM will be enabled after the PC reboot

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s