>From an elevated command prompt, run psexec -s -i <command line>
 
Another alternative is to run the following from an elevated command prompt:
 
psexec -s -i cmd.exe
 
This will open a command prompt as system and then you can run whatever 
commands you want and it will simulate how the configmgr client will run them
 
Jeff
 
From: dratl...@humana.com
To: mssms@lists.myitforum.com
Subject: [mssms] RE: Deploy PowerShell script
Date: Tue, 6 Jan 2015 15:43:44 +0000









Here are two quick links, I think its basically psexec –s –i.

 
http://blogs.technet.com/b/askds/archive/2008/10/22/getting-a-cmd-prompt-as-system-in-windows-vista-and-windows-server-2008.aspx

 
http://windowsitpro.com/systems-management/psexec

 

Daniel Ratliff

 


From: listsad...@lists.myitforum.com [mailto:listsad...@lists.myitforum.com]
On Behalf Of Kent, Mark

Sent: Tuesday, January 06, 2015 10:38 AM

To: mssms@lists.myitforum.com

Subject: [mssms] RE: Deploy PowerShell script


 
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: 
listsad...@lists.myitforum.com [mailto:listsad...@lists.myitforum.com]
On Behalf Of Daniel Ratliff

Sent: Tuesday, January 6, 2015 10:29 AM

To: mssms@lists.myitforum.com

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:
listsad...@lists.myitforum.com [mailto:listsad...@lists.myitforum.com]
On Behalf Of Kent, Mark

Sent: Tuesday, January 06, 2015 10:18 AM

To: mssms@lists.myitforum.com

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.
 
 


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