Page 1 of 1

Make Primal Script Package Hidden in Sccm package

Posted: Tue Mar 07, 2017 9:54 am
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

Re: Make Primal Script Package Hidden in Sccm package

Posted: Tue Mar 07, 2017 10:14 am
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

Re: Make Primal Script Package Hidden in Sccm package

Posted: Tue Mar 07, 2017 11:36 am
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.

Re: Make Primal Script Package Hidden in Sccm package

Posted: Tue Mar 07, 2017 3:10 pm
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.

Re: Make Primal Script Package Hidden in Sccm package

Posted: Thu Mar 09, 2017 9:17 am
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?

Re: Make Primal Script Package Hidden in Sccm package

Posted: Thu Mar 09, 2017 9:38 am
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" ?

Re: Make Primal Script Package Hidden in Sccm package

Posted: Mon Mar 13, 2017 10:59 am
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.

Re: Make Primal Script Package Hidden in Sccm package

Posted: Mon Mar 13, 2017 11:15 am
by Alexander Riedel
I see you are using a 2012 version, I am not sure we have something from back then. I will look.

Re: Make Primal Script Package Hidden in Sccm package

Posted: Tue Mar 14, 2017 6:16 am
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.