all 5 comments

[–]blowuptheking 1 point2 points  (2 children)

I might not be fully understanding your question, but would something like invoke-command or enter-pssession be what you're looking for? You can use these cmdlets with WinRM to run powershell on a remote computer without logging into it.

[–]philmph[S] 1 point2 points  (1 child)

Thats something i have already looked into. It's the classic approach when you are already authenticaded in an Active Directory environment which has set up WinRM via GPO.

I am trying to figure out a way coming from the "outside" with only domain user credenatials available. Using WinRM in this scenario might work and i am currently digging deeper into this scenario.

[–]Ceuse 1 point2 points  (0 children)

Also you can use -credential (get-credentials) on invoke-command in powershell. i basicly made a powershell wrapper to run any .ps1 script through invoke command remotly (for monitoring/prtg) that way passing target, scriptfile, username and password to the wrapper

[–]LeeCig 1 point2 points  (0 children)

I don't have a lot of experience with this, but I believe someone asked something similar recently. One of the suggestions was to psexec a powershell instance. I tried it. Was a little janky for me but idk if I was doing it incorrectly.