Hi all,
I'm deploying the Windows Management Framework during an OSD task sequence. I'm using a 1-line PowerShell script as my detection method for the Windows Management Framework application:
if (Get-WmiObject -Query "Select * from WIN32_QuickFixEngineering where HotFixID = 'KB2506143'"){write-host "Installed"}
When the task sequence reaches this step, it fails to run. The AppDiscovery.log file contains the following lines:
Performing detection of app deployment type WMF 3.0 Win7SP1 x64 and 2008 R2 SP1(ScopeId_C2C3E2A6-CD6C-4041-815A-40099562602C/DeploymentType_5c5f1be5-647e-4203-9e93-e10f76a4ffe0, revision 18) for system. AppDiscovery 3/11/2013 5:41:33 PM 2168 (0x0878) Failed to read script execution time-out from policy. Use default 60 seconds. AppDiscovery 3/11/2013 5:41:33 PM 2168 (0x0878) In-line script returned error output: & : File C:\Windows\CCM\SystemTemp\67d54b0a-d6ee-4fed-809a-6ce225bf9b48.ps1 cannot be loaded. The file C:\Windows\CCM\SystemTemp\67d54b0a-d6ee-4fed-809a-6ce225bf9b48.ps1 is not digitally signed. The script will not execute on the system. For more information, see about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170. At line:1 char:3 + & 'C:\Windows\CCM\SystemTemp\67d54b0a-d6ee-4fed-809a-6ce225bf9b48.ps1' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : SecurityError: (:) [], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess AppDiscovery 3/11/2013 5:41:36 PM 2168 (0x0878) Script Execution returned error message: & : File C:\Windows\CCM\SystemTemp\67d54b0a-d6ee-4fed-809a-6ce225bf9b48.ps1 cannot be loaded. The file C:\Windows\CCM\SystemTemp\67d54b0a-d6ee-4fed-809a-6ce225bf9b48.ps1 is not digitally signed. The script will not execute on the system. For more information, see about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170. At line:1 char:3 + & 'C:\Windows\CCM\SystemTemp\67d54b0a-d6ee-4fed-809a-6ce225bf9b48.ps1' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : SecurityError: (:) [], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess , ExitCode: 1 AppDiscovery 3/11/2013 5:41:36 PM 2168 (0x0878) Script Execution Returned :1, Error Message: & : File C:\Windows\CCM\SystemTemp\67d54b0a-d6ee-4fed-809a-6ce225bf9b48.ps1 cannot be loaded. The file C:\Windows\CCM\SystemTemp\67d54b0a-d6ee-4fed-809a-6ce225bf9b48.ps1 is not digitally signed. The script will not execute on the system. For more information, see about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170. At line:1 char:3 + & 'C:\Windows\CCM\SystemTemp\67d54b0a-d6ee-4fed-809a-6ce225bf9b48.ps1' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : SecurityError: (:) [], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess . [AppDT Id: ScopeId_C2C3E2A6-CD6C-4041-815A-40099562602C/DeploymentType_5c5f1be5-647e-4203-9e93-e10f76a4ffe0, Revision: 18] AppDiscovery 3/11/2013 5:41:36 PM 2168 (0x0878) CScriptHandler::DiscoverApp failed (0x87d00327). AppDiscovery 3/11/2013 5:41:36 PM 2168 (0x0878) Deployment type detection failed with error 0x87d00327. AppDiscovery 3/11/2013 5:41:36 PM 2168 (0x0878) Failed to perform detection of app deployment type WMF 3.0 Win7SP1 x64 and 2008 R2 SP1(WMF 3.0 Win7SP1 x64 and 2008 R2 SP1, revision 18) for system. Error 0x87d00327 AppDiscovery 3/11/2013 5:41:36 PM 2168 (0x0878)
As you can see, the PowerShell script that performs the application detection can't be run because it is unsigned. I've tried the following to fix it, but nothing is helping:
1. I signed the script using a code signing certificate issued by my enterprise CA
2. I added a "run command line" step before the application that sets the PowerShell execution policy to Bypass. I also tried Unrestricted which didn't help either. After the OSD task sequence failed, I verifid that the PowerShell execution policy had been changed.
I should also note that the above detection method works just fine if I run it using regular application deployment from within the full Windows OS. It only fails if run during an OSD task sequence.
Any suggestions?
Thanks,
--Russel