Skip to content

Password Protect a Task Sequence?

Featured Replies

Hi,

 

Would it be possible to use an AD account to protect the TS and or the FrontEnd?

/PS

  • 2 months later...
  • Replies 36
  • Views 136.5k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • yes it's possible and here's how to do it *note this happens in Windows PE*   PromptForPassword.wsf   create a blank text file in notepad called promptforpassword.wsf   paste the following into

  • A way to display the passwords using "dots" is by using a HTA instead of a WSF file.   See my used scripts in the attachment.   PromptForPassword.zip

  • I edited pollewops HTA some to include prompts for Primary User and Computer name. Edit domain on line 113 or remove it if you have mulitple. There is also a check on line 104 to 109 to check that th

Posted Images

is there a way in sccm boot image to create a contuiation screen

 

ie

 

after imput your password you get ask the question

 

Do you wish to continue?

 

yes cancel

 

cancel the machine to exsinting systems

 

the reason that i require this is that a work buddy accidently kick of a full refresh build we where testing in the lab but relized he kicked off in the live

 

estate it was not passworded, as we were still working on it

  • 3 weeks later...

I won’t like OSD blog steps are not clear & making so complicated. It’s not simple & clear posting totally I hate

Update

if you want a HTA to run within windows to prompt the user to enter a password then read this post on Technet, the code from that post is listed below, thanks Nick

 

<html>
<head>
<title>HTA Test</title>
<HTA:APPLICATION
 ID="objTest"
 APPLICATIONNAME="REBUILD"
 SCROLL="yes"
 SINGLEINSTANCE="yes"
>
</head>

<script LANGUAGE="VBScript">


Sub TestSub

set WshShell = WScript.CreateObject("WScript.Shell")

if PasswordArea.value = "password" Then
 Msgbox "Thanks password is correct. Task sequence will now continue"
 WshShell.RegWrite "HKLM\Software\REBUILD\Rebuild","00000000","REG_DWORD"
 Self.Close  
Else
 Msgbox "Sorry, password is not correct. Please try again"
End If
End Sub

</SCRIPT>

<body>


<P>MICROSOFT SCCM</p>
<P>SYSTEM REBUILD</P>
<input type="password" name="PasswordArea" size="30"><P>
<input id=runbutton  class="button" type="button" value="ENTER" name="run_button"  onClick="TestSub">

</body>

 

cheers

niall

 

I am trying to following the instructions here on creating the HTA to prompt for a password but when I use the above code, I get an error message;

Script:

Line: 10

Char: 4

Error: The end tag does not match the start tag : HTA:APPLICATION

Code: 80040022

Source: Windows Script Host

 

 

Can someone help with this?

  • 2 weeks later...

Great job.

 

Works perfect, But I have one major problem :)

 

What if the machine has Bitlocker enabled... ?

 

In order to "restart in WinPE" I need to put in a "Disable Bitlocker" step otherwise in order to prestage the Boot Image.

 

It works perfect if the right password is entered. But if the user decide to "abort" then Bitlocker will be "suspended" when the machine is turned on again.

 

Is there a workarounfd for this or do I miss something... ? :)

then your abortscript will simply do as follows

 

 

manage-bde -protectors c: -enable

 

replace c: with a variable like OSdisk, you can create the OSDISK variable using a script to check for the presence of c:\windows\explorer.exe

Thanks a lot.

 

then your abortscript will simply do as follows

 

 

 

 

replace c: with a variable like OSdisk, you can create the OSDISK variable using a script to check for the presence of c:\windows\explorer.exe

 

Thanks a lot. That might do the job.

 

I'll give it a try.

 

In the meanwhile I ended up with creating a HTA that runs in "Full OS" instead. That way I don't have to worry about if the computer is Bitlocked or not.

  • 2 months later...
  • 4 months later...
I edited pollewops HTA some to include prompts for Primary User and Computer name. Edit domain on line 113 or remove it if you have mulitple.
There is also a check on line 104 to 109 to check that the username and computername is between 5 and 10 / 15 characters.
The computername is also changed to upercase characters. And as before on line 98 change password and line 57 to 64 is the footer.
also replace the logo.jpg with your own.
I removed the checkbox for show password, cool feature but we never used it and i didnt get how to implement it with 2 new prompts.
Prompt.jpg
<title>Prompt for password</title>
<HTA:APPLICATION 
     ID="objAutoRefresh"
     APPLICATIONNAME="Auto Refresh"
     SCROLL="no"
     SINGLEINSTANCE="yes"
     WINDOWSTATE="maximize"
     icon="icon.ico"
     SHOWINTASKBAR="no"
     SYSMENU="no"
>

<link rel="stylesheet" type="text/css" href="skin.css">

<script language=vbscript>
sub activate(thebutton)
	thebutton.classname="btnb"
end sub
sub activate2(thebutton)
	thebutton.classname="btnc"
end sub
sub deactivate(thebutton)
	thebutton.classname="btna"
end sub
sub lblactivate(thebutton)
	thebutton.classname="lblb"
end sub
sub lblactivate2(thebutton)
	thebutton.classname="lblc"
end sub
sub lbldeactivate(thebutton)
	thebutton.classname="lbla"
end Sub

</script>
</head>


<SCRIPT LANGUAGE="VBScript">


on error resume next

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set WshShell = CreateObject("WScript.Shell")
Set objOSD = CreateObject("Microsoft.SMS.TSEnvironment")

Sub Window_Onload
   window.resizeTo 700,500

   window.moveTo ((screen.availWidth \ 2) - (700 \ 2)), ((screen.availHeight \ 2) - (500 \ 2))

   self.Focus()

   Support = "0000-000000"

   Footer.InnerHTML= "<HR width='100%' SIZE='2'>" & vbcrlf & _
                     "<table vAlign='bottom' border='0' width='100%'>" & vbcrlf & _
                     "<td align='left'>" & vbcrlf & _
                     "<font color='Black' size='2'>Company" & vbcrlf & _
                     "<td align='right'>" & vbcrlf & _
                     "<font color='Black' size='2'>Support " & Support & vbcrlf & _
                     "</TD>" & vbcrlf & _
                     "</table>"

	MainMenu
End Sub

Sub EnterToTab
  If Window.event.keyCode = 13 Then Window.event.keyCode = 9
End Sub

Sub Mainmenu
	Header.innerHTML = "<table width='100%' border='0' align='left'><tr><td><img src='logo.jpg'><td><class='header'>Please enter Password, Primary User and Computername<br>" & vbcrlf & _
		"And click the <b>continue</b> button.<tr><td colspan='2'><hr width='100%' SIZE='3'></table>"

	Code.innerHTML ="<table width='100%' border='0'>" & vbcrlf & _
		"<tr class='code'>" & vbcrlf & _
		"<td colspan='1' valign=''>Password:</td>" & _
		"<td colspan='2'><input type='password' name='ppassword' size='30' onkeydown='EnterToTab'></td>" & vbcrlf & _
		"<td colspan='2'></td>" & _
		"</tr>" & vbcrlf & _
		"<td colspan='1' valign=''>Primary User:</td>" & _
		"<td colspan='2'><input type='text' name='uda' size='30' onkeydown='EnterToTab'></td>" & vbcrlf & _
		"<td colspan='2'></td>" & _
		"</tr>" & vbcrlf & _
		"<td colspan='1' valign=''>Computername:</td>" & _
		"<td colspan='2'><input type='text' name='computer' size='30' onkeydown='EnterToTab'></td>" & vbcrlf & _
		"<td colspan='2'></td>" & _
		"</tr>" & vbcrlf & _
		"<tr class='code'><td colspan='5'><HR width='100%' SIZE='2'></td></tr>" & vbcrlf & _
		"<tr class='code'><td colspan='2'><input id=runbutton class='btna' onMouseOver='vbscript:activate me' onMouseOut='vbscript:deactivate me' onMouseDown='vbscript:activate2 me' type='button' value='continue' name='run_button' onClick='RunScript'>" & vbcrlf & _
    		"</table>"
	ppassword.focus
End Sub

Sub RunScript
	If ppassword.value <> "password" Then
		messages.InnerHTML = "<font color='red' size='2'>Password is not valid.<br>" & vbcrlf & _
			"<font color='black' size='2'>Retry entering the password ?<br>" & vbcrlf & _
		   	"<input class='btna' onMouseOver='vbscript:activate me' onMouseOut='vbscript:deactivate me' onMouseDown='vbscript:activate2 me' type='button' value='Yes' name='Yes_button' onClick='Yes_button'>" & vbcrlf & _
			"<input class='btna' onMouseOver='vbscript:activate me' onMouseOut='vbscript:deactivate me' onMouseDown='vbscript:activate2 me' type='button' value='No' name='No_button' onClick='No_button'>"
		Exit Sub
	ElseIf Len(uda.value) <= 4 Or Len(uda.value) > 15 Then
		messages.InnerHTML = "<font color='red' size='2'>Please enter username between 5 and 15 chars<br>"
		Exit Sub
	ElseIf Len(computer.value) <= 4 Or Len(computer.value) > 10 Then	
		messages.InnerHTML = "<font color='red' size='2'>Please enter computername between 5 and 10 chars<br>"
		Exit Sub				
	Else
		on error resume next
	 	objOSD("ALLOWOSDBUILD") = "YES"
	 	objOSD("SMSTSUdaUsers") = "domain\" & uda.value
	 	objOSD("OSDComputerName") = UCase(computer.value)
 		Set objOSD = Nothing
		window.close()
	End If 
End Sub

Sub No_button
	on error resume next
	objOSD("ALLOWOSDBUILD") = "NO"
	Set objOSD = Nothing
	window.close()
End Sub

Sub Yes_button
	messages.InnerHTML = "<font color='black' size='2'>Please try again"
	ppassword.value = ""
	ppassword.focus
End Sub


'***************************************************************************************
'****************** END SUB AREA *******************************************************
'***************************************************************************************


'***************************************************************************************
'****************** START FUNCTION AREA ************************************************
'***************************************************************************************


'***************************************************************************************
'****************** END FUNCTION AREA **************************************************
'***************************************************************************************

</SCRIPT>


<body>
<table height="100%" width="100%" border="0">

<TR>
<TD vAlign="top" height="10">
<div class="header" id="Header"></div>
</TD>
</TR>

<TR>
<TD height="200">
<div class="code" id="Code"></div>
</TD>
</TR>

<TR>
<TD align="center">
<div class="messages" id="Messages"></div>
</TD>
</TR>

<TR>
<TD align="center">
<div id="Note"></div>
</TD>
</TR>

<TR>
<TD vAlign='bottom'>
<div id="Footer"></div>
</TD>
</TR>

</html>

 

 

  • 1 month later...

Hello,

 

I'm working on utilizing the hta mechanism. One question though, is there a way to make the mdt package only contain the things I need so the package is super small? Hate to download a all those files just to get a password prompt. If not possible, not a huge deal but thought it was worth asking.

 

Thanks

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.