Jump to content


Photo

using SCCM 2012 RC in a LAB - Part 10. Using Prestart and Extrafiles to get more out of UDA


  • Please log in to reply
36 replies to this topic

#1 anyweb

anyweb

    Administrator

  • Root Admin
  • PipPipPip
  • 5,662 posts
  • Gender:Male
  • Location:Sweden
  • Interests:Deploying Operating systems and more with System Center Configuration Manager

Posted 14 November 2011 - 09:46 PM

In Part 1 of this series we got our AD and SCCM servers ready, and then we installed System Center 2012 Configuration Manager as a standalone Primary site. In Part 2 we configured the SCCM server further by adding some Windows Server roles necessary for the following Configuration Manager 2012 functionality, Software Update Point (SUP) and Operating System Deployment. In Part 3 we configured the server further by Enabling Discovery methods and creating Boundary's and Boundary Groups. In Part 4 we configured Client Settings, Added roles and Distributed the Configmgr Client to our Computers within the LAB, then in Part 5 we enabled the Endpoint Protection Role and configured Endpoint Protection settings and targeted a collection called All Windows 7 Computers with these settings and policies.

In Part 6 we configured our SUP further to Deploy software updates to our All Windows 7 Computers and Build Windows 7 X64 collections. In Part 7 we used the Build and Capture process to create our Base Windows 7 X64 wim image. In Part 8 we created a USMT 4 package to migrate the users data using hardlinking and then we imported the captured image into ConfigMgr and created a Deploy Windows 7 X64 task sequence. We created a Deploy Windows 7 X64 Collection and set some User Device Affinity collection variables.

In Part 9 we created an Application, and created a deployment type for that application to only install if the Primary User was True for that device (User Device Affinity), we then copied our Task Sequence (duplicated it), deployed the new Task Sequence, added a computer to the new collection and then PXE booted the computer to the Deployment Menu. Now we will monitor the Deployment process in a lot of detail to see what happens with UDA and more.



Step 1. Deploy Windows 7 X64 and monitor the progress

Perform the following on your SCCM 2012 server as SMSadmin.

Recap: After PXE booting our W72 virtual machine, we entered the PXE password and then we selected the Deploy Windows 7 X64 - New Computer

deploy windows 7 x64 - New Computer.png

and it formatted the disc and then started applying the Operating System, at this point I want you to pay close attention to the Deployment progress so that you can see when it sets the UDA relationship, if your image is already deployed don't worry, you can delete the computer in SCCM, reimport it to the Deploy collection and PXE boot again. What we want to do here is to view the SMSTS.log file around the time that Setup Windows and Configmgr step is running, to do this we will press F8 at the right time, so press F8 now during the Apply Operating System phase

f8 during apply.png

while the image is being applied to c:\ you may as well copy over our troubleshooting tool, CMtrace.exe to the root of c:\

x:\sms\bin\i386\copy cmtrace.exe c:\

copy cmtrace.png

Tip: As the CMTrace tool is now embedded in our boot images, you can automate the above by adding a step to your Build and Capture Task Sequence (or even your Deploy Task Sequence) as long as it occurs before the Setup Windows and ConfigMgr step, the code is xcopy "x:\sms\bin\x64\cmtrace.exe" "c:\" /E /C /I /Q /H /R /Y /S. Note: the path will change depending on what architecture boot image you are using !

xcopy CMtrace.png

after the image is applied the Virtual Machine wants to reboot, so type Exit in your console and the vm will reboot into Windows

starting windows.png

and then Setup is installing devices and applying system settings

setup is installing devices.png

followed by another reboot, and then Setup is preparing your computer for first use, and this is where you need to be awake if you want to witness this part of the process, when you see the blue windows screen press F8 again and it's now at the Setup Windows and ConfigMgr step

setup windows and configmgr.png

type c:\cmtrace.exe and answer yes to make it the default logging tool, open the following file C:\_SMSTaskSequence\Logs\smsts.log

smsts log file.png

meanwhile on your SCCM server, open the following log file in CMTrace.exe,

D:\Program Files\SMS_CCM\Logs\MP_Status.log

and look for the following line:-

Mp Status: processing event: SMS_OSDUDA_StateMessageSent_ActionCompleteInfo, for machine: W72


that is the UDA state message being sent

sms state message sent.png

meanwhile on the client we can see the UDA actions in in our SMSTS.log file (you may have to change the location of the SMSTS.log file to C:\Windows\CCM\Logs\SMSTSLog\smsts.log)

Creating User Affinity


Set Authenticator in transport
Report Body: <ReportBody><StateMessage MessageTime="20111114103250.000000+000" SerialNumber="1"><Topic ="server2008r2/testuser:OSDAuto" Type="1600" IDType="0"/><State ID="1">
....
Successfully Submitted the UDA state message for the user(s): server2008r2\testuser with mode 'Auto'


uda state message in smsts log.png


Meanwhile.. back in the ConfigMgr console, click on Assets and Devices, and select our Deploy Windows 7 X64 collection, in there you'll see our W72 computer, right click it and choose Edit Primary Users

edit primary users.png

you should see the following, Affinity Type=OSD Defined.

affinity type.png

ok, now that you've seen what happens, close the CMtrace tool and the command prompt in your Deploy Windows 7 X64 session and let it finish it's job (it'll jump to the login screen very quickly)

ctrl_alt_del.png

so login and we can review some new logs !


Step 2. Review the Deployed Windows 7 X64 computer

Perform the following on your Windows 7 client as testuser.

Login to the desktop and start Internet Explorer and browse to the Application Catalog , review the My Devices tab, it should say:-

This computer is set as your primary computer. Your administrator might automatically install applications or make additional applications available to primary computers.


primary computer.png

Next, using Windows Explorer, start up CMTrace.exe (located in C:\) and browse to C:\Windows\CCM\Logs, open the AppDiscovery.log file, as we can see it's logging about detecting whether Mozilla FireFox is installed or not and it reports msi application not discovered

msi application not discovered.png

next open C:\Windows\CCM\Logs\AppEnforce.log, you should see it referencing whether or not a user is logged on (we are logged on now, but if we had waited 30 minutes or so and then logged on it would have reported things differently), and how it tries to Enforce installing the app

starting install enforcement.png

cool stuff indeed, oh and if we minimise CMTrace what do we see ? yup the Firefox icon on the desktop, installed using User Device Affinity variables and by configuring our Deployment Type rules, cool huh ?

firefox on the desktop.png



Step 3. Modify the boot wim to include prestart and Extrafiles

Perform the following on your SCCM 2012 server as SMSadmin.

Now that we've proven that we can use UDA to install apps for our Primary User, let's edit the task sequence to prompt us for a Primary User instead of forcing it via a collection variable. To do this we need to edit our boot.wim files first of all.


We need a few files, so please download the following zip file

Attached File  Extrafiles.zip   1.05KB   1731 downloads

and uncompress it to D:\Sources\OS\Extrafiles

extrafiles location.png

In the ConfigMgr console, locate our Boot image (X86) and right click it, choose Properties

x86 properties.png

click on the Customization tab and place a checkmark in Enable Prestart Command, place another checkmark in Include files for the prestart command

enable prestart command.png

click browse and browse to the UNC path of our Extrafiles

eg: \\sccm\sources\os\Extrafiles

in the command line type the following

cscript.exe get_SMSTSUdaUsers_via_Prestart.vbs

prestart commands.png

click apply and answer yes when prompted about distribution point update required

distribution point update  required.png

it starts to inject the changes

mount the source wim file to the staging directory.png

Tip: you can open the SMSProv.log to monitor the files being injected into your boot.wim files.

smsprov log.png



Step 4. Modify our Collection Variables

Perform the following on your SCCM 2012 server as SMSadmin.

In the ConfigMgr console, click on Assets and Compliance and locate our Deploy Windows 7 X64 collection, right click, choose properties, select the Collection Variables tab

collection variables.png

remove the SMSTSUdaUsers variable we set earlier by highlighting it and clicking on the red X, answer yes when prompted.

red x.png


Step 5. PXE boot and test the prestart command

Add a new virtual machine to our Deploy Windows 7 X64 collection (or delete the one we used previously, and then import it back again, verify it's in the collection after the import before pxe booting).

PXE boot and you'll get to the Task Sequence password screen..

enter task sequence password.png

press next and Voila, you get to see your Prestart command in action !

please enter the primary username.png

so enter the primary user name and click ok

and our SMSTSUdaUsers variable is now set via a Prestart command,

smstsudausers variable set via a prestart command.png

in a later part of this series, we will see how we can set this via the task sequence itself and also look at setting the Task Sequence Deployment ID via a variable to override what's targetted to our computer.
Microsoft MVP > Enterprise Client Management
My linkedin profile at > linkedin.com
Follow me on Twitter > ncbrady
Follow windowsnoob.com on Twitter > windowsnoob
My blog

#2 Lucero

Lucero

    Member

  • Members
  • PipPip
  • 23 posts

Posted 18 November 2011 - 06:42 PM

Another cool step anyweb. Just one quick question around updates (via SUS). Do I have to keep running / syncing in order for new updates to be applied? What are the steps?

Thanks

#3 anyweb

anyweb

    Administrator

  • Root Admin
  • PipPipPip
  • 5,662 posts
  • Gender:Male
  • Location:Sweden
  • Interests:Deploying Operating systems and more with System Center Configuration Manager

Posted 18 November 2011 - 06:50 PM

software update syncs are carried out by the schedule (check software update point in component services), check the Sync Schedule tab, however that is out of scope of THIS part, so please post those questions separately or on the relevant part, cheers !

sync schedule.png
Microsoft MVP > Enterprise Client Management
My linkedin profile at > linkedin.com
Follow me on Twitter > ncbrady
Follow windowsnoob.com on Twitter > windowsnoob
My blog

#4 Lucero

Lucero

    Member

  • Members
  • PipPip
  • 23 posts

Posted 30 November 2011 - 01:19 PM

Step 3, do we have to do this for both boot images? x86 and x64?

Thanks

#5 anyweb

anyweb

    Administrator

  • Root Admin
  • PipPipPip
  • 5,662 posts
  • Gender:Male
  • Location:Sweden
  • Interests:Deploying Operating systems and more with System Center Configuration Manager

Posted 30 November 2011 - 04:08 PM

nope unless you want to, but do it to the x86 boot image at least
Microsoft MVP > Enterprise Client Management
My linkedin profile at > linkedin.com
Follow me on Twitter > ncbrady
Follow windowsnoob.com on Twitter > windowsnoob
My blog

#6 sumyun

sumyun

    Member

  • Members
  • PipPip
  • 10 posts

Posted 01 December 2011 - 08:35 PM

Hello anyweb, first have to thank you for this great guide.

I am trying to follow the guide to test user affinity, I can see the log files with the mentioned log from both the device and MP. However, at the end of the deployment, the primary user is not set when I try to verify it from SCCM Console. Do you have any suggestion where I could start looking into?

I tried both collection variable and Prestart command, results are the same.

#7 anyweb

anyweb

    Administrator

  • Root Admin
  • PipPipPip
  • 5,662 posts
  • Gender:Male
  • Location:Sweden
  • Interests:Deploying Operating systems and more with System Center Configuration Manager

Posted 01 December 2011 - 09:48 PM

thanks for the thanks :) are you testing with the Release Candidate version ?
Microsoft MVP > Enterprise Client Management
My linkedin profile at > linkedin.com
Follow me on Twitter > ncbrady
Follow windowsnoob.com on Twitter > windowsnoob
My blog

#8 sumyun

sumyun

    Member

  • Members
  • PipPip
  • 10 posts

Posted 02 December 2011 - 02:58 PM

Yes, testing with RC, and I have a CAS and a Primary site.

#9 anyweb

anyweb

    Administrator

  • Root Admin
  • PipPipPip
  • 5,662 posts
  • Gender:Male
  • Location:Sweden
  • Interests:Deploying Operating systems and more with System Center Configuration Manager

Posted 02 December 2011 - 05:08 PM

post your smsts.log here and the appenfore and appdiscovery logs
Microsoft MVP > Enterprise Client Management
My linkedin profile at > linkedin.com
Follow me on Twitter > ncbrady
Follow windowsnoob.com on Twitter > windowsnoob
My blog

#10 sumyun

sumyun

    Member

  • Members
  • PipPip
  • 10 posts

Posted 02 December 2011 - 05:54 PM

Here are the log files. These log files are from the Windows\CCM\Logs directory. And I can't locate appenfore.

Attached Files



#11 sumyun

sumyun

    Member

  • Members
  • PipPip
  • 10 posts

Posted 07 December 2011 - 08:55 PM

Hello anyweb, are those log files sufficient for the troubleshoot? Thanks!

#12 anyweb

anyweb

    Administrator

  • Root Admin
  • PipPipPip
  • 5,662 posts
  • Gender:Male
  • Location:Sweden
  • Interests:Deploying Operating systems and more with System Center Configuration Manager

Posted 08 December 2011 - 10:27 AM

i didnt see any reference to UDA in your smsts.log file, check again, verify it's being set in your task sequence like i've specified in the guide ok ?
Microsoft MVP > Enterprise Client Management
My linkedin profile at > linkedin.com
Follow me on Twitter > ncbrady
Follow windowsnoob.com on Twitter > windowsnoob
My blog

#13 sumyun

sumyun

    Member

  • Members
  • PipPip
  • 10 posts

Posted 08 December 2011 - 05:34 PM

anyweb,
I was trying to copy the log files by deploying the TS again. It works this time~~~ I can see the OSD Defined primary user now. Thank you very much for the follow up!

#14 yyyyuuuu386

yyyyuuuu386

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 11 January 2012 - 12:50 PM

thank anyweb very much :)

#15 bfry24

bfry24

    Member

  • Members
  • PipPip
  • 13 posts

Posted 23 February 2012 - 06:21 PM

In Part 9, I deployed the PXE on the second VM. Was stuck on the PXE not progressing to the F12 button. I went back thru all the steps in Part 9 and it finally worked.
Readin Part 10, I went and deleted that VM from SCCM, redid the import to that Deploy Group, but am still getting just the PXE not progressing to the point that I can press F12.

Any ideas?

#16 anyweb

anyweb

    Administrator

  • Root Admin
  • PipPipPip
  • 5,662 posts
  • Gender:Male
  • Location:Sweden
  • Interests:Deploying Operating systems and more with System Center Configuration Manager

Posted 23 February 2012 - 08:30 PM

is the computer in a collection that the task sequence is advertised to ? what does your smspxe.log file reveal ?
Microsoft MVP > Enterprise Client Management
My linkedin profile at > linkedin.com
Follow me on Twitter > ncbrady
Follow windowsnoob.com on Twitter > windowsnoob
My blog

#17 bfry24

bfry24

    Member

  • Members
  • PipPip
  • 13 posts

Posted 23 February 2012 - 11:57 PM

This is what repeats in the SMSPXE.log:

Set media certificate in transport SMSPXE 2/23/2012 6:54:43 PM 3400 (0x0D48)
Set authenticator in transport SMSPXE 2/23/2012 6:54:43 PM 3400 (0x0D48)
Set authenticator in transport SMSPXE 2/23/2012 6:54:43 PM 3400 (0x0D48)
PXE::CBootImageManager::FindMatchingArchitectureBootImage SMSPXE 2/23/2012 6:55:15 PM 3400 (0x0D48)
Set media certificate in transport SMSPXE 2/23/2012 6:55:15 PM 3400 (0x0D48)
Set authenticator in transport SMSPXE 2/23/2012 6:55:15 PM 3400 (0x0D48)
Set authenticator in transport SMSPXE 2/23/2012 6:55:15 PM 3400 (0x0D48)
Client boot action reply: <ClientIDReply><Identification Unknown="0" ItemKey="16777239" ServerName="" ServerRemoteName=""><Machine><ClientID/><NetbiosName/></Machine></Identification><PXEBootAction LastPXEAdvertisementID="" LastPXEAdvertisementTime="" OfferID="" OfferIDTime="" PkgID="" PackageVersion="" PackagePath="" BootImageID="" Mandatory=""/></ClientIDReply>
SMSPXE 2/23/2012 6:55:15 PM 3400 (0x0D48)
Client Identity: {38B78A4C-E32A-4DA9-A26B-E317B43F895D} SMSPXE 2/23/2012 6:55:15 PM 3400 (0x0D48)

Seems like the Client ID is missing.

DISREGARD THIS.

#18 bfry24

bfry24

    Member

  • Members
  • PipPip
  • 13 posts

Posted 24 February 2012 - 08:39 PM

After being able to redo the PXE I ran into a few issues. I was unable to press the F8 key to copy the CMTrace program over during the installation. Upon completed and going to the My Devices section, the message I received stated: This setting cannot be configured because of a network communications or a configuration problem.
Once the system completed the installation and I logged in, I copied the CMTrace program to the root of the C:\ drive. Browsing to the C:\Windows\CCM\Logs directory, there is no log titled AppEnforce.log. The first log is titled CAS.log Firefox is not installed either.


#19 zifou

zifou

    Member

  • Members
  • PipPip
  • 13 posts

Posted 05 April 2012 - 09:25 AM

Hello,

Just after enter the username, I get this message:
Posted Image
I press "OK" the message disappears, then I can't do nothing!
When I press "NEXT" on the "Welcome to the task sequence wizard" nothing happens.
I don't why, do you've an idea?

Thank's in advance.

#20 Tjindarr

Tjindarr

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts

Posted 11 April 2012 - 05:30 PM

Did you set the SMSTSAssignUserMode to Auto on the collection or via task sequence variable? If its not set the default value is "Pending" and will wait for approval.
  • anyweb likes this




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users

Locations of visitors to this page