Jump to content


anyweb

How can I display custom messages in a task sequence using PowerShell in System Center Configuration Manager (Current Branch)

Recommended Posts

On 5/26/2017 at 11:46 PM, anyweb said:

works fine for me, what happens when you click on it ?

I had the same problem, created an account to post a reply and then the link was working :-)

The file is probably only available for registered users

Share this post


Link to post
Share on other sites

Hello,

I am running into the issue where the logs are returning a failure code of "(Failed to run the action: Display Message. Unknown error (Error: FFFFFFFF; Source: Unknown)" when running the same process as you have detailed above. The title and return code are hardcoded into the powershell script, while the message is inherited through a variable in the task sequence. Even with a timeout aligned to the "Display Message" step that would allow for it to run for a set period of time, the step becomes skipped and no window appears. Have you seen this before, and if so what did you do for the remediation path?

image.thumb.png.0d2426930def5a4aa9aa587f0e8e1361.png

Share this post


Link to post
Share on other sites

Hi,

I reviewed the how to article over and over again but my task sequence fails with the error  Failed to run the action: Display Custom Message.  Incorrect function. (Error: 00000001; Source: Windows)

This is my cmd line: ServiceUI.exe -process:TSProgressUI.exe %windir%\System32\WindowsPowerShell\v1.0\powershell.exe -WindowStyle Hidden -NoProfile -ExecutionPolic y bypass -nologo -file DisplayCustomMessage.ps1

I tried disabling 64-bit file system redirection and it didn't work.

I copied ServiceUI.exe for 32bits to the package folder as you mentioned.

smsts.log:

Downloaded file from http://srvsccm2012.domain.edu.local:443/nocert_sms_dp_smspkg$/isu00150/sccm?/ServiceUI.exe to C:\_SMSTaskSequence\Packages\ISU00150\ServiceUI.exe     InstallSoftware    10/22/2018 9:22:51 AM    3272 (0x0CC8)
VerifyContentHash: Hash algorithm is 32780    InstallSoftware    10/22/2018 9:22:51 AM    3272 (0x0CC8)
Content successfully downloaded at C:\_SMSTaskSequence\Packages\ISU00150.    InstallSoftware    10/22/2018 9:22:51 AM    3272 (0x0CC8)
Resolved source to 'C:\_SMSTaskSequence\Packages\ISU00150'    InstallSoftware    10/22/2018 9:22:51 AM    3272 (0x0CC8)
Command line for extension .exe is "%1" %*    InstallSoftware    10/22/2018 9:22:51 AM    3272 (0x0CC8)
Set command line: Run command line    InstallSoftware    10/22/2018 9:22:51 AM    3272 (0x0CC8)
Working dir 'C:\_SMSTaskSequence\Packages\ISU00150'    InstallSoftware    10/22/2018 9:22:51 AM    3272 (0x0CC8)
Executing command line: Run command line    InstallSoftware    10/22/2018 9:22:51 AM    3272 (0x0CC8)
Process completed with exit code 1    InstallSoftware    10/22/2018 9:22:58 AM    3272 (0x0CC8)
InstallSoftware    10/22/2018 9:22:58 AM    3272 (0x0CC8)
 =======================    InstallSoftware    10/22/2018 9:22:58 AM    3272 (0x0CC8)
 Matched Processes    InstallSoftware    10/22/2018 9:22:58 AM    3272 (0x0CC8)
 =======================    InstallSoftware    10/22/2018 9:22:58 AM    3272 (0x0CC8)
 Process Found: [TsProgressUI.exe] ID [11208] SESSION [5]    InstallSoftware    10/22/2018 9:22:58 AM    3272 (0x0CC8)
InstallSoftware    10/22/2018 9:22:58 AM    3272 (0x0CC8)
 =======================    InstallSoftware    10/22/2018 9:22:58 AM    3272 (0x0CC8)
 Logon Lookup    InstallSoftware    10/22/2018 9:22:58 AM    3272 (0x0CC8)
 =======================    InstallSoftware    10/22/2018 9:22:58 AM    3272 (0x0CC8)
 [winlogon.exe] Session: [5] PID [12604] [Target Session [5] = Match]    InstallSoftware    10/22/2018 9:22:58 AM    3272 (0x0CC8)
InstallSoftware    10/22/2018 9:22:58 AM    3272 (0x0CC8)
 =======================    InstallSoftware    10/22/2018 9:22:58 AM    3272 (0x0CC8)
 Launch Process    InstallSoftware    10/22/2018 9:22:58 AM    3272 (0x0CC8)
 =======================    InstallSoftware    10/22/2018 9:22:58 AM    3272 (0x0CC8)
 Program to launch : [C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe]    InstallSoftware    10/22/2018 9:22:58 AM    3272 (0x0CC8)
 Command line      : [C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -WindowStyle Hidden -NoProfile -ExecutionPolic y bypass -nologo -file DisplayCustomMessage.ps1]    InstallSoftware    10/22/2018 9:22:58 AM    3272 (0x0CC8)
InstallSoftware    10/22/2018 9:22:58 AM    3272 (0x0CC8)
 Process launching with PID [8036]    InstallSoftware    10/22/2018 9:22:58 AM    3272 (0x0CC8)
 Process exit code [1]    InstallSoftware    10/22/2018 9:22:58 AM    3272 (0x0CC8)
InstallSoftware    10/22/2018 9:22:58 AM    3272 (0x0CC8)
 =======================    InstallSoftware    10/22/2018 9:22:58 AM    3272 (0x0CC8)
 Exiting with [1]    InstallSoftware    10/22/2018 9:22:58 AM    3272 (0x0CC8)
 =======================    InstallSoftware    10/22/2018 9:22:58 AM    3272 (0x0CC8)
Command line "C:\_SMSTaskSequence\Packages\ISU00150\ServiceUI.exe"  -process:TSProgressUI.exe C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -WindowStyle Hidden -NoProfile -ExecutionPolic y bypass -nologo -file DisplayCustomMessage.ps1 returned 1    InstallSoftware    10/22/2018 9:22:58 AM    3272 (0x0CC8)
ReleaseSource() for C:\_SMSTaskSequence\Packages\ISU00150.    InstallSoftware    10/22/2018 9:22:58 AM    3272 (0x0CC8)
reference count 1 for the source C:\_SMSTaskSequence\Packages\ISU00150 before releasing    InstallSoftware    10/22/2018 9:22:58 AM    3272 (0x0CC8)
Released the resolved source C:\_SMSTaskSequence\Packages\ISU00150    InstallSoftware    10/22/2018 9:22:58 AM    3272 (0x0CC8)
Process completed with exit code 1    TSManager    10/22/2018 9:22:58 AM    10276 (0x2824)
!--------------------------------------------------------------------------------------------!    TSManager    10/22/2018 9:22:58 AM    10276 (0x2824)
Failed to run the action: Display Custom Message. 
Incorrect function. (Error: 00000001; Source: Windows)    TSManager    10/22/2018 9:22:58 AM    10276 (0x2824)
 

 

 

This is my TS:

 

myts001.PNG

Share this post


Link to post
Share on other sites

Actually I didn't change anything at first but somehow I was not able to make it worked. Because msgbox coming empty, I thought it could not get the title, message values from TS. Then I decided to change the PS file and enter the custom message, title in the ps file, instead of fetching from TS. It works now. Here is the PS file I am using. Thanks. 

 

[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") [System.Windows.Forms.MessageBox]::Show("This is the first line of your msg. `nThis is the second line of the msg", "This is the Title of Msg Box", [Windows.Forms.MessageBoxButtons]::OK, [Windows.Forms.MessageBoxIcon]::Warning)

Exit 0 

Share this post


Link to post
Share on other sites

On 10/22/2018 at 3:24 PM, selimatmaca said:

Ups,

I just noticed my cmd line is wrong. Changing "-ExecutionPolic y bypass" to "-ExecutionPolicy bypass" fixed it. Now message box pops up but there is no title and message. :(  

myemptybox.PNG.005e84535d6d78f4e4698facb3a16ef3.PNG

Strange i have the same blank pop up too after i have moved over from sccm 2007 to current branch.

Share this post


Link to post
Share on other sites

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...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.