-
Notifications
You must be signed in to change notification settings - Fork 2
PS Remote
Dominic Oram edited this page Jun 12, 2019
·
7 revisions
Wiki > The Backend System > Useful tools > Powershell Remote
Remote Powershell can be used on the NDX machines to run arbitrary command line scripts remotely. This could be useful for example if you want to run something as the database admin without having to interrupt instruments running. WARNING: This is obviously very dangerous, you will have the power to run any commands and could affect the running instrument quite severely
- Start a powershell terminal as administrator
- Run
Enable-PSRemoting
you should see an output like:
WinRM has been updated to receive requests.
WinRM service type changed successfully.
WinRM service started.
WinRM has been updated for remote management.
WinRM firewall exception enabled.
- Run
Set-Item -Path WSMan:\localhost\Client\TrustedHosts -Value * -Force
this will allow your machine to access others
Once the above setup has been done you can use powershell remote as follows:
- Start a Powershell terminal (does not need to be admin)
- Run
$cred=get-credential
you will see a pop up box asking for you to input some credentials - Input the credentials for an instrument admin account (remember to put in an instrument machine as the domain but this can be any instrument machine, the credentials will still work for remote access as long as the machine has the same administrator account)
- Run
Invoke-Command -Credential $cred instrument_machine { command }