{"id":2035,"date":"2016-10-19T14:52:11","date_gmt":"2016-10-19T14:52:11","guid":{"rendered":"http:\/\/leinss.com\/blog\/?p=2035"},"modified":"2016-10-19T14:52:11","modified_gmt":"2016-10-19T14:52:11","slug":"enable-dell-tpm-chip-with-powershell","status":"publish","type":"post","link":"https:\/\/leinss.com\/blog\/?p=2035","title":{"rendered":"Enable Dell TPM Chip with Powershell"},"content":{"rendered":"<p>Here&#8217;s some Powershell code I used to enable the Dell TPM chip with Dell Command. \u00a0The Get-Laptop function was provided by\u00a0<a href=\"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2010\/05\/15\/hey-scripting-guy-weekend-scripter-how-can-i-use-wmi-to-detect-laptops\/\">https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2010\/05\/15\/hey-scripting-guy-weekend-scripter-how-can-i-use-wmi-to-detect-laptops\/<\/a><\/p>\n<p>The &#8211;% option (that&#8217;s dash-dash%) basically just says &#8220;Powershell, just pass these arguments along and don&#8217;t try to interpret\u00a0them&#8221;. \u00a0This functionality requires Powershell v3 or later.<\/p>\n<p>Probably would have been better to use Start-Process and check if the exitcode is not zero. \u00a0Note to use Dell Command to turn on the TPM chip you need to set a BIOS password and for 64-bit systems you need to use the 64-bit version of CCTK.<\/p>\n<p><code>Function Get-Laptop<br \/>\n{<br \/>\nParam(<br \/>\n[string]$computer = \"localhost\"<br \/>\n)<br \/>\n$isLaptop = $false<br \/>\nif(Get-WmiObject -Class win32_systemenclosure -ComputerName $computer |<br \/>\nWhere-Object { $_.chassistypes -eq 9 -or $_.chassistypes -eq 10 `<br \/>\n-or $_.chassistypes -eq 14})<br \/>\n{ $isLaptop = $true }<br \/>\nif(Get-WmiObject -Class win32_battery -ComputerName $computer)<br \/>\n{ $isLaptop = $true }<br \/>\n$isLaptop<br \/>\n} # end function Get-Laptop<\/code><\/p>\n<p>If(get-Laptop) {<\/p>\n<p>.\\cctk.exe &#8211;% &#8211;setuppwd=secretpassword<br \/>\n.\\cctk.exe &#8211;% &#8211;tpm=on &#8211;valsetuppwd=secretpassword<br \/>\n.\\cctk.exe &#8211;% &#8211;tpmactivation=activate &#8211;valsetuppwd=secretpassword<br \/>\n.\\cctk.exe &#8211;% &#8211;tpm<br \/>\n.\\cctk.exe &#8211;% &#8211;tpmactivation<br \/>\n.\\MbamClientSetup.exe &#8211;% \/q \/acceptEula=Yes<br \/>\n}<\/p>\n<p>else { # do nothing }<\/p>\n<p>}<\/p>\n<p>-Soli Deo Gloria<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s some Powershell code I used to enable the Dell TPM chip with Dell Command. \u00a0The Get-Laptop function was provided by\u00a0https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2010\/05\/15\/hey-scripting-guy-weekend-scripter-how-can-i-use-wmi-to-detect-laptops\/ The &#8211;% option (that&#8217;s dash-dash%) basically just says &#8220;Powershell, just pass these arguments along and don&#8217;t try to interpret\u00a0them&#8221;. \u00a0This functionality requires Powershell v3 or later. Probably would have been better to use Start-Process &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/leinss.com\/blog\/?p=2035\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Enable Dell TPM Chip with Powershell&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[11,7],"tags":[],"class_list":["post-2035","post","type-post","status-publish","format-standard","hentry","category-powershell","category-tech-tips"],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7wiG8-wP","jetpack-related-posts":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/leinss.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2035","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/leinss.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/leinss.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/leinss.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/leinss.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2035"}],"version-history":[{"count":4,"href":"https:\/\/leinss.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2035\/revisions"}],"predecessor-version":[{"id":2039,"href":"https:\/\/leinss.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2035\/revisions\/2039"}],"wp:attachment":[{"href":"https:\/\/leinss.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2035"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/leinss.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2035"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/leinss.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2035"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}