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
Make Primal Script Package Hidden in Sccm package
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.
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.
- nathanthegr8
- Posts: 5
- Last visit: Tue Mar 14, 2017 12:44 pm
- Alexander Riedel
- Posts: 8479
- Last visit: Thu Mar 28, 2024 9:29 am
- Been upvoted: 37 times
Re: Make Primal Script Package Hidden in Sccm package
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
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- nathanthegr8
- Posts: 5
- Last visit: Tue Mar 14, 2017 12:44 pm
Re: Make Primal Script Package Hidden in Sccm package
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.
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.
- Alexander Riedel
- Posts: 8479
- Last visit: Thu Mar 28, 2024 9:29 am
- Been upvoted: 37 times
Re: Make Primal Script Package Hidden in Sccm package
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.
SAPIEN Technologies, Inc.
- nathanthegr8
- Posts: 5
- Last visit: Tue Mar 14, 2017 12:44 pm
Re: Make Primal Script Package Hidden in Sccm package
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?
- Alexander Riedel
- Posts: 8479
- Last visit: Thu Mar 28, 2024 9:29 am
- Been upvoted: 37 times
Re: Make Primal Script Package Hidden in Sccm package
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" ?
I am not sure what you mean by "the different consoles" ?
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- nathanthegr8
- Posts: 5
- Last visit: Tue Mar 14, 2017 12:44 pm
Re: Make Primal Script Package Hidden in Sccm package
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.
- Alexander Riedel
- Posts: 8479
- Last visit: Thu Mar 28, 2024 9:29 am
- Been upvoted: 37 times
Re: Make Primal Script Package Hidden in Sccm package
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.
SAPIEN Technologies, Inc.
- nathanthegr8
- Posts: 5
- Last visit: Tue Mar 14, 2017 12:44 pm
Re: Make Primal Script Package Hidden in Sccm package
If you can't find 2012 something for the 2017 power shell studio would work. I just bought that on a personal account.