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

hi i just tried it, and it works fine, you must be a member in order to download it, so did you try downloading it before becoming a member ? if so, now that you are a member simply re-try the download and you'll see it will work.

Share this post


Link to post
Share on other sites

How about this? No need for packages, or ServiceUI.

Run as a command line:

powershell.exe -command (new-object -ComObject Microsoft.SMS.TsProgressUI).CloseProgressDialog() ; (new-object -ComObject wscript.shell).Popup('Message Goes Here.',0,'Title Bar Text',0x0 + 0x30) ; Exit 0
 

Share this post


Link to post
Share on other sites

Can you re-upload the displaycustommessage.ps1 ? Its not available.

I have another question i hope you will help me with.

I created a messagebox with ok/cancel like this:

$box = [System.Windows.Forms.MessageBox]::show("Strømforsyningen er ikke tilsluttet.`n `n1.Tilslut strømforsyningen og tryk på OK for at forsætte.`n2.Tryk på Cancel for at annullere installationen.`n `nMed venlig hilsen`nFMI KAKI","Advarsel",1,48)

Switch ($box) {
    "OK" {
        Write-Host "Du trykkede OK"    
        Exit 0
    }
    "Cancel" {
        Write-Host "Du trykkede Cancel"
        Exit 99
    }
}

When i run it in Windows it works perfectly, the same when i try in Winpe manually. But when i put it in Task Sequence, the messagebox never appear and exit with 0 every time in Winpe, where I need to use it.

 

Share this post


Link to post
Share on other sites

hi

the powershell script is there, you just need to be logged in as a member to download it, so please try again.

the reason your popup doesn't appear is because it's running as system context, so you never see it (but SYSTEM does...), that's why we use ServiceUI.exe to get around that problem

Share this post


Link to post
Share on other sites

48 minutes ago, anyweb said:

good point... so can you fill me in with why you want to do this, give me a scenario...

May be i am wrong, I am deploying couple applications in custom TS. When the user run from software center it pops up message to close some applications. but what happens if I deploy it as required, does to run and popup message and wait to press ok or it continues?

 

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.