Support is >Here<

MDT Imaging Support Expert Advice

RSS
Facebook
Twitter

Look who's giving Logan the cuddles.

How to add an application or script after MDT is complete.

I ran into a need from a customer to run an application installation that resulted in MDT cleanup scripts to fail. In this event, I figured, the best bet is to perform this installation after the MDT CleanUp process is complete.

1. Remove the portions of LTICleanUp.wsf and Litetouch.wsf scripts that remove the “AdminAutoLogon” values:

LTICleanUp.wsf: (starting at Line 124)

1
2
3
4
5
6
7
8
9
oLogging.CreateEntry "Removing AutoAdminLogon registry entries", LogTypeInfo
On Error Resume Next
'Comment Out the following lines:
'oShell.RegWrite "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\AutoAdminLogon", "0", "REG_SZ"
'oShell.RegWrite "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultUserName", "", "REG_SZ"
'oShell.RegWrite "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultDomainName", "", "REG_SZ"
'oShell.RegDelete "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultPassword"
'oShell.RegWrite "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\AutoLogonCount", &amp;H00000000, "REG_DWORD"
On Error Goto 0

Litetouch.wsf changes: (Starting at line 947)

1
2
3
On Error Resume Next
'oShell.RegWrite "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\AutoAdminLogon", "0", "REG_SZ"
On Error Goto 0

2. Next create an application in MDT which calls a batch file, which stages install files on the local disk and calls the files via the “RunOnce” Registry Value or add a Shortcut to the Startup of the Administrator.

Example silent.bat contents:

1
2
xcopy "%~dp0*.*" "c:\windows\temp\OpenOffice\" /heyi
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v Path /t REG_SZ /d C:\Windows\Temp\OpenOffice\Install.bat

Install.bat contents:

1
2
start /w "" "%~dp0OpenOfficeNinite.exe"
cscript "%~dp0DisableAutoLogonEntries.vbs"

DisableAutoLogonEntries.vbs contents:

1
2
3
4
5
6
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.RegWrite "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\AutoAdminLogon", "0", "REG_SZ"
objShell.RegWrite "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultUserName", "", "REG_SZ"
objShell.RegWrite "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultDomainName", "", "REG_SZ"
objShell.RegDelete "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultPassword"
objShell.RegWrite "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\AutoLogonCount", &H00000000, "REG_DWORD"

/Brian G

Share

MDT2012 RC1 Released

  Thanks MS! https://connect.microsoft.com/site14/content/content.aspx?ContentID=12463&http://go.microsoft.com/fwlink/?LinkId=217606 You have to grab it using your Live ID, ...

Best Completely free

  http://www.tweaknow.com/BestFreeApps.php I agreed with all of the applications listed in this ...

Change Computer Icon

Updated 2012-May-14: Found subinacl did not work on Windows 7 ...

2 simple vbs scripts

Just two simple scripts I wrote up to disable number ...

How to apply Local G

In many Organizations, the AD support team is separated from the team ...

MDT2012 RC1 Released

  Thanks MS! https://connect.microsoft.com/site14/content/content.aspx?ContentID=12463&http://go.microsoft.com/fwlink/?LinkId=217606 You have to grab it using your Live ID, ...

Change Computer Icon

Updated 2012-May-14: Found subinacl did not work on Windows 7 ...

How to apply Local G

In many Organizations, the AD support team is separated from the team ...

Creating Simple and/

Using the Wizard Editor is fairly self explanatory for adding ...

How to use VBScript

The built-in CustomSettings.INI variables are very useful, but in some ...

Sponsors

  • Elegant Wordpress Themes.
  • Flexithemes.
  • Code Canyon.
  • ThemeForest.