www.infralib.com

www.infralib.com
Please visit my new site http://www.infralib.com for my and other authors' newer posts, articles. We will also have forums, videos, webcasts and etc.
Showing posts with label OSD. Show all posts
Showing posts with label OSD. Show all posts

Monday, 7 January 2013

Using MDT DB to get location specific Domain Joining parameters in SCCM OSD

If you have multiple domains as me and want to automate domain joining task by sensing locations automatically in SCCM OSD, you can use MDT DB to do it easily. You can also do this by adding more actions with different queries to your TS or customizing your coustomsettings.ini. But I prefer using MDT DB as changes there doesn't need to be refresh as packages, GUI makes it easier to manage and more foolproof, etc.

All you need to do is modifying location details on your MDT DB and call these variables in your SCCM TS.

So first edit your location details in MDT Workbench, you'll need to edit four values here as shown below.



DomainAdmin :
The name of the account used to join the domain. Example : OSDAdmin
DomainAdminDomain : The domain of the account used to join the domain. Example: Domain1
DomainAdminPassword : The password of the account used to join the domain.
JoinDomain : The name of the domain in which the computer should be placed. Example: Domain1.local
MachineObjectOU : The OU in which the computer account should be created (if it does not already exist)., Exaple: OU=NewComps,DC=Domain1,DC=Local

Then you'll need to modify your "Apply Network Settings" action in your TS to use values in MDT DB. It is very as MDT Workbench displays these as it is. So all you need to do adding % to the start and the end of the variable as below.

Domain : %JoinDomain%
DomainOU : %MachineObjectOU%
Account : %DomainAdmin%
Password : %DomainAdminPassword%











All done, now you can test it.

Please note that you'll need a working SCCM and MDT integration to use this method first.

Thursday, 6 December 2012

How to prompt for computer name in MDT/SCCM Task Sequence (OSD)

I was using Collection Variables in Collection Settings to ask Computer Name [OSDComputerName] at the beginning of my OSD Task Sequences. It was useful but it doesn't have confirmation or correction features.

So I wanted to change it to something asks if the entered computer names is correct and allow user to change name before final confirmation.

And it worked nicely : )

My new prompt for the computer name script is









Feel free to use, change or optimize.

You can create a SCCM Package and run this script via "Run Command Line" action in your task sequence (cscript "PromptForComputerName.wsf").

Or you can place it into your MDT Scripts (Toolkit package) and  run "Use Toolkit Package" action before it from, then run (cscript "%deployroot%\Personal\PromptForComputerName.wsf") in a "Run Command Line" action just after "Use Toolkit Package".


Friday, 30 November 2012

MDT/SCCM OSD Task Sequence - Install Software Failed (hr=80008013) for Programs with dependencies


When you install an application with dependencies (nested); by running other SCCM package/programs first in MDT/SCCM OSD it fails with the error code  0x80008013 which means (E_FAIL_DEPENDENCY_NOT_RUN : This program cannot run because it depends on another program that has not run successfully before. This error code is returned to task sequence manager when a task sequence Install Software Action step cannot be run because the step has a child program which has not been run before.).

The reason is OSD in SCCM can't install the dependencies first, so you need to separate programs for your OSD Install software tasks.

The task sequence execution engine failed executing the action (Cisco Any Connect) in the group (Laptop Software) with the error code 2147516435 Action output: _ProgramID="Silent  Install",PKG_PackageID="SMS0012C"' Verified policy is compiled in 'root\ccm\policy\machine' namespace content location count = 1 Invoking Execution Manager to install software
FALSE, HRESULT=80008013 (e:\nts_sms_fre\sms\client\osdeployment\installsoftware\installsoftware.cpp,282)
0, HRESULT=80008013 (e:\nts_sms_fre\sms\client\osdeployment\installsoftware\installsoftware.cpp,746)
Entering ReleaseSource() for \\DPSERVER\SMSPKGE$\SMS0012C reference count 1 for the source \\DPSERVER\SMSPKGE$\SMS0012C\ before releasing
Released the resolved source \\DPSERVER\SMSPKGE$\SMS0012CpInstall->Install(sPackageID, sProgramName), HRESULT=80008013 (e:\nts_sms_fre\sms\client\osdeployment\installsoftware\main.cpp,374)
Failed to invoke Execution Manager to Install Software for PackageID='SMS0012C' ProgramID='Silent Install' AdvertID='SMS20333' hr=0x80008013 Install Software failed, hr=0x80008013 Install Software failed, hr=0x80008013.

See http://technet.microsoft.com/en-us/library/bb632794.aspx  for
Custom Error Codes for Configuration Manager 2007.



Thursday, 29 November 2012

MDT / SCCM OSD - Run actions based on chassis type

It is very easy to run chassis type specific actions in task sequences by querying , all you need to do is adding  Task Sequence Variable in Options. Fill Variable field with IsLaptop , select your condition and write the value you wanted (True or False)


Monday, 26 November 2012

WinPE AdoDB SQL Connection Error (429)

I was using MDT wDB for OS deployments, now I am creating the same (better) system with SCCM for wider and easier deployment. I prefer MDT integration to SCCM as it provides lots of flexibility and customizability.

Today, I wanted to use MDT DB with my SCCM OSD, so I created a new MDT Settings package and copied my old CustomSettings.ini from MDT and customized. Duplicated my current build TS and changed the MDT Settings package in respective Gather actions.

Deployed a test machine and found out no localization settings have applied. So I found the error "Unable to create ADODB.Connection object, impossible to query SQL Server: ActiveX component can't create object (429)" in logs. After a few web search I found MDT Boot image usage is recommended as it has necessary libraries to create ADODB connections.

As usual I wanted to fix that instead of using my old MDT boot image, checked WinPE_FPs folder in WAIK and seen there is a winpe-mdac.cab (MS Data Access Components) and added this package to boot image.

  • dism /mount-wim /WimFile:g:\wimwork\boot.csrx64.wim /index:1 /MountDir:G:\WimWork\x64
  • dism /image:G:\WIMWork\csrx64 /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\amd64\WinPE_FPs\winpe-mdac.cab"
  • dism /unmount-image /MountDir:G:\WIMWork\csrx64 /Commit
Now I have necessary libraries in my new boot image and it can connect to SQL server.

Note : Don't forget to change Netlib value to DBMSSOCN in your CustomSettings.ini if you will use SQL Authentication instead of Windows Authentication. 

Thursday, 22 November 2012

Configuring regional settings automatically by using Win32_IP4RouteTable in Task Sequence

The idea was creating location specific variable sets to automatically configure regional settings during deployment. 

Select * FROM Win32_IP4RouteTable WHERE Destination='0.0.0.0' AND ( NextHop='10.99.0.254' OR NextHop='10.101.0.254' OR NextHop='10.103.0.254' OR NextHop='10.104.0.254' )

The query above is very useful as it queries the routing table to find gateway and it looks ok when you run test it in SCCM Console. 

But

It doesn’t work and generates errors below during deployment

(You can use VB, PS scripts, Control.exe with .xml file or other methods by using same WMI query after Setup Windows & CM action (Windows Mode) to set regional settings, they should be easier. But I wondered if I can fix that one, as I always have used default boot images provided in WAIK and I wanted to gain some familiarity with WinPE imaging/tools. I am sure the method below may not be the good/best practise but that is what I did in last few hours, it was good experimental work for me and I believe some parts can be useful for others as well.)

Windows could not parse or process the unattended answer file for pass [specialize]. The settings specified in the answer file cannot be applied. The error was detected while processing settings for component [Microsoft-Windows-Shell-Setup].


If you click ok to Restart, it goes in to reboot loop with message below.


The computer restarted unexpectedly or encountered an unexpected error. Windows installation cannot proceed. To install Windows, click "OK" to restart the computer, and then restart the
installation.



And also the related error message can be found in advertisement status messages.


If you check sms*.log files in deployment client drive you can also find error messages related to operands. (Attaching .vhd is very useful to do that.)

Reason ?

The reason is Win32_IP4RouteTable class is invalid as it is not included in winpe-wmi.cab.


Win32_IP4RouteTable class has two files named Wmipiprt.mof and Wmipiprt.dll 


So I wanted to include this class to my Win-PE image.

1. Preperation
Enable command support option in your current boot image, start deployment but don’t select TS and proceed to installation.


Press F8 to open command prompt
Connect to your workstation
(net use K: \\yourmachine\c$ )
Copy the wmipiprt.* files to Windows\System32\wbem folder (X: Drive)
(Copy K:\windows\system32\wbem\wmipiprt.* X:\Windows\System32\wbem)
Change your working folder to X:\Windows\System32\wbem
                Cd X:\Windows\System32\wbem
Run MOF compiler for the class
Mofcomp wmipiprt.mof
Take a copy of Win-PE Wbem
                Xcopy X:\Windows\System32\wbem K:\WinpeWork\ /s /e
Register the the dll
Regsvr32 wmipiprt.dll
Backup Win-PE HKLM\Software (If you are ok the .reg file I provided you can skip all reg steps until Modifying the Image)
Reg save HKLM\SOFTWARE HKLMSoft.reg
Take a copy of exported reg file
                Copy HKLMSoft.reg K:\WinpeWork\
On your workstation
Load the C:\Winpework\HKLMSoft.reg file with load hive option to your workstations HKLM, you can use any name for Hive name (e.g. WINPE)


Then search wmipiprt in loaded hive,


You’ll find two entries under CLSID, export these to .reg files and merge in one reg file. And unload the hive “WINPE”.  (You can also use the .reg below)

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\WIMSOFT\Classes\CLSID\{23B77E99-5C2D-482D-A795-62CA3AE5B673}]
@="WBEM IP Route Provider"

[HKEY_LOCAL_MACHINE\WIMSOFT\Classes\CLSID\{23B77E99-5C2D-482D-A795-62CA3AE5B673}\InprocServer32]
@="X:\\Windows\\System32\\wbem\\WMIPIPRT.dll"
"ThreadingModel"="Both"

[HKEY_LOCAL_MACHINE\WIMSOFT\Classes\CLSID\{6D7A4B0E-66D5-4AC3-A7ED-0189E8CF5E77}]
@="WBEM IP Route Event Provider"

[HKEY_LOCAL_MACHINE\WIMSOFT\Classes\CLSID\{6D7A4B0E-66D5-4AC3-A7ED-0189E8CF5E77}\InprocServer32]
@="X:\\Windows\\System32\\wbem\\WMIPIPRT.dll"
"ThreadingModel"="Both"

2. Modifying the image (Be sure you have a backup of your original boot image in separate place.)

Mount your boot image in writable mode.
Imagex /mountrw G:\WIMWork\x64boot.wim G:\WIMWork\x64mount
(G:\WIMWork\x64mount is an empty folder)

Open G:\WIMWork\x64mount folder, you’ll see your winpe image contents

Delete G:\WIMWork\x64mount\Windows\System32\wbem contents

Copy the K:\WinpeWork\wbem content you have copied from running Win-PE to your work folder in first steps of Preparation above.

Run Regedit, select HKLM then select load hive from menu,Select G:\WIMWork\x64mount\Windows\System32\Config\Software to load and give WIMSOFT as a name if you are going to use my .reg file above.

Run the .reg you’ve created by correcting paths or directly the one above. (Check two new entries under WIMSOFT\Classes\CLSID)

Unload WIMSOFT Hive.

Now we need to dismount the image with commit option.
Imagex /unmount /commit G:\WIMWork\x64mount
Finished.
Take a backup of your current boot image on SCCM, copy this one to your source and update your distribution points to test. (Or create a new image, to test first.)


Now you can use Win32_IP4RoutingTable in Win-PE mode.
Place your variable set tasks just before the Configure action in PostInstall phase.