SagiVarma
Member
- Messages
- 15
- Reaction score
- 0
- Points
- 1
HI Garth,What exactly is in your Powershell script?
HI Garth,What exactly is in your Powershell script?
www.recastsoftware.com
Hi Garth,Have you tested your script using the local system account?
![]()
How to Access the Local System Account - Recast
Learn how to access the local system account Windows uses for ConfigMgr tasks to troubleshoot permissions and replicate client behavior.www.recastsoftware.com
Are you using a program or application to deploy this?
Hi Garth,Have you tested your script using the local system account?
![]()
How to Access the Local System Account - Recast
Learn how to access the local system account Windows uses for ConfigMgr tasks to troubleshoot permissions and replicate client behavior.www.recastsoftware.com
Are you using a program or application to deploy this?
For 100% clarity, you use the Local System account. e.g. you use psexec to access the account and then run the script.Hi Garth,
We created an application.
Yes. I tested my script on a local system and it runs successfully and installs the msi file and exe file and creates bgptray.exe on the startup menu and replaces it with bgp tray agent shortcut.
I also tested the script when it is in the SCCM Server path location and executed in powershell with Network path defined and it ran successfully.
So that is NOT testing with the local system account. Please read the blog and use PSexec to access the local system account and test the script again.Hi Garth,
I opened the Powershell ISE window on the test device which is a windows 10 workstation and executed the script which worked fine. I created an application in SCCM for the script and when I deployed to the windows 10 workstation. the application is shown in the software center. when I run it from software center then the error comes as shown in my earlier screenshot.
Thanks & Regards,
Sagi Varma
Why can't you run it?I am unable to execute the psexec utility.
So, what you are saying is that you can't test the script in the same manor that ConfigMgr will execute it. You need to talk to your client about allowing you to solve this problem.HI Garth,
My client provided me Domain account to use on the client workstation. I do not have local system account to execute the script.
Thanks & Regards,
Sagi Varma
Look at your environment variable. There will be one for the shared desktop.Hi Garth,
There is one more request regarding this script. The shortcut icon should be copied to the Default profile start Menu on windows 10 and windows 11. By default, windows 10 default profile has start Menu under default profile but windows 11 does not have it.
Please suggest.
Thanks & regards,
Sagi varma
if I may, so in our environment, even though psexec is an option, it is a pain sometimes getting it to a client device, so I have a package that I publish to the machine that will run cmd or PowerShell as the system account. I do this when I want to do an apples to apples test for scripts etc. All you do is create a package in mecm, no source files, then for the command line just put cmd.exe /c start c:\windows\system32\cmd.exe. Set the environment to whether user logged on or not, select the run with administrative rights, and check the box to allow users to interact with this program. Push it a collection as available. I have one called QA/Testing, then I just add and remove devices as needed. I do a lot of packaging, so this is how I emulate the way MECM will deploy it. See if that works for you.try to add this two lines at the begginning of the script
Start-Process pwsh -Verb runAs
Set-ExecutionPolicy -ExecutionPolicy Bypass -Force -Verbose