Skip to content

Configure User/Device Affinity During Image Deployment

Featured Replies

  • Author

Found the SMSTS.log... The lines indented and in bold font are the errors that appeared.

 

[ OSDRunPSScript.exe ] RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
Running powershell script: 'GetTargetedApplications_v0_9.ps1'(PkgID: DOR0008C) with execution policy: 'Bypass' RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
The execution scope for running the powershell script is specified not to verify the signature of the scripts. This is unsafe and potentially risk running malicious scripts. RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
Sending warning status message RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
Setting URL = http://xx.xxx.xx.xx, Ports = 80,443, CRL = false RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
Setting Server Certificates. RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
Setting Authenticator. RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
Set authenticator in transport RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
Setting Media Certificate. RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
Sending StatusMessage RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
Setting message signatures. RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
Setting the authenticator. RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
CLibSMSMessageWinHttpTransport::Send: URL: xx.xxx.xx.xx:80 CCM_POST /ccm_system/request RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
Request was successful. RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
Powershell path: C:\Windows\System32\WindowsPowerShell\v1.0\ RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
ResolveSource flags: 0x00000000 RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
SMSTSPersistContent: . The content for package DOR0008C will be persisted RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
DownloadOnDemand flag is true. Attempting to download content locally for Package DOR0008C. RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
Locations: Multicast = 0, HTTP = 1, SMB = 0. RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
Package Flags: 0x01000000 RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
Multicast is not enabled for the package. RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
Trying http://xx.xxx.xx.xx/SMS_DP_SMSPKG$/DOR0008C. RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
GetDirectoryListing() entered RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
Initializing HTTP transport. RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
Setting URL = http://xx.xxx.xx.xx/SMS_DP_SMSPKG$/DOR0008C. RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
Address=http://xx.xxx.xx.xx, Scheme=http, Object=/SMS_DP_SMSPKG$/DOR0008C, Port=80. RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
Setting Authenticator. RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
Set authenticator in transport RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
WinHttp credentials set RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
CLibSMSMessageWinHttpTransport::Send: URL: xx.xxx.xx.xx:80 PROPFIND /SMS_DP_SMSPKG$/DOR0008C RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
401 - Unsuccessful with anonymous access. Retrying with context credentials. RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
Using thread token for request RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
Request was successful. RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
DAV response string is:
<?xml version="1.0" encoding="utf-8" ?><D:multistatus xmlns:D="DAV:"><D:response><D:href>http://REVIMAGEDOR.revenue.wi.gov/SMS_DP_SMSPKG$/sccm?/DOR0008C/</D:href><D:propstat><D:status>HTTP/1.1 200 OK</D:status><D:prop><D:getcontenttype/><D:supportedlock/><D:getetag/><D:creationdate/><D:iscollection>1</D:iscollection><D:resourcetype><D:collection/></D:resourcetype><D:ishidden>0</D:ishidden><D:displayname>http://xx.xxx.xx.xx/SMS_DP_SMSPKG$/sccm?/DOR0008C/</D:displayname><D:getlastmodified></D:getlastmodified><D:getcontentlanguage/><D:getcontentlength>0</D:getcontentlength></D:prop></D:propstat></D:response><D:response><D:href>http://xx.xx.xx.xx/SMS_DP_SMSPKG$/DOR0008C/sccm?/GetTargetedApplications_v0_9.ps1</D:href><D:propstat><D:status>HTTP/1.1 200 OK</D:status><D:prop><D:getcontenttype/><D:lockdiscovery/><D:supportedlock/><D:getetag/><D:getcontentlanguage/><D:iscollection>0</D:iscollection><D:creationdate/><D:resourcetype/><D:ishidden>0</D:ishidden><D:displayname>http://xx.xx.xx.xx/SMS_DP_SMSPKG$/DOR0008C/sccm?/GetTargetedApplications_v0_9.ps1</D:displayname><D:getlastmodified>Mon, 02 Jun 2014 15:02:26 GMT</D:getlastmodified><D:getcontentlength>2433</D:getcontentlength></D:prop></D:propstat></D:response></D:multistatus> RunPowerShellScript 6/2/2014 11:36:34 AM 1920 (0x0780)
List of files to be downloaded RunPowerShellScript 6/2/2014 11:36:35 AM 1920 (0x0780)
File: http://xx.xxx.xx.xx:80/SMS_DP_SMSPKG$/DOR0008C/sccm?/GetTargetedApplications_v0_9.ps1 RunPowerShellScript 6/2/2014 11:36:35 AM 1920 (0x0780)
GetDirectoryListing() successfully completed RunPowerShellScript 6/2/2014 11:36:35 AM 1920 (0x0780)
Succeeded loading resource DLL 'C:\WINDOWS\CCM\1033\TSRES.DLL' RunPowerShellScript 6/2/2014 11:36:35 AM 1920 (0x0780)
401 - Unsuccessful with anonymous access. Retrying with context credentials. RunPowerShellScript 6/2/2014 11:36:35 AM 1920 (0x0780)
Downloading file /SMS_DP_SMSPKG$/DOR0008C/sccm?/GetTargetedApplications_v0_9.ps1 range 0-2432 RunPowerShellScript 6/2/2014 11:36:35 AM 1920 (0x0780)
Downloaded file from http://xx.xxx.xx.xx:80/SMS_DP_SMSPKG$/DOR0008C/sccm?/GetTargetedApplications_v0_9.ps1 to C:\_SMSTaskSequence\Packages\DOR0008C\GetTargetedApplications_v0_9.ps1 RunPowerShellScript 6/2/2014 11:36:35 AM 1920 (0x0780)
VerifyContentHash: Hash algorithm is 32780 RunPowerShellScript 6/2/2014 11:36:35 AM 1920 (0x0780)
Content successfully downloaded at C:\_SMSTaskSequence\Packages\DOR0008C. RunPowerShellScript 6/2/2014 11:36:35 AM 1920 (0x0780)
Resolved source to 'C:\_SMSTaskSequence\Packages\DOR0008C' RunPowerShellScript 6/2/2014 11:36:35 AM 1920 (0x0780)
Command line for extension .exe is "%1" %* RunPowerShellScript 6/2/2014 11:36:35 AM 1920 (0x0780)
Set command line: Run Powershell script RunPowerShellScript 6/2/2014 11:36:35 AM 1920 (0x0780)
Working dir 'C:\_SMSTaskSequence\Packages\DOR0008C' RunPowerShellScript 6/2/2014 11:36:35 AM 1920 (0x0780)
Executing command line: Run Powershell script RunPowerShellScript 6/2/2014 11:36:35 AM 1920 (0x0780)
Process completed with exit code 1 RunPowerShellScript 6/2/2014 11:36:41 AM 1920 (0x0780)
Unable to find type [%_SMSTSMachineName%]: make sure that the assembly containi RunPowerShellScript 6/2/2014 11:36:41 AM 1920 (0x0780)
ng this type is loaded. RunPowerShellScript 6/2/2014 11:36:41 AM 1920 (0x0780)
At C:\_SMSTaskSequence\Packages\DOR0008C\GetTargetedApplications_v0_9.ps1:12 ch RunPowerShellScript 6/2/2014 11:36:41 AM 1920 (0x0780)
ar:26 RunPowerShellScript 6/2/2014 11:36:41 AM 1920 (0x0780)
+ [%_SMSTSMachineName%] <<<< $ResourceName, RunPowerShellScript 6/2/2014 11:36:41 AM 1920 (0x0780)
+ CategoryInfo : InvalidOperation: (%_SMSTSMachineName%:String) [ RunPowerShellScript 6/2/2014 11:36:41 AM 1920 (0x0780)
], RuntimeException RunPowerShellScript 6/2/2014 11:36:41 AM 1920 (0x0780)
+ FullyQualifiedErrorId : TypeNotFound RunPowerShellScript 6/2/2014 11:36:41 AM 1920 (0x0780)
RunPowerShellScript 6/2/2014 11:36:41 AM 1920 (0x0780)
Command line returned 1 RunPowerShellScript 6/2/2014 11:36:41 AM 1920 (0x0780)
ReleaseSource() for C:\_SMSTaskSequence\Packages\DOR0008C. RunPowerShellScript 6/2/2014 11:36:41 AM 1920 (0x0780)
reference count 1 for the source C:\_SMSTaskSequence\Packages\DOR0008C before releasing RunPowerShellScript 6/2/2014 11:36:41 AM 1920 (0x0780)
Released the resolved source C:\_SMSTaskSequence\Packages\DOR0008C RunPowerShellScript 6/2/2014 11:36:41 AM 1920 (0x0780)
Process completed with exit code 1 TSManager 6/2/2014 11:36:41 AM 2264 (0x08D8)
!--------------------------------------------------------------------------------------------! TSManager 6/2/2014 11:36:41 AM 2264 (0x08D8)
Failed to run the action: Get Applications.
Incorrect function. (Error: 00000001; Source: Windows) TSManager 6/2/2014 11:36:41 AM 2264 (0x08D8)
MP server http://xx.xxx.xx.xx. Ports 80,443. CRL=false. TSManager 6/2/2014 11:36:41 AM 2264 (0x08D8)
Setting authenticator TSManager 6/2/2014 11:36:42 AM 2264 (0x08D8)
Set authenticator in transport TSManager 6/2/2014 11:36:42 AM 2264 (0x08D8)
Sending StatusMessage TSManager 6/2/2014 11:36:42 AM 2264 (0x08D8)
Setting message signatures. TSManager 6/2/2014 11:36:42 AM 2264 (0x08D8)
Setting the authenticator. TSManager 6/2/2014 11:36:42 AM 2264 (0x08D8)
CLibSMSMessageWinHttpTransport::Send: URL: xx.xxx.xx.xx:80 CCM_POST /ccm_system/request TSManager 6/2/2014 11:36:42 AM 2264 (0x08D8)
Request was successful. TSManager 6/2/2014 11:36:42 AM 2264 (0x08D8)
Set a global environment variable _SMSTSLastActionRetCode=1 TSManager 6/2/2014 11:36:42 AM 2264 (0x08D8)
Set a global environment variable _SMSTSLastActionSucceeded=false TSManager 6/2/2014 11:36:42 AM 2264 (0x08D8)
Clear local default environment TSManager 6/2/2014 11:36:42 AM 2264 (0x08D8)
Let the parent group (Install User Applications) decides whether to continue execution TSManager 6/2/2014 11:36:42 AM 2264 (0x08D8)
The execution of the group (Install User Applications) has failed and the execution has been aborted. An action failed.
Operation aborted (Error: 80004004; Source: Windows) TSManager 6/2/2014 11:36:42 AM 2264 (0x08D8)
Failed to run the last action: Get Applications. Execution of task sequence failed.
Incorrect function. (Error: 00000001; Source: Windows) TSManager 6/2/2014 11:36:42 AM 2264 (0x08D8)
MP server http://xx.xxx.xx.xx. Ports 80,443. CRL=false. TSManager 6/2/2014 11:36:42 AM 2264 (0x08D8)
Setting authenticator TSManager 6/2/2014 11:36:42 AM 2264 (0x08D8)
Set authenticator in transport TSManager 6/2/2014 11:36:42 AM 2264 (0x08D8)
Sending StatusMessage TSManager 6/2/2014 11:36:42 AM 2264 (0x08D8)
Setting message signatures. TSManager 6/2/2014 11:36:42 AM 2264 (0x08D8)
Setting the authenticator. TSManager 6/2/2014 11:36:42 AM 2264 (0x08D8)
CLibSMSMessageWinHttpTransport::Send: URL: xx.xxx.xx.xx:80 CCM_POST /ccm_system/request TSManager 6/2/2014 11:36:42 AM 2264 (0x08D8)
Request was successful. TSManager 6/2/2014 11:36:42 AM 2264 (0x08D8)
Launching command shell. OSDSetupHook 6/2/2014 11:36:49 AM 2340 (0x0924)
executing command: C:\WINDOWS\system32\cmd.exe /k OSDSetupHook 6/2/2014 11:36:49 AM 2340 (0x0924)
executed command: C:\WINDOWS\system32\cmd.exe /k OSDSetupHook 6/2/2014 11:36:49 AM 2340 (0x0924)
Execution::enExecutionFail != m_eExecutionResult, HRESULT=80004005 (e:\nts_sccm_release\sms\client\tasksequence\tsmanager\tsmanager.cpp,923) TSManager 6/2/2014 11:51:56 AM 2264 (0x08D8)
Task Sequence Engine failed! Code: enExecutionFail TSManager 6/2/2014 11:51:56 AM 2264 (0x08D8)
**************************************************************************** TSManager 6/2/2014 11:51:56 AM 2264 (0x08D8)
Task sequence execution failed with error code 80004005 TSManager 6/2/2014 11:51:56 AM 2264 (0x08D8)
Cleaning Up. TSManager 6/2/2014 11:51:56 AM 2264 (0x08D8)
  • Replies 29
  • Views 27.8k
  • Created
  • Last Reply

Top Posters In This Topic

Posted Images

You're doing something wrong with your input variables and I just noticed it based on the log file, while you already posted them before. It should be something like below. The resource name will be added as input variable.

 

param (

[string]$ResourceName,

[string]$SiteCode="YourSiteCode",

[string]$SiteServer="YourSiteServer",

[string]$Container="YourContainer"

)

  • Author

I see clearer now. Scripting is not my strong suit. So my parameters should look like this:

 

param (

[string]$ResourceName,

[string]$SiteCode="DOR",

[string]$SiteServer="SCCM2012DOR",

[string]$Container="Applications"

)

The $ResourceName is defined in the TS step "GetApplications"...correct?

  • Author

Almost there. The TS "Install Applications" started to run this time. Unfortunately, it failed. I think it is due to incorrect permissions...

 

Get-WmiObject : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESS RunPowerShellScript 6/3/2014 9:00:08 AM 1908 (0x0774)
DENIED)) RunPowerShellScript 6/3/2014 9:00:08 AM 1908 (0x0774)
At C:\_SMSTaskSequence\Packages\DOR0008C\GetTargetedApplications_v0_9.ps1:21 ch RunPowerShellScript 6/2/2014 2:44:19 PM 2188 (0x088C)
ar:34 RunPowerShellScript 6/2/2014 2:44:19 PM 2188 (0x088C)
+ $PrimaryUser = (Get-WmiObject <<<< -ComputerName $SiteServer -Class SMS_ RunPowerShellScript 6/2/2014 2:44:19 PM 2188 (0x088C)
UserMachineRelationship -Namespace root\SMS\Site_$SiteCode -Filter "ResourceNam RunPowerShellScript 6/2/2014 2:44:19 PM 2188 (0x088C)
e='$ResourceName'").UniqueUserName RunPowerShellScript 6/2/2014 2:44:19 PM 2188 (0x088C)
+ CategoryInfo : NotSpecified: ( :) [Get-WmiObject], UnauthorizedA RunPowerShellScript 6/2/2014 2:44:19 PM 2188 (0x088C)
ccessException RunPowerShellScript 6/2/2014 2:44:19 PM 2188 (0x088C)
+ FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.Pow RunPowerShellScript 6/2/2014 2:44:19 PM 2188 (0x088C)
erShell.Commands.GetWmiObjectCommand RunPowerShellScript 6/2/2014 2:44:19 PM 2188 (0x088C)
RunPowerShellScript 6/2/2014 2:44:19 PM 2188 (0x088C)
This appeared as well: No Env variable with specified basename APPId and suffix '01' is found. No applications installed. InstallApplication 6/2/2014 2:44:20 PM 2280 (0x08E8)
Are there special permissions required for scripts like this to work? Again, excuse my ignorance, but I am flying blind when it comes to scripting and powershell stuff.
  • Author

You were correct, once I added the domain computers to the read-only analyst role, things ran smoother. However, the TS failed during the Install Applications TS.

Do I need to ensure that the box is ticked under Deployment settings to enable "Pre-deploy software to the user's primary device"?

 

Here is a snippet from the logfile:

 

Retrieving Policy Assignments: InstallApplication 6/3/2014 3:39:11 PM 1548 (0x060C)
assignmentList.size() > 0, HRESULT=80004005 (e:\nts_sccm_release\sms\client\osdeployment\installapplication\dautils.cpp,452) InstallApplication 6/3/2014 3:39:11 PM 1548 (0x060C)
No matching policy assignments received. InstallApplication 6/3/2014 3:39:11 PM 1548 (0x060C)
Policy download failed, hr=0x80004005 InstallApplication 6/3/2014 3:39:11 PM 1548 (0x060C)
daUtil.DownloadPolicies(), HRESULT=80004005 (e:\nts_sccm_release\sms\client\osdeployment\installapplication\dainstaller.cpp,295) InstallApplication 6/3/2014 3:39:11 PM 1548 (0x060C)
Successfully cleared App model names from TS env. InstallApplication 6/3/2014 3:39:11 PM 1548 (0x060C)
daInstaller.Execute(), HRESULT=80004005 (e:\nts_sccm_release\sms\client\osdeployment\installapplication\main.cpp,260) InstallApplication 6/3/2014 3:39:11 PM 1548 (0x060C)
Process completed with exit code 2147500037 TSManager 6/3/2014 3:39:11 PM 1912 (0x0778)
!--------------------------------------------------------------------------------------------! TSManager 6/3/2014 3:39:11 PM 1912 (0x0778)
Failed to run the action: Install Applications.
Unspecified error (Error: 80004005; Source: Windows) TSManager 6/3/2014 3:39:11 PM 1912 (0x0778)
MP server http://xx.xxx.xx.xx. Ports 80,443. CRL=false. TSManager 6/3/2014 3:39:11 PM 1912 (0x0778)
Setting authenticator TSManager 6/3/2014 3:39:11 PM 1912 (0x0778)
Set authenticator in transport TSManager 6/3/2014 3:39:11 PM 1912 (0x0778)
Sending StatusMessage TSManager 6/3/2014 3:39:11 PM 1912 (0x0778)
Setting message signatures. TSManager 6/3/2014 3:39:11 PM 1912 (0x0778)
Setting the authenticator. TSManager 6/3/2014 3:39:11 PM 1912 (0x0778)
CLibSMSMessageWinHttpTransport::Send: URL: xx.xxx.xx.xx:80 CCM_POST /ccm_system/request TSManager 6/3/2014 3:39:11 PM 1912 (0x0778)
Request was successful. TSManager 6/3/2014 3:39:11 PM 1912 (0x0778)
Set a global environment variable _SMSTSLastActionRetCode=-2147467259 TSManager 6/3/2014 3:39:11 PM 1912 (0x0778)
Set a global environment variable _SMSTSLastActionSucceeded=false TSManager 6/3/2014 3:39:11 PM 1912 (0x0778)
Clear local default environment TSManager 6/3/2014 3:39:11 PM 1912 (0x0778)
Let the parent group (Install User Applications) decides whether to continue execution TSManager 6/3/2014 3:39:11 PM 1912 (0x0778)
The execution of the group (Install User Applications) has failed and the execution has been aborted. An action failed.
Operation aborted (Error: 80004004; Source: Windows) TSManager 6/3/2014 3:39:11 PM 1912 (0x0778)
Failed to run the last action: Install Applications. Execution of task sequence failed.
Unspecified error (Error: 80004005; Source: Windows) TSManager 6/3/2014 3:39:11 PM 1912 (0x0778)
  • Author

I have fixed the above "problem". It seems that I forgot to check the little box in the application properties under the "General Information" tab that allows the application to be installed from the Install Application task sequence action without being deployed.

 

I tested everything again and it worked like a charm (after about 40 attempts). I have got to learn more about powershell.

 

Quick question, is there a limit to the number of applications that can be installed using this method? I know that if a manual list is used, only 8 applications can be installed per step. Wondering if it is different for dynamic lists?

 

Thank you Peter for all of your assistance.

 

As time permits, I will try to piece together a detailed guide on how to do this. This is an excellent way to deploy user-specific software during the OSD.

  • Author

After testing this a couple of times, I decided to attempt using a collection based on a security group instead of individual users assigned to the group. The user set during the OSD deployment was a member of the security group assigned to the user collection. When I executed the OSD, it failed as soon as the get/install applications TS started.

 

Can the automated process you developed be implemented with security groups, or will I need to ensure that each user be added to the correct application collection? My guess is that since the affinity is looking for a specific user to belong to a group, when a security group is used to define multiple members, the affinity does not see the user as being a member. It only sees the security group as the member and therefore fails.

 

I hope I explained that correctly.

 

**EDIT**

I think I have it figured out, I added a query rule to add users individually based on the AD group membership.

 

Thanks again :)

Join the conversation

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

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.