Make Primal Script Package Hidden in Sccm package

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 7 years and 2 weeks old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
nathanthegr8
Posts: 5
Last visit: Tue Mar 14, 2017 12:44 pm

Make Primal Script Package Hidden in Sccm package

Post by nathanthegr8 »

Product, version and build:
Primal Script 2012 6.5.171 64 bit
Windows 7 Service Pack 1 with latest patches as of January 2017.

I have also tried
Trial Primal Script 2017 64bit 7.3.100
Windows 10

I am trying to package a script with a service account credentials to run inside an SCCM package. I have packaged the script fine and when I run it manually it does what I want, upload certain files to a network drive. However when I put it into an sccm task sequence and try to make it run "hidden" it fails instantly. I have reduced the script to just a simple Start-Sleep -s 4 command and it still fails as soon as I enable the hidden option. Is there not a way to make the script run in the background where or not a user is logged in?

image of the setting I am talking about
http://imgur.com/a/g2ifZ
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: Make Primal Script Package Hidden in Sccm package

Post by Alexander Riedel »

Please indicate how you packaged the script and, most importantly, what the failure is. By just saying it "fails" we cannot really determine what goes wrong :D
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
nathanthegr8
Posts: 5
Last visit: Tue Mar 14, 2017 12:44 pm

Re: Make Primal Script Package Hidden in Sccm package

Post by nathanthegr8 »

It is packaged through the "script Packager" utility

General settings
-Engine Type MS Windows Powershell (command line), also tried Sapien Powershell Host (Command line)
- V3 Engine
- Default Manifest

Folders, running from C:\temp

Security
myuser@domain
password
Run as User

Files
1 ps1 file, contents of is Start-Sleep -s 5


The sccm returns an error code of -1,which is pretty generic I think. I added a screenshot of my log file at http://imgur.com/a/g2ifZ
I understand this not the most helpful but I have narrowed down my problem to the fact I am trying to run the package and not allow user interaction. Once I allow it, it works fine. 2 cmd windows pop up and it pauses for a few moments. I had a test were I Write-Output "It is working" but I thought that might be messing up the hidden mode so I deleted it. Let me know what else I can provide.
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: Make Primal Script Package Hidden in Sccm package

Post by Alexander Riedel »

Hmm, assuming your script needs neither input nor produces output I would package with the SAPIEN Script Host for Windows. That requires no console, since windows applications don't have that. That may make a difference.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
nathanthegr8
Posts: 5
Last visit: Tue Mar 14, 2017 12:44 pm

Re: Make Primal Script Package Hidden in Sccm package

Post by nathanthegr8 »

Changing it to that host worked! It now runs, however it never stops.... The only command in the package is "Start-Sleep -s 5". It has been more then 5 seconds. Could you link to documentation that explains the different consoles?
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: Make Primal Script Package Hidden in Sccm package

Post by Alexander Riedel »

I would stop immediately after the last statement. See what happens if you run the exe yourself.
I am not sure what you mean by "the different consoles" ?
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
nathanthegr8
Posts: 5
Last visit: Tue Mar 14, 2017 12:44 pm

Re: Make Primal Script Package Hidden in Sccm package

Post by nathanthegr8 »

Sorry I meant the different engine types settings. And you were right It throws and error when just running the exe, of error 1 invalid characters. I will figure that out on my own. But yeah if you could link to something explaining the engine types.
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: Make Primal Script Package Hidden in Sccm package

Post by Alexander Riedel »

I see you are using a 2012 version, I am not sure we have something from back then. I will look.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
nathanthegr8
Posts: 5
Last visit: Tue Mar 14, 2017 12:44 pm

Re: Make Primal Script Package Hidden in Sccm package

Post by nathanthegr8 »

If you can't find 2012 something for the 2017 power shell studio would work. I just bought that on a personal account.
This topic is 7 years and 2 weeks old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.