Friday, June 01, 2012

Powershell script to mass import computers into MDT database

So I'm setting up a new Windows Deployment Server with MDT and have decided to try out the database function on it. To get started all you have to do is install SQL express on the server and then while in the Microsoft Deployment Toolkit crate a new database and note down what its called.

Now if your running the same kind of network I am you've got hundreds of computers and adding them one by one into the database and then going into the details and further adding information into the hundred or so fields is just not realistic, so what can you do. Well this is a very nice script that I've knocked up and it will read the contents of a CSV file and import the settings into the database.

First things first. You need to download the modules and import them into powershell. You can download the modules from Microsoft from HERE. Once done create a folder called scripts or something and then extract the files to that folder. Now go into MDT and open up your database, click on 'Computers' and on the right choose 'new'. It doesn't matter if its real or not I just want you to see the details. Click on the details tab, and see all the options on the left hand side. These can all be headers in your CSV file. Now create your CSV file with the headers of Name, Mac, Assettag and continue with the headers from the details section when you add a new computer into the database. Once you fill in the CSV and saved it you can populate the database. Try it with just a couple of computers in the CSV file to start with. You can always delete them if it doesn't work.

First change the file extension on the CSV file to  .TXT. So in the below example i've changed mine to 'machines.txt'

Now copy the below script into Notepad and save it as a .ps1 file. This will let you open it with powershell.

You'll need to change the SERVERNAME to your servers name and DATABASENAME to what ever your called your database.

Import-Module –name C:\Scripts\MDTDB.psm1

Connect-MDTDatabase –sqlServer SERVERNAME –instance SQLEXPRESS –database DATABASENAME

$machines = Import-Csv C:\scripts\machines.txt

For ($i=1; $i -le $machines.count; $i++)

{

   New-MDTComputer -macAddress $machines[$i-1].mac -AssetTag $machines[$i-1].AssetTag -description $machines[$i-1].description -settings @{

    OSInstall='YES';
    OSDComputerName=$machines[$i-1].Name;
    OrgName='My ORG'
    DomainAdmin=$machines[$i-1].DomainAdmin;
    DomainAdminDomain=$machines[$i-1].DomainAdminDomain;
    DomainAdminPassword=$machines[$i-1].DomainAdminPassword;
    JoinDomain=$machines[$i-1].JoinDomain;
    _SMSTSORGNAME=$machines[$i-1]._SMSTSORGNAME;
    AdminPassword=$machines[$i-1].AdminPassword;
    Home_page=$machines[$i-1].Home_Page;
    ProductKey=$machines[$i-1].ProductKey
    ServerA=$machines[$i-1].ServerA;
    TaskSequenceID=$machines[$i-1].TaskSequenceID;
    UserDomain=$machines[$i-1].UserDomain;
    UserID=$machines[$i-1].UserID;
    UserPassword=$machines[$i-1].UserPassword;
    KeyboardLocale=$machines[$i-1].KeyboardLocale;
    SystemLocale=$machines[$i-1].SystemLocale;
    UILanguage=$machines[$i-1].UILanguage;
    UserLocale=$machines[$i-1].UserLocale;
    SkipAdminPassword=$machines[$i-1].SkipAdminPassword;
    SkipApplications=$machines[$i-1].skipApplications;
    SkipBitLocker=$machines[$i-1].SkipBitLocker;
    SkipBitLockerDetails=$machines[$i-1].SkipBitLockerDeatils;
    SkipBuild=$machines[$i-1].SkipBuild;
    SkipCapture=$machines[$i-1].SkipCapture;
    SkipComputerBackup=$machines[$i-1].SkipComputerBackup;
    SkipComputerName=$machines[$i-1].SkipComputerName;
    SkipDeploymentType=$machines[$i-1].SkipDeploymentType;
    SkipDestinationDisk=$machines[$i-1].SkipDestinationDisk;
    SkipDomainMembership=$machines[$i-1].SkipDomainMembership;
    SkipFinalSummary=$machines[$i-1].SkipFinalSummary;
    SkipLocaleSelection=$machines[$i-1].SkipLocaleSelection;
    SkipPackageDisplay=$machines[$i-1].SkipPackageDisplay;
    SkipProductKey=$machines[$i-1].SkipProductKey;
    SkipSummary=$machines[$i-1].SkipSummary;
    SkipTaskSequence=$machines[$i-1].SkipTaskSequence;
    SkipTimeZone=$machines[$i-1].SkipTimeZone;
    SkipUserData=$machines[$i-1].SkipUserData;
    SkipWizard=$machines[$i-1].SkipWizard;
   

   }

}
You can customize this script all you want. Uts very easy. The main section simply lists all the headers i've chosen to import into the database. Make sure they are all in your CSV/TXT file or you'll have a load of missing information

Thursday, May 24, 2012

Autoit - Output selection of drop down box to text file

This one took me a little while as I had trouble outputting the selection to the text file, but its working now so here's the code

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GuiComboBoxEx.au3>


$Form1 = GUICreate("Form1", 197, 66, 192, 124)
$Label1 = GUICtrlCreateLabel("Choose number:", 10, 12, 93, 17)
$Combo1 = GUICtrlCreateCombo("Choose here...", 106, 10, 81, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "225|226|227|228|229|230")
$Button1 = GUICtrlCreateButton("Start", 50, 32, 97, 25)
Global $file = FileOpen('c:\ChangeMe.txt', 0)
GUISetState(@SW_SHOW)


While 1
    $chosen = GUICtrlRead($Combo1)
    $nMsg = GUIGetMsg()
    Switch $nMsg
               Case $GUI_EVENT_CLOSE
                     Exit
                Case $Button1
                  $chosen = GUICtrlRead($Combo1)
                  Switch $chosen
                Case "225"
                        $LogStore = FileRead($file)
                        FileClose($file)
                        $file = FileOpen('c:\ChangeMe.txt', 2)
                        FileClose($file)
                        $file = FileOpen('c:\ChangeMe.txt', 1)
                        FileWrite($file, "225 - "& @CRLF)
                        FileWrite($file, $LogStore & @CRLF)
                Case "226"
                        $LogStore = FileRead($file)
                        FileClose($file)
                        $file = FileOpen('c:\ChangeMe.txt', 2)
                        FileClose($file)
                        $file = FileOpen('c:\ChangeMe.txt', 1)
                        FileWrite($file, "226 - "& @CRLF)
                        FileWrite($file, $LogStore & @CRLF)
                Case "227"
                        $LogStore = FileRead($file)
                        FileClose($file)
                        $file = FileOpen('c:\ChangeMe.txt', 2)
                        FileClose($file)
                        $file = FileOpen('c:\ChangeMe.txt', 1)
                        FileWrite($file, "227 - "& @CRLF)
                        FileWrite($file, $LogStore & @CRLF)
                Case "228"
                        $LogStore = FileRead($file)
                        FileClose($file)
                        $file = FileOpen('c:\ChangeMe.txt', 2)
                        FileClose($file)
                        $file = FileOpen('c:\ChangeMe.txt', 1)
                        FileWrite($file, "228 - "& @CRLF)
                        FileWrite($file, $LogStore & @CRLF)
                Case "229"
                        $LogStore = FileRead($file)
                        FileClose($file)
                        $file = FileOpen('c:\ChangeMe.txt', 2)
                        FileClose($file)
                        $file = FileOpen('c:\ChangeMe.txt', 1)
                        FileWrite($file, "229 "& @CRLF)
                        FileWrite($file, $LogStore & @CRLF)
               Case "230"
                        $LogStore = FileRead($file)
                        FileClose($file)
                        $file = FileOpen('c:\ChangeMe.txt', 2)
                        FileClose($file)
                        $file = FileOpen('c:\ChangeMe.txt', 1)
                        FileWrite($file, "230 - "& @CRLF)
                        FileWrite($file, $LogStore & @CRLF)
    EndSwitch
Endswitch   
WEnd

Opening a .pages file in windows

This one is easy enough.

Simply right click on the file and choose 'rename'.

Delete the extension '.pages' and replace it with '.zip'

Then open it as you would any other zip file.

There should be a folder called 'Quickbooks' and in there is a PDF file which you can extract and open as normal.

Easy!

Thursday, April 19, 2012

Autoit - Moving Computers in Active Directory

We've just had a new building built, with lots of nice new rooms for members of staff to live in. Naturally current staff have already staked their claims to rooms, and as such its up to IT Services to move the computer equipment over to the new offices.

Obviously we've done this a few times before and we usually forget to change where the computers are in Active Directory. If you've got a structure based on room layout, then when a computer moves rooms or even to a different building then it needs moving in Active Directory as well. Like I said, we usually forget to move them, as we're normally very busy.

So I've been going round the net trying to find some free software that will pop up when one of IT log on to ask if we want to move the computer. Personally I didn't like any of them, so I decided to write my own in AutoIt.

This little program is based on the examples given in AD.au3 pack that I've talked about before. The program will start when a member of IT services logs on, and will initially ask if the computer they have logged on to has been moved. 'No' will exit the program, but 'yes' will taken them to a GUI with their Active Directory tree structure. If you then browse to the OU that you want the computer to be moved to and click 'Move Computer' it will move it for you. If you click Exit instead, the program will end. It will pop up with 2 confirmation boxes, the first checking that it is correct and the second will tell you either if its successful, or if it failed. Here's the code


#AutoIt3Wrapper_AU3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#AutoIt3Wrapper_AU3Check_Stop_OnWarning=Y

#include <AD.au3>
#include <TreeviewConstants.au3>
#include <WindowsConstants.au3>
#include <GUIConstants.au3>
#include <GuiTreeView.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>

_AD_Open()
Global $Reply = MsgBox(4,"Moved computer", "Have you moved this computer?")
If $Reply <> 6 Then Exit
  
Global $newOU = ""
Global $sTitle = "Move that stupid Computer v1.3"
Global $hMain = GUICreate($sTitle, 743, 683, -1, -1)
Global $IObject = GUICtrlCreateInput(_AD_SamAccountNameToFQDN(@ComputerName& "$"), 8, 30, 559, 21)

Global $hTree = GUICtrlCreateTreeView(6, 100, 600, 400, -1, $WS_EX_CLIENTEDGE)
Global $bExit = GUICtrlCreateButton("Exit", 624, 8, 97, 33)
Global $BOK = GUICtrlCreateButton("Move Computer", 624, 200, 97, 33)
Global $aTreeView = _AD_GetOUTreeView($newOU, $hTree)

GUICtrlCreateLabel("Object to move (FQDN or sAMAccountName):", 8, 10, 231, 17)
GUISetState(@SW_SHOW)

While 1
    Global $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE, $BExit
            Exit
        Case $BOK
            Global $sObject = GUICtrlRead($IObject)
           
            $hSelection = _GUICtrlTreeView_GetSelection($hTree)
            $sSelection = _GUICtrlTreeView_GetText($hTree, $hSelection)
            For $i = 1 To $aTreeView[0][0]
                If $hSelection = $aTreeView[$i][2] Then ExitLoop
            Next
            $sOU = $aTreeView[$i][1]
            msgbox(1,"","Currently - "&$sObject&" target - "&$sOU)
            ExitLoop
    EndSwitch
WEnd

; Move object
Global $iValue = _AD_MoveObject($sOU, $sObject)
If $iValue = 1 Then
    MsgBox(64, "Active Directory Functions - Example 1", "Object '" & $sObject & "' successfully moved to '" & $sOU & "'")
ElseIf @error = 1 Then
    MsgBox(64, "Active Directory Functions - Example 1", "Target OU '" & $sOU & "' does not exist")
ElseIf @error = 2 Then
    MsgBox(64, "Active Directory Functions - Example 1", "Object '" & $sObject & "' does not exist")
Else
    MsgBox(64, "Active Directory Functions - Example 1", "Return code '" & @error & "' from Active Directory")
EndIf
_AD_Close()


Func _AD_GetOUTreeView($sAD_OU, $hAD_TreeView, $bAD_IsADOpen = True)

    If $bAD_IsADOpen = False Then
        _AD_Open()
        If @error Then Return SetError(@error, @extended, 0)
    EndIf
    $sSeparator = "\"
    Local $aAD_OUs = _AD_GetAllOUs($sAD_OU, $sSeparator)
    If @error <> 0 Then Return SetError(@error, @extended, 0)
    Local $aAD_TreeView[$aAD_OUs[0][0] + 1][3] = [[$aAD_OUs[0][0], 3]]
    For $i = 1 To $aAD_OUs[0][0]
        $aAD_Temp = StringSplit($aAD_OUs[$i][0], $sSeparator)
        $aAD_TreeView[$i][0] = StringFormat("%" & $aAD_Temp[0] - 1 & "s", "") & "#" & $aAD_Temp[$aAD_Temp[0]]
        $aAD_TreeView[$i][1] = $aAD_OUs[$i][1]
    Next
    If $bAD_IsADOpen = False Then _AD_Close()

    _GUICtrlTreeView_BeginUpdate($hAD_TreeView)
    Local $ahAD_Node[50]
    For $iAD_Index = 1 To $aAD_TreeView[0][0]
        $sAD_Line = StringSplit(StringStripCR($aAD_TreeView[$iAD_Index][0]), @TAB)
        $iAD_Level = StringInStr($sAD_Line[1], "#")
        If $iAD_Level = 0 Then ExitLoop
        If $iAD_Level = 1 Then
            $ahAD_Node[$iAD_Level] = _GUICtrlTreeView_Add($hAD_TreeView, 0, StringMid($sAD_Line[1], $iAD_Level + 1))
            $aAD_TreeView[$iAD_Index][2] = $ahAD_Node[$iAD_Level]
        Else
            $ahAD_Node[$iAD_Level] = _GUICtrlTreeView_AddChild($hAD_TreeView, $ahAD_Node[$iAD_Level - 1], StringMid($sAD_Line[1], $iAD_Level + 1))
            $aAD_TreeView[$iAD_Index][2] = $ahAD_Node[$iAD_Level]
        EndIf
    Next
    _GUICtrlTreeView_EndUpdate($hAD_TreeView)
    Return $aAD_TreeView

EndFunc

It should work for you, I see no reason why not, but please remember that this will change your Active Directory. Please make sure you test it first. I'm not being held responsible for messing up your AD.

Thursday, April 12, 2012

Deploying a Windows 7 image with WDS and MDT 2010 - Part 3

This is the final part of the installment. Here you will learn how to install software after you PC has been imaged. For part 1 click here and for part 2 click here


Adding Applications

You may want the server to install certain software automatically after you have installed the image. It may be because software is only needed in a certain room or you have a problem with the anti-virus connecting if you don’t install it after an image is deployed. I will run through this now.

First adding software to the application list.

Still in MDT workbench, right click on the applications box and choose New Application.





















Choose the option most applicable to you but I normally go with ‘Application with source files’
On the next box fill in the appropriate information


 



















On the next screen, browse to the software folder and click next





















Next specify the name of the folder to be created






















Next specify the command you wish to run. This will normally be setup.exe or install.msi. You can also specify command line parameters. You will have to check if any apply to the install file but normally /s will do silently etc. you may even be able to pass a command file to the executable to fill in all the information.






















Then click next and finish. The computer will copy across all the files that are in the directory and you will be able to  see it in the applications box in MDT.

Adding the software to a task sequence.

Click back onto the task sequence box in MDT and right click on the task sequence you wish to have install the software. Now choose properties. On the box that pops up choose the second tab called task sequence. What you see here is a complete breakdown of what the computer will do.




Under the sub folder ‘state restore’ there will be an option called install applications. If you click on this, you will have two options on the right. Choose ‘install single application’. You can then click on browse and choose which application you want.


In the above picture I have also added a restart computer command and then a second install application command. To do this you simply click the add button at the top of the task sequence and then choosing the option. I find it better to add a restart after it installs the software as most require a restart to work.




With all this done. You will need to update the deployment share. To do this you will need to go into the MDT workbench software, right click on ‘MDT DeploymentShare’ subfolder and then choose ‘update deploymentshare’. Leave everything as the default and click next, next and then finish. You should be able to see if the computer has updated the boot files. If it has then you will need to change them on the WDS software. I will go through this now.

Updating the boot file in WDS

Run the ‘windows deployment services’ program. On the left hand side click on the server and then the boot folder. In this you will be able to see all the boot files available. Right click on the boot folder and choose ‘Add boot image’

On the first box that comes up browse to the newly created lite touch boot image. These are normally stored under your 'DeploymentshareFolder\boot' folder and are called “LiteTouchPE_x86”. Then click next.

You can then change its name to something else (up to you), and then click next. Click next again and the boot image will be installed.


Once this is all done you are ready to deploy the image.

Reboot the computer and pxe boot to the boot images. Choose the one you want and let it load. It should ask you for authentication ( you will need to provide your root account details) and then the computer name. After this everything is automatically done and you should have no problems.


I hope you've found all this useful.

Deploying a Windows 7 image with WDS and MDT 2010 - Part 2

This post will follow on from the previous part. You can find it here.


Creating a task Sequence

Open up MDT workbench and right click on the task sequence box. Then choose ‘new task sequence’.
On the first screen of the wizard add the task sequence ID (must be unique) and the task sequence name (so you know which it is) and click next.
 



On the next screen choose ‘standard task sequence’



















On the next screen choose the basic windows 7 files.






















On the next screen choose the second option and specify the MAK




















On the next screen fill in the three text boxes with the appropriate information.



On the next screen, fill in the Administrator password




















Finally choose next and then finish. Your task sequence will be created. The ID of this task sequence should be included in the’customsetting.ini’ file that we talked about earlier. 

Ok, so that's part 2 over with. In the final part of this series you'll find out how to install software and how to finish it all off.

Deploying a Windows 7 image with WDS and MDT 2010 - Part 1


This post will tell you about the process of deploying an image using WDS and MDT. It expects you have a set up and working WDS server, and the base Windows 7 OS already installed.


First log onto the WDS server as you will need to edit a few files first.

Go to the deployment share  and go into the 'control 'folder.
 
The first file you will need to edit is ‘bootstrap.ini’. The correct text in the file should look like this.

[Settings]
Priority=Default

[Default]
DeployRoot=\\WDSSERVER\DeploymentShareFolder
SkipBDDWelcome=YES

SkipBDDWelcome – skips the welcome screen when you boot into winPE. This can be changed
DeployRoot – The path to the deployment share. This will need to be changed.


The second file is called ‘customsettings.ini’. The correct text should look like this.

[Settings]
Priority=Default
Properties=MyCustomProperty

[Default]
OSInstall=YES
SkipAppsOnUpgrade=YES
skipBDDWelcome=YES
SkipCapture=yes
SkipAdminPassword=YES
SkipProductKey=YES
SkipAppsOnUpgrade=YES
SkipCapture=YES
ComputerBackupLocation=\\WDSSERVER\deploymentshareFolder\Backup
BackupFile=MyCustomImage.wim
SkipAdminPassword=YES
SkipDeploymentType=YES
SkipDomainMembership=YES
JoinDomain=NameOfYourDomain
DomainAdmin=UserNameToJoinDomain
DomainAdminDomain=DomainName
DomainAdminPassword=PasswordOfUserToJoinDomain
SkipUserData=Yes
SkipTaskSequence=YES
TaskSequenceID=IDOfTaskSequence
SkipComputerName=NO
OSDComputerName=%SerialNumber%
SkipPackageDisplay=YES
SkipLocaleSelection=YES
UILanguage=en-UK
UserLocale=en-UK
KeyboardLocale=0809:00000809
SkipTimeZone=YES
TimeZoneName=GMT Standard Time
SkipApplications=YES
SkipBitLocker=YES
SkipSummary=YES
CaptureGroups=YES
SLShare=\\WDSSERVER\deploymentshareFolder\Logs
Home_page=HomePageForWebBrowser
_SMSTSORGNAME = Your Organisations Name

Most of these options (all of which are changeable) are self explanatory. I will point out TaskSequenceID. You will need to change this to which ever task sequence you wish to use. A list is provided in the MDT workbench.
All of the ones marked in red you will certainly need to change but you can change everything. Also note that the Locale is set up for UK and UK English. You'll need to change that depending on where in the world you are.

Remember to save both files when you finish editing them.

Now if you go back to the ‘control’ folder, you should see folders which have the names of the images you wish to deploy. If you choose the image you wish to deploy and go into the folder you will see 2 files. A ‘ts.xml’ and a ‘unattended.xml’. It is the ‘unattended.xml’ file you want to edit so open it up. This is where the computer gets the information from to set up the computer so you don’t have to stay there and provide it.

The windows system image manager should open up and in the centre pane will have a list of options.


Each one of these can be customized. You will need to go through each one of these to make sure it is customize to the image you will be using it with. 

Wednesday, April 11, 2012

How to do a manual install of MySQL on Windows 7

I've been having great problems with MySQL lately.  It seems no matter what I do it throws up errors when ever I try to install it through the MSI file that it provides. I wont go into details here on the problems that I've been having. Simply put I'd had enough and I did it manually. Here's how I did it.

First download the zip file with the latest copy of MySQL in. You can get it here Remember, if there are two of them, you want the larger one.

Once downloaded you can unzip the files and place them in a folder on your C drive called 'mysql'.

Now, looking online there are several configuration methods available but I found the simplest way was to just create a new text document in the C:\mysql folder and rename it 'my.ini' There's tons of stuff you can put in it but I'll leave that up to you to tweak. For now all you need to put in it is -

[mysqld]
# installation directory
basedir="C:/mysql/"
# data directory
datadir="c:/mysql/data/" 

OK, now we need to test that this has all worked. If you browse to the c:\mysql\bin folder and while holding down shift right click in the folder and choose 'open a command window here'. This will bring up a command prompt. type in -



mysqld

This should start the MySQL service. If the command prompt just hangs there, don't worry about it. Just close the windows and reopen another command prompt in the same location. Now type in


mysql -u root


This will bring up the command line tool for MySQL. One of the most important things you need to do now is change the root password. Type in - 


UPDATE mysql.user SET password=PASSWORD("HereIsWhereUSpecifyANewPassword") WHERE User='root'; 
FLUSH PRIVILEGES;

You will need to make note of this as you will need it to use the command line tool again. Also don't forget the ; at the end of each line.


Still in the command prompt window type


exit;


You should now have a normal prompt again. I think its best to install MySQL as a service. This way you wont have to start it every time. To do this, in the same command prompt type in -


mysqld --install

You should get a response saying it has been successful. Don't forget to change the new MySQL service to automatic in the services menu for it to start automatically.

Thursday, April 05, 2012

Sysprep and Capture a windows image using MDT and WDS



Once your reference computer image has been created, tested and re-tested, from another computer remote desktop into your Windows Deployment Server
Go to the deployment share and then into the control folder. Here you will find two files that you will need to edit.

The first file is ‘bootstrap.ini’. The text that is in it should look like this
[Settings]
Priority=Default

[Default]
DeployRoot=\\WDSSERVER\DeploymentShare$

Where WDSSERVER\DeploymentShare$ is the name of your deployment server shared area

If it does not, copy and paste this into the file deleting anything else in there.

The second file is called ‘customsettings.ini’. The text should look like this
[Settings]
Priority=Default
Properties=MyCustomProperty

[Default]
OSInstall=Y
SkipAppsOnUpgrade=YES
SkipCapture=NO
SkipAdminPassword=YES
SkipProductKey=YES

If it does not, copy and paste this into the file deleting anything else in there.

Remember to save both these files when closing.


 Launch the Microsoft deployment toolkit (MDT) workbench and click on the task sequence section


In the above image you can see that the task sequence for ‘sysprep and capture ‘  has already been created. If you do not have it I will quickly run through creating it. If it is already there you can skip the next section.

SKIP THIS SECTION IF SYSPREP AND CAPTURE TASK SEQUENCE ALREADY EXISTS
Right click on task sequence in the left hand pane and choose ‘New Task Sequence’
Give the new sequence an ID and then a name
On the new menu from the drop down box choose ‘sysprep and capture’ and click next.
When choosing an OS to install with it choose the full windows 7 professional base files you should have in the list. It should be called something like “Windows 7 PROFESSIONAL  in Windows 7 x86 install.wim”
Continue to fill in the questions, adding all available information you can. Then click finish. Don’t forget to update the deployment share by right clicking on ‘MDT deployment share’ and choosing update deployment share.



CONTINUE ON FROM HERE
Unlike previously you do not need to PXE boot to capture the image.
Go to reference computer (you will need to have connected it to the domain, but then log off and log on as the local administrator) and map a drive to \\WDSSERVER\DeploymentShare$\Scripts
It doesn’t matter what letter you use but you will have to use your account with domain level permissions
Next open a command prompt and go to that drive letter.
Once in the folder type in this command.
Cscript  litetouch.wsf
The MDT Wizard Screens will launch and prompt for the information required to complete this task sequence.  **Note – we will still process customsettings.ini for this task sequence.  If you have modified customsettings.ini to skip wizard screens, those settings will be honored with this task sequence as well

On the first page choose the Sysprep and Capture task sequence


 On the second page choose the capture option and specify the location to save it and the file name

On the third page put in your domain admin username and password with the domain name
Finally on the fourth page click begin and the deployment wizard should start. The computer will automatically go through the whole process without your input




Once the capture has completed, you can now import the captured image as a custom image file in MDT and use it for future task sequences. With MDT still open on the WDS server right click on “Operating systems” in the left hand pane and choose ‘Import Operating System’
Add new operating system and choose custom image file.
Point to the “Captures” path and move it to the to the deployment share.

Include the setup files for the OS which you are importing and complete the wizards. These again are the base windows 7 professional files

And there you have it. Your brand new image ready to roll out.