Powershell Session File Transfer
β‘ PowerShell Remoting File Transfers β When HTTP/SMB Arenβt Available
Need to move files but HTTP, HTTPS, or SMB are blocked? π± No worries β PowerShell Remoting (WinRM) has your back! π‘οΈ
With PowerShell sessions, you can send and receive files from remote systems using built-in cmdlets like Copy-Item
. π§³π
π§ What is PowerShell Remoting?
PowerShell Remoting allows you to:
Run commands/scripts on remote systems
Transfer files between your machine and the remote
Use sessions for persistent connections
It works over:
π‘ HTTP (port 5985)
π HTTPS (port 5986)
By default, enabling PowerShell Remoting creates listeners on both!
Step 1: Confirm Who You Are & Where You Are
You're logged in as Administrator
on DC01 β
Step 2: Confirm Remote Host is Reachable (WinRM Port 5985)
π Output:
β We can connect β WinRM is open and listening!
Step 3: Create a Remote PowerShell Session
π If you're already Administrator
on the remote machine, no credentials needed!
Step 4: Transfer File FROM Local β‘οΈ Remote
π This copies samplefile.txt
from DC01 to DATABASE01.
Step 5: Transfer File FROM Remote β‘οΈ Local
π This pulls DATABASE.txt
from DATABASE01 and saves it to C:\
on DC01.
Optional Cleanup: Close the Session
π‘ Always good practice to close what you open. π
Last updated