Answer the question
In order to leave comments, you need to log in
How to run an exe file on a remote PC using powershell?
I have a problem that I've been dealing with for a week now.
I wrote a script to install SQL software in a couple of hours, but I still can't run the exe file correctly.
The problem is that the odbc.exe driver does not want to run as an administrator.
If you just take it with your hands and run it through the admin (right-click), then everything is fine. If you just click it, it will seem to show that it has been installed, but in fact it is not (this point is clear to me).
I did the following options.
$lock = Get-Credential "doman\admin"
Invoke-command - computername $Computer - Credential $lock - ScriptBlock {
Start- process - Filepath "C:\New\odbc. exe -argumentlist - Verb runAs}
Answer the question
In order to leave comments, you need to log in
Try to use these solutions
https://habr.com/ru/company/pc-administrator/blog/...
From my experience I will say that in the code you do not have enough credential (log \ pass) to execute the command.
In those conditions where I wrote a similar script, alas, it didn’t even work because there were strict IS policies and no one was going to change them. That's why sometimes it's a dead number.
You can try workarounds by throwing the batch file into TEMP and launching it if through powershell. An alternative is accessing CMD via Invoke-command.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question