Jump to content


  • 0
thadkew

Password Protect a Task Sequence?

Question

I have successfully set up our environment to PXE (thanks to Anyweb's many guides) and have the boot media set to use a password to get to the list of available Task Sequences, but I was wondering if there were a way to password protect a task sequence that is selected.

For example: anyone can select the task to deploy Windows XP or Windows7, however, if someone selects Windows Server 2008, something will prompt for another password and the sequence will fail if it's not correct.

 

Does that make any sense or is it possible?

 

Thanks in advance!

Share this post


Link to post
Share on other sites

Recommended Posts

  • 0

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

Share this post


Link to post
Share on other sites

  • 0

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?

Share this post


Link to post
Share on other sites

  • 0

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... ? :)

Share this post


Link to post
Share on other sites

  • 0

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

Share this post


Link to post
Share on other sites

  • 0

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.

Share this post


Link to post
Share on other sites

  • 0
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>

 

 

  • Like 1

Share this post


Link to post
Share on other sites

  • 0

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

Share this post


Link to post
Share on other sites

  • 0

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

 

of course, simply copy the files you need into a folder and create a new package containing those files only, however MDT Toolkit and settings are still needed for MDT integrated task sequences.

Share this post


Link to post
Share on other sites

Join the conversation

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

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.