Macros48
Macros48

Reputation: 3

How do I get remote access with PowerShell?

I want to connect to a specific set of laptops on our domain remotely. I need to have it log to the C drive, and search out a specific folder, then report back on a specific file contained in the folder. I have found scripts that have shown me how to locate and show if the path exists, along with a specific file name at the end of the path. I created a test file on my laptop and the script worked flawlessly. However, I need it to reach out over our domain, log into the target laptop, locate the file and contents then create a report on the findings. This will need to be done over VPN to the devices on our network.

My main issue at this point is finding the commands to invoke PowerShell to log onto the remote computers.

Upvotes: 0

Views: 785

Answers (1)

Alex_P
Alex_P

Reputation: 2950

A rough overview on how to remote execute commands with PowerShell.

  1. Enable PSRemoting with Enable-PSRemoting MS docs
  2. Establish a remote connection with Enter-PSSession -ComputerName testserver123.global.local
  3. This opens a prompt of the remote server where you can run commands. Your PS prompt will get a prefix indicating the remote server.

A useful link is here from 4sysops

Upvotes: 1

Related Questions