Skip to content

[Help] - Powershell script SMSTSPostAction

Featured Replies

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?

  • Author
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

  • Author

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?

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

  • 11 months later...
  • Author
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!

  • 4 years later...

Sure this was four years ago, but I think it is selfish you posted for help, and glad you got it working, but you did not share how you got it working. I am not seeking the fix, but it would help others that may be. However, as suggested, and not sure why you opted for the post action route, it makes sense to install as an application or a package, or publish the app so based on a query or whatever means of targeting it gets installed POST OSD. 

Edited by Abnrangerx67
more info

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.