Could you show me what the syntax of what that command should look like?  
Sorry, haven't used psexc in forever.

Mark Kent (MCP)
Sr. Desktop Systems Engineer
Computing & Technology Services - SUNY Buffalo State

From: [email protected] [mailto:[email protected]] On 
Behalf Of Daniel Ratliff
Sent: Tuesday, January 6, 2015 10:29 AM
To: [email protected]
Subject: [mssms] RE: Deploy PowerShell script

Why are you calling it via sysnative? Does your script only work with 64-bit 
PowerShell? If you are going to do that, don't try to control it via the 
script, let SCCM determine the proper architecture.

What happens when you run your script manually with psexec -s? This will 
emulate the SYSTEM account, just like deploying from SCCM.

Daniel Ratliff

From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]] On Behalf Of Kent, Mark
Sent: Tuesday, January 06, 2015 10:18 AM
To: [email protected]<mailto:[email protected]>
Subject: [mssms] Deploy PowerShell script

We are running SCCM 2012 R2 CU1 with Windows 7 64bit clients.  I have a simple 
script that I am trying to deploy as a package/program.  The command line is:

%WINDIR%\Sysnative\WindowsPowerShell\v1.0\powershell.exe -executionpolicy 
Bypass -file .\Remove2010LNK.PS1

If I manually run the script from within powershell, it works fine.  If I 
deploy it from SCCM, it says it runs successfully but I can tell it does not, 
and it also completes in seconds when it should take a couple minutes.  I've 
tried sending it out via a task sequence with the same result, it says it runs 
successfully but it isn't.  The only odd thing I noted in the EXECMGR log is:

Running "C:\Windows\sysnative\WindowsPowerShell\v1.0\powershell.exe" 
-executionpolicy Bypass -file .\Remove2010LNK.PS1 with 32bitLauncher

Should it still state "with 32bitlauncher" if I am telling it to use the 64bit 
one?

My last recourse may be to take the script lines and shove it into a CMD batch 
file, but I'd really like to figure out why this isn't working.  Thanks.

Mark Kent (MCP)
Sr. Desktop Systems Engineer
Computing & Technology Services - SUNY Buffalo State



The information transmitted is intended only for the person or entity to which 
it is addressed
and may contain CONFIDENTIAL material. If you receive this material/information 
in error,
please contact the sender and delete or destroy the material/information.




Reply via email to