cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Execute command from PowerShell

4,810

I have no experience with SAP, but I should create a PowerShell script. I've taken a look at the SAP community and found some examples like https://blogs.sap.com/2015/09/26/how-to-use-powershell-for-automated-login-to-sap/ which explain how to log on to the SAP GUI. In addition to that, I should be able to execute a command from CLI. The command is:

.\sapshcut -system=EHD -client=102 -user=myUserName -PW=myPass -maxgui -command="va03"

Is it possible to execute this command after the logon thru the PowerShell script?

Thanks

View Entire Topic

Hello Stefan,

in meantime, I researched more on-site and on the Internet and found all steps to successfully perform your code example. Now I'm able to execute transaction "BAMBI" and receive/read an error. So the last step for me will be to test this approach as a background task when nobody logged on. Anyway, thank you for your help.

Best regards,

Vladimir

Stefan-Schnell
Active Contributor
0 Likes

prusacv

Hello Vladimir,
sorry for my delayed reply. In my opinion it should not be possible to execute an SAP GUI Script when nobody is logged on. Let us know your results.
Thanks and best regards
Stefan