Jump to content


  • 0
Deilson Oliveira

[Help] - Powershell script SMSTSPostAction

Question

I need to install Symantec Endpoint Protection, what would the command line be like in powershell where I can call a .ps1 script in a completely hidden and silent way?

image.thumb.png.40b2774d856adb957f40c8054b9ac79b.png

I did a previous TS that copies the setup64.exe from SEP to "C:\TEMP\" I don't have much knowledge on powerhsell as would the script that would install it silently? the argument for installing it via Batch File is / s. However, the CMD window appears during Windows logon, and Powershell can do all of this without any windows appearing, and I wanted powershell to wait for the installation to finish (I researched this and think the parameter is -WaitProcess but I don't know where how to put it) and after the installation is finished, delete the TEMP folder and restart the computer.

Any help with that please?

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0
34 minutes ago, anyweb said:

I'd suggest you test Powershell Application Deployment Toolkit, it's what most Enterprises use to install apps in ConfigMgr today

The problem with that is that I don’t know ANYTHING, nor how to implement it, I’ll spend a lot of time (which I don’t have) to study the documentation, while the script, just insert it in the fields and it’s ready, and in the next version of the system image, I’ll have time to be able to put this tool into practice.

Is it more complex to do the scrtipt than to use this tool? I even joined some lines but it is not working.

 

Edit: I downloaded the tool, for me it is absurdly complex to study this now, because the image I am making is ready (using the Batch File, however the CMD.exe window keeps appearing during the login screen) I just wanted to switch to powershell.

Edited by Deilson Oliveira

Share this post


Link to post
Share on other sites

  • 0

Update: I put this in the SMSTSPostAction field:

  • START powershell.exe -ExecutionPolicy ByPass -WindowStyle Hidden -File "C:\TEMP\install.ps1"

And inside the .ps1 file there is this:

  • Start-Process -NoNewWindow -Wait -FilePath "C:\TEMP\setup64.exe" -ArgumentList "/s" -PassThru
  • Remove-Item -path C:\TEMP -Force -Recurse -ErrorAction SilentlyContinue
  • Remove-Item -path C:\_SMSTaskSequence -Force -Recurse -ErrorAction SilentlyContinue
  • Restart-Computer

However you are not installing, do not delete the folders also just restart the computer at the end, any help?

Share this post


Link to post
Share on other sites

  • 0

ok first things first, the SMSTSPostAction variable is for use in operating system deployment task sequences to do an action after the task sequence has completed,

are you planning on installing SEP as part of a task sequence ? if so use an Install Application step instead of Install Package if that's easier, or even run PowerShell script...

but first, if you really want to install the app just using a powershell script then test the script on a virtual machine standalone, outside of a task sequence

  • Like 1

Share this post


Link to post
Share on other sites

  • 0
On 11/30/2020 at 3:42 AM, anyweb said:

ok first things first, the SMSTSPostAction variable is for use in operating system deployment task sequences to do an action after the task sequence has completed,

are you planning on installing SEP as part of a task sequence ? if so use an Install Application step instead of Install Package if that's easier, or even run PowerShell script...

but first, if you really want to install the app just using a powershell script then test the script on a virtual machine standalone, outside of a task sequence

I apologize for the delay. I made some adjustments and managed to make it work, thank you very much!

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
Answer this question...

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