Download

How to Use PowerShell to Take a Screenshot of a Remote Computer

You can learn how to use PowerShell to take a screenshot of a remote computer through command lines. This overview covers the best techniques for capturing images on a Windows remote computer.

By @Irene Last Updated February 9, 2026

How to Use PowerShell to Take a Screenshot of Remote Computer

PowerShell is widely used by IT administrators for remote automation and system management, so it is often the first tool people consider when they need to capture a screenshot of a remote computer. In theory, PowerShell can interact with Windows graphical components through .NET libraries, making screen capture possible. In practice, however, remote execution introduces major limitations related to user sessions and permissions. This works by using PowerShell remoting to run the screenshot code remotely. The image is saved on the remote computer, not the local one.

Step 1. Run the PowerShell script on the target computer, either manually, through a scheduled task, or as part of an automated script. The screenshot will be taken on that machine at the moment the script runs.

Step 2. Load the required .NET assemblies using Add-Type. The System.Drawing assembly is used to create and manage image data, while System.Windows.Forms is required to detect screen information such as resolution.

Step 3. Define an output path where the screenshot will be saved. This path must exist and be writable, for example a folder like C:\Temp, to ensure the image file can be created successfully.

Step 4. Detect the screen resolution by reading the primary screen bounds from System.Windows.Forms.Screen. This step ensures the screenshot matches the full visible screen size.

Step 5. Create a bitmap object in memory using the detected screen width and height. This bitmap acts as a blank image that will hold the captured screen content.

Step 6. Generate a graphics object from the bitmap. This graphics object is responsible for drawing and copying visual data into the bitmap.

Step 7. Use the CopyFromScreen method to copy all visible screen pixels into the bitmap. This is the step where the actual screenshot is captured.

Step 8. Save the bitmap as an image file and release system resources by disposing of the graphics and bitmap objects. The screenshot can then be reviewed later for troubleshooting or documentation purposes.

You can follow this example to use PowerShell to take a screenshot of a remote computer:

# Define remote computer name

$RemoteComputer = "REMOTE-PC-NAME"

# Define screenshot save path on the remote computer

$OutputPath = "C:\Temp\PowerShellScreenCapture.jpg"

Invoke-Command -ComputerName $RemoteComputer -ScriptBlock {

Add-Type -AssemblyName System.Drawing Add-Type -AssemblyName System.Windows.Forms

# Get primary screen resolution $ScreenBounds = [System.Windows.Forms.Screen]::PrimaryScreen.Bounds

# Create bitmap matching screen resolution $Bitmap = New-Object System.Drawing.Bitmap ` $ScreenBounds.Width, $ScreenBounds.Height

# Create graphics object $Graphics = [System.Drawing.Graphics]::FromImage($Bitmap)

# Copy screen content into bitmap $Graphics.CopyFromScreen( $ScreenBounds.Location, [System.Drawing.Point]::Empty, $ScreenBounds.Size )

# Save screenshot $Bitmap.Save($using:OutputPath, [System.Drawing.Imaging.ImageFormat]::Jpeg)

# Clean up $Graphics.Dispose() $Bitmap.Dispose() }

🔥The Easiest Way to Take Remote Screenshots: AnyViewer

For IT staff and remote workers who want quick results without complex scripts, AnyViewer is a practical choice. It provides an easy way to capture remote screens while avoiding the setup and permission issues that often come with command-based tools. This makes it ideal for daily support tasks and routine monitoring.

Once you connect to a remote device, taking a screenshot is straightforward. You just click the Screenshot button, and the image is saved directly to your local computer. There is no need to adjust display drivers or manually paste images into other programs. Because AnyViewer supports unattended access, you can capture screens even when no one is logged in, which is useful for checking servers or background tasks.

AnyViewer also removes common technical barriers. You do not need to configure firewalls, open ports, or change system policies. It reliably shows the real screen without black display issues, and all image data is protected with strong encryption during transfer. By combining speed, simplicity, and security, AnyViewer makes remote screenshot capture much easier and more efficient.

Download Freeware Win PCs & Servers
Secure Download

Step 1. Install and launch AnyViewer on both computers. Go to Log in > Sign up to create an AnyViewer account. (If you already have signed up on its official website, you can log in directly.)

Step 2. Then you can see you successfully logged in to AnyViewer. Your device will automatically be assigned to the account you've logged in. 

Step 3. Log in to the same AnyViewer account on the two devices;  On your local device, go to Device, and then you can achieve a direct connection by clicking One-click control

Then you can capture the remote screen in the same way you would on a local computer.

Comparison: PowerShell vs. AnyViewer

Feature PowerShell / Scripts AnyViewer
Setup Difficulty High (Requires coding & WinRM config) Low (Install & Go)
Session Handling Often captures Black Screen (Session 0) Captures Visible Desktop (Auto-handling)
Security Requires lowering execution policies Uses End-to-End ECC Encryption
Best Use Case Mass deployment (100+ PCs at once) Troubleshooting specific machines

Conclusion

While PowerShell and CMD offer powerful automation capabilities, they are often ill-suited for graphical tasks like screen capture due to Session 0 isolation and permission complexities.

For administrators who need reliable, high-fidelity visual logs without the risk of black screens or security loopholes, a dedicated tool like AnyViewer is the professional choice. It allows you to focus on what is on the screen, rather than worrying about how to capture it.

Download Freeware Win PCs & Servers
Secure Download

FAQs

1. Can PowerShell really take a screenshot of a remote computer?
Yes, PowerShell can take a screenshot by running a script on the remote computer using PowerShell remoting. The capture depends on the active user session and permissions.

2. Where is the screenshot saved when using PowerShell remoting?
The screenshot is saved on the remote computer, not on the local machine. You must specify a writable path on the target device, such as C:\Temp.

3. Why do PowerShell screenshots sometimes show a black screen?
This usually happens because the script runs in a non interactive session, such as Session 0, which cannot access the visible desktop.

4. What .NET components are required for PowerShell screen capture?
The script requires System.Drawing to create and save images, and System.Windows.Forms to detect screen resolution and display information.

5. Why is AnyViewer easier than PowerShell for remote screenshots?
AnyViewer captures the visible desktop directly and saves images to the local computer. It avoids scripting, session issues, and permission problems, making it faster for daily use.