{"id":1287,"date":"2014-01-26T20:47:10","date_gmt":"2014-01-26T19:47:10","guid":{"rendered":"http:\/\/sccmfaq.wordpress.com\/?p=1287"},"modified":"2014-01-26T20:47:10","modified_gmt":"2014-01-26T19:47:10","slug":"sccm-2012-r2-byod-with-windows-to-go-and-bitlocker-in-enterprise","status":"publish","type":"post","link":"https:\/\/blog.hosebei.ch\/?p=1287","title":{"rendered":"SCCM 2012 R2 &#8211; BYOD with Windows To Go and Bitlocker in Enterprise"},"content":{"rendered":"<p>Hi there, here&#8217;s Martin again.<\/p>\n<p>My last Blog Post was about to create a Windows 8.1 To Go deployment with System Center 2012 Configuration Manager R2, and which configurations are required or are nice to set. In this Blog post, I tell you about how I expand the Task Sequence with enabling Bitlocker for the Windows ToGo and how to set a computername.<!--more--><\/p>\n<p>First, this process is also described on TechNet: http:\/\/technet.microsoft.com\/en-us\/library\/jj651035.aspx<br \/>\nNote that the Task Sequence Variable &#8220;OSDBitLockerPIN&#8221; has to be set.<\/p>\n<p>Your first step in the process of enabling Bitlocker for Windows To Go depends, on where would you like to save the recovery Password. I would suggest you to save them in Active Directory. For all questions about Bitlocker and recovery Password, please refer to the appropriate TechNet articles depending on your needs.<\/p>\n<p>You have then to create a package, which includes the Windows To Go Bitlocker tool for enabling the encryption. Navigate to the following folder below your SCCM Installation Directory:<br \/>\n$InstallDirectoryOSDToolsWTGBitLocker<br \/>\nCopy the entire Content to your package Location and create a new package. When creating the Bitlocker ToGo package, there is no need to create a program, do not forget to distribute the package on a Distribution Point!<br \/>\nWhen this is done, open your Task Sequence and add a &#8220;Run Command Line&#8221; step to your Task Sequence:<br \/>\n<a href=\"http:\/\/hosebei.wordpress.com\/wp-content\/uploads\/2014\/01\/bitlockertogo01.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/hosebei.wordpress.com\/wp-content\/uploads\/2014\/01\/bitlockertogo01.png?w=300\" alt=\"BitlockerToGo01\" width=\"300\" height=\"248\" class=\"aligncenter size-medium wp-image-1289\" srcset=\"https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2014\/01\/bitlockertogo01.png 769w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2014\/01\/bitlockertogo01-300x249.png 300w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nIn the example of the TechNet article, the x86 Version of the program is used. My Windows 8.1 is a x64 Version, so my command line ist:<br \/>\n<code>x64osdbitlocker_wtg.exe \/Enable \/pwd:AD<\/code><br \/>\nThe switch \/pwd:AD does requires the process to store the bitlocker recovery key to Active Directory. As package, choose your bitlocker Togo package, which you have created before.<br \/>\nImportant: Set the following Option, that this step will only be run in a Windows To Go Environment:<br \/>\nTask Sequence Variable &#8220;_SMSTSWTG&#8221; equals &#8220;True&#8221;:<br \/>\n<a href=\"http:\/\/hosebei.wordpress.com\/wp-content\/uploads\/2014\/01\/bitlockertogo02.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/hosebei.wordpress.com\/wp-content\/uploads\/2014\/01\/bitlockertogo02.png?w=300\" alt=\"Run command Line Step option\" width=\"300\" height=\"247\" class=\"aligncenter size-medium wp-image-1292\" srcset=\"https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2014\/01\/bitlockertogo02.png 775w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2014\/01\/bitlockertogo02-300x247.png 300w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2014\/01\/bitlockertogo02-768x633.png 768w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Your Task Sequence is done, you could create your prestage media. But wait, think about how to set your variable OSDBitLockerPIN, which is necessary to enable Bitlocker To Go! This Pin Code has to be 8 digit long for minimum and 64 digit in maximum. If characters are allowed depends on your Group Policy Setting, the option enhanced Pin Codes is to check.<br \/>\nWhile on testing, I added this variable hardcoded to the variable while creating the prestage media as defined variable. But since I already added this simple script for prestart command to get a TS start delay and set an appropriate computername:<br \/>\n<code>wscript.sleep(45000)<br \/>\nstrComputerName = InputBox(\"Enter computername\")<br \/>\nSet env = CreateObject(\"Microsoft.SMS.TSEnvironment\")<br \/>\nenv(\"OSDComputerName\") = strComputerName<br \/>\n<\/code><br \/>\nI added some lines to also ask for the bitlocker key. I also added a check, if the Computer Name is valid, and if the bitlocker pin code is valid. A missing Point is the check against the Active Directory, because if you choose a computername which is already in use, the TS will overwrite this one. You will find the script copy \/pasted at the end of the blog post, and also under this link: https:\/\/skydrive.live.com\/redir?resid=65440BAA507106AD%21700<\/p>\n<p>The Script has 3 variables, that are to set by you:<br \/>\n<code>iBootDelay = 45\t\t\t\t\t'Time in second the TS waits before start, important to get network up and running<br \/>\nbBitLockerEnabled = \"True\"\t\t'If set to True, script will ask for BitlockerPin<br \/>\nvTSDeploymentID = \"S01000C4\"\t'Has to be set to your deployment on the unkown computer collection<\/code><br \/>\nSelf-explanatory I hope \ud83d\ude42<\/p>\n<p>For the script, just create a new package or use an existing, and then add the package with the script to the prestart command wizard:<br \/>\n<a href=\"http:\/\/hosebei.wordpress.com\/wp-content\/uploads\/2014\/01\/bitlockertogo03.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/hosebei.wordpress.com\/wp-content\/uploads\/2014\/01\/bitlockertogo03.png?w=300\" alt=\"Script Usage\" width=\"300\" height=\"271\" class=\"aligncenter size-medium wp-image-1302\" srcset=\"https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2014\/01\/bitlockertogo03.png 714w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2014\/01\/bitlockertogo03-300x272.png 300w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>If there are enough comments for AD integrated computername check, I will update the Script and blogpost.<br \/>\nAny other suggestions to the script and other ideas are warmly welcome.<\/p>\n<p>Two ideas I already got is:<br \/>\n-User Primary device<br \/>\n-Language Selection<\/p>\n<p>But as stated above, only when some People are asking for it.<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8211;Script&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n<code>' Region Description<br \/>\n'<br \/>\n' Name: prestage1.0.vbs<br \/>\n' Author: martin w\u00fcthrich<br \/>\n' Version: 1.0<br \/>\n' Description: Used for Windows ToGo deployments<br \/>\n'<br \/>\n'<br \/>\n' EndRegion<\/p>\n<p>Option Explicit<\/p>\n<p>Dim iBootDelay<br \/>\nDim bComputerNameOK, bBitLockerEnabled<br \/>\nDim vComputername, vTSDeploymentID<br \/>\nDim oTSenvironment<\/p>\n<p>'User defined variables<br \/>\niBootDelay = 45\t\t\t\t\t'Time in second the TS waits before start, important to get network up and running<br \/>\nbBitLockerEnabled = \"True\"\t\t'If set to True, script will ask for BitlockerPin<br \/>\nvTSDeploymentID = \"S01000C4\"\t'Has to be set to your deployment on the unkown computer collection<\/p>\n<p>'------------------------------------<br \/>\n'Main Script<\/p>\n<p>'Sleep before start<br \/>\nWScript.sleep(iBootDelay * 1000)<\/p>\n<p>'Set Task Sequence environment object<br \/>\nSet oTSenvironment = CreateObject(\"Microsoft.SMS.TSEnvironment\")<br \/>\n'Set TS Deployment ID<br \/>\noTSenvironment(\"SMSTSPreferredAdvertID\") = vTSDeploymentID<\/p>\n<p>'------------------------------------<br \/>\n'ask For computername<br \/>\nDo While bComputerNameOK  \"OK\"<br \/>\n\tvComputername = InputBox(\"Enter computername (allowed chars [Aa-Zz], [0-9]; max 14 chars)\")<br \/>\n\tbComputerNameOK = fCheckComputername(vComputername)<\/p>\n<p>\t'Check Against AD<br \/>\n\t'probably in future release... :)<\/p>\n<p>Loop<br \/>\n'Set TS Variable<br \/>\noTSenvironment(\"OSDComputerName\") = vComputername<\/p>\n<p>'------------------------------------<br \/>\n'Ask For Bitlocker Pin Code<br \/>\nIf bBitLockerEnabled = \"True\" Then<br \/>\n\tDim vBitlockerCode<br \/>\n\tDim bBitlockerCode<br \/>\n\tDo While bBitlockerCode  \"OK\"<br \/>\n\t\tvBitlockerCode = InputBox(\"Enter BitlockerPin ((allowed chars [0-9]; min 8 chars max 64 chars)\")<br \/>\n\t\tbBitlockerCode = fBitlockerCode(vBitlockerCode)<\/p>\n<p>\tLoop<br \/>\n\t'Set TS Variable<br \/>\n\toTSenvironment(\"OSDBitLockerPIN\") = vBitlockerCode<\/p>\n<p>End If<\/p>\n<p>'Functions<br \/>\nFunction fCheckComputername(vComputernameCheck)<br \/>\n\tDim iCheckNumber, sChar<br \/>\n\tfCheckComputername = \"OK\"<\/p>\n<p>\tFor iCheckNumber = 1 To Len(vComputernameCheck)<br \/>\n    \tsChar = Mid(vComputernameCheck,iCheckNumber,1)<br \/>\n      \tIf (Asc(sChar) &gt; 96 And Asc(sChar)  47 And Asc(sChar)  14 Then<br \/>\n\t\tfCheckComputername = \"NotOK\"<br \/>\n\tEnd If<\/p>\n<p>End Function<\/p>\n<p>Function fBitlockerCode(vPinCodeCheck)<\/p>\n<p>\tDim iCheckNumber, sChar<br \/>\n\tfBitlockerCode = \"OK\"<\/p>\n<p>\tFor iCheckNumber = 1 To Len(vPinCodeCheck)<br \/>\n\t\tsChar = Mid(vPinCodeCheck,iCheckNumber,1)<br \/>\n    \tIf sChar = 0 Or sChar = 1 Or sChar = 2 Or sChar = 3 Or sChar = 4 Or sChar = 5 Or sChar = 6 Or sChar = 7 Or sChar = 8 Or sChar = 9 Then<br \/>\n        \t' Do nothing with Chars [0-9]<br \/>\n      \tElse<br \/>\n\t\t\tfBitlockerCode = \"NotOK\"<br \/>\n\t\t\tExit For<br \/>\n\t\tEnd If<br \/>\n\tNext<\/p>\n<p>\tIf Len(vPinCodeCheck) &gt;= 8 And Len(vPinCodeCheck) &lt;= 64 Then<br \/>\n\t\t&#039;Pin is OK<br \/>\n\tElse<br \/>\n\t\tfBitlockerCode = &quot;NotOK&quot;<\/p>\n<p>\tEnd If<\/p>\n<p>End Function<\/p>\n<p><\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi there, here&#8217;s Martin again. My last Blog Post was about to create a Windows 8.1 To Go deployment with System Center 2012 Configuration Manager R2, and which configurations are required or are nice to set. In this Blog post, I tell you about how I expand the Task Sequence with enabling Bitlocker for the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,10,27],"tags":[],"class_list":["post-1287","post","type-post","status-publish","format-standard","hentry","category-bitlocker","category-byod","category-operating-system-deployment"],"_links":{"self":[{"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=\/wp\/v2\/posts\/1287","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1287"}],"version-history":[{"count":0,"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=\/wp\/v2\/posts\/1287\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1287"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1287"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1287"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}