locked
Executing Remote Powershell script on a Workgorup Server with user tracking RRS feed

  • Question

  • Hi all,

    Not being the greatest PoweShell/Scripting person I was hoping someone here can point me in the right direction.

    The Requirement

    To execute a remote Powershell script script on remote Server A (Workgroup, NON-Domain connected) from Server B (Domain Connected), to perform a series of actions on.  The solution needs to hold the person running it accountable by using a local account on Server A which is logged in the Event Log as a logon .

    Ideally, the solution would ONLY allow this one script to execute remotely and nothing else.

    Is Powershell even the best way to execute this?  Any advice would be greatly appreciated.

    Regards,
    Martin


    • Edited by M. Franqueira Wednesday, January 31, 2018 4:47 PM
    • Moved by Bill_Stewart Monday, March 12, 2018 8:47 PM This is not "scripts on demand"
    Wednesday, January 31, 2018 4:38 PM

All replies

  • This forum is not for creating full scripts. Please visit the script requesting forum for that.

    This forum is for help on specific scripting issues, please let us know what you have tried and what errors you are getting.

    Wednesday, January 31, 2018 5:24 PM
  • Please carefully review the following to set your expectation of technical forums.

    This Forum is for Scripting Question Rather than script requests

    Script Gallery.

    Learn PowerShell  

    Script requests


    \_(ツ)_/

    Wednesday, January 31, 2018 7:47 PM
  • Using PS-Session cmdlet you can connect to the remote server by providing even local credentials.

    New-PSSession -Session $s -Credential User01

    After creating a session you can run the PS1 script remotely using invoke-command.

    invoke-command -Session $s -FilePath C:\powerscript.ps1


    • Edited by asharma5 Thursday, February 1, 2018 1:22 AM
    Thursday, February 1, 2018 1:21 AM