Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →The supported way to automate a screenshot of a VMware virtual-machine console is the vSphere API operation VirtualMachine.createScreenshot_Task. In PowerCLI, authenticate to vCenter, obtain the VM object, verify that it is powered on, call the method, wait for its task to finish, and retrieve the PNG at the location returned by the interface. The operation requires the VirtualMachine.Interact.CreateScreenshot privilege.
Do not build new automation around the old vCenter /screen POST URL: Broadcom says that route is no longer implemented in vSphere 8. The API task is the durable approach; the Managed Object Browser (MOB) and an ESXi host UI remain fallback methods when you need a manual or migration aid.
What the VMware screenshot API actually captures
createScreenshot_Task captures the current display of a powered-on virtual machine. It was available beginning with vSphere API 4.0 and reports InvalidPowerState when the VM is not powered on. The result is an image generated by vSphere, not a file created inside the guest operating system.
Your service account needs the VirtualMachine.Interact.CreateScreenshot privilege on the VM (or an inherited parent inventory object). Authentication, authorization, power state, task completion, and file retrieval are separate steps, so treat them separately in a production workflow.
Recommended Free Tools
#1 Best Overall
PowerCLI: a repeatable end-to-end workflow
Prerequisites
- VMware PowerCLI installed on the automation host.
- Network access to vCenter and permission to authenticate.
- A vCenter account with
VirtualMachine.Interact.CreateScreenshot. - The target VM powered on and displaying the state you want to capture.
- A destination directory with enough space and a retention policy for generated PNG files.
One screenshot with PowerCLI
PowerCLI exposes the underlying managed object through ExtensionData. The following script resolves a VM by inventory name, invokes the task, waits for completion, and prints the task result. VMware versions and client wrappers can expose the returned file location slightly differently; always use the location in the completed task result rather than assuming a hard-coded datastore path.
param(
[Parameter(Mandatory=$true)][string]$vCenter,
[Parameter(Mandatory=$true)][string]$VMName,
[Parameter(Mandatory=$true)][string]$OutputDirectory = (Join-Path $PWD 'vm-screenshots')
)
Import-Module VMware.PowerCLI
Set-PowerCLIConfiguration -Scope User -ParticipateInCEIP $false -Confirm:$false | Out-Null
$credential = Get-Credential -Message "vCenter credentials"
Connect-VIServer -Server $vCenter -Credential $credential | Out-Null
try {
$vm = Get-VM -Name $VMName -ErrorAction Stop
if ($vm.PowerState -ne 'PoweredOn') {
throw "VM '$VMName' is $($vm.PowerState). Power it on before capturing a screenshot."
}
New-Item -ItemType Directory -Path $OutputDirectory -Force | Out-Null
$taskMo = $vm.ExtensionData.CreateScreenshot_Task()
$task = Get-Task -Id $taskMo.Value -ErrorAction Stop
do {
Start-Sleep -Seconds 1
$task = Get-Task -Id $taskMo.Value -ErrorAction Stop
} while ($task.State -eq 'Running' -or $task.State -eq 'Queued')
if ($task.State -ne 'Success') {
throw "Screenshot task ended with state $($task.State): $($task.Description)"
}
$result = $task.ExtensionData.Info.Result
$stamp = Get-Date -Format 'yyyyMMdd-HHmmss'
$safeName = ($VMName -replace '[^A-Za-z0-9_.-]', '_')
$manifest = [pscustomobject]@{
VM = $VMName
CapturedUtc = (Get-Date).ToUniversalTime().ToString('o')
Task = $taskMo.Value
Result = $result
}
$manifest | ConvertTo-Json | Set-Content (Join-Path $OutputDirectory "$safeName-$stamp.json")
Write-Host "Screenshot task completed. Retrieve the PNG from: $result"
}
finally {
Disconnect-VIServer -Server $vCenter -Confirm:$false | Out-Null
}
The manifest is intentional: it records the VM, UTC capture time, task identifier, and returned result so a second process can retrieve or archive the image deterministically. If your PowerCLI release represents the result as a managed-object property rather than a plain string, inspect $task.ExtensionData.Info and adapt the retrieval step to that documented representation.
Capturing several VMs
For a fleet, keep one vCenter session open, resolve each VM by a unique inventory path where names are duplicated, and process tasks with a bounded concurrency limit. Record a per-VM outcome instead of aborting the whole batch when one VM is powered off or unauthorized. Use a filename such as inventory-path_UTC-timestamp.png; never rely on a VM’s display name alone.
Python with pyVmomi
Python automation can call the same managed-object method through pyVmomi. Install the SDK in your automation environment, use TLS validation appropriate to your vCenter policy, and grant the same privilege as the PowerCLI account.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Rank #2
from datetime import datetime, timezone
import ssl, time
from pyVim.connect import SmartConnect, Disconnect
from pyVmomi import vim
VCENTER = "vcenter.example.com"
USER = "automation@example.com"
PASSWORD = "YOUR_PASSWORD"
VM_NAME = "Web-01"
context = ssl.create_default_context() # Prefer your vCenter CA in production
si = SmartConnect(host=VCENTER, user=USER, pwd=PASSWORD, sslContext=context)
content = si.RetrieveContent()
try:
view = content.viewManager.CreateContainerView(
content.rootFolder, [vim.VirtualMachine], True)
vm = next((item for item in view.view if item.name == VM_NAME), None)
view.Destroy()
if vm is None:
raise RuntimeError(f"VM not found: {VM_NAME}")
if vm.runtime.powerState != vim.VirtualMachinePowerState.poweredOn:
raise RuntimeError(f"VM is {vm.runtime.powerState}; power it on first")
task = vm.CreateScreenshot()
while task.info.state in (vim.TaskInfo.State.queued, vim.TaskInfo.State.running):
time.sleep(1)
if task.info.state != vim.TaskInfo.State.success:
raise RuntimeError(str(task.info.error))
print({
"vm": VM_NAME,
"captured_utc": datetime.now(timezone.utc).isoformat(),
"result": task.info.result,
})
finally:
Disconnect(si)
In a long-running service, replace the example’s name-only search with a managed object reference or inventory path, cache the vCenter session carefully, and renew it when the session expires.
What changed in vSphere 8
The removed /screen route
Older scripts commonly sent a POST request to a vCenter URL resembling /screen?id=...&h=...&w=.... Broadcom documents that this method is no longer implemented in vSphere 8. A script that receives a 404, unsupported-method response, or an empty result after an upgrade is usually still using that legacy route. Migrate it to createScreenshot_Task rather than trying different query-string dimensions.
MOB and ESXi host alternatives
Broadcom lists the MOB method and the ESXi host UI as alternatives. The MOB-generated image is saved in the VM’s directory and must then be retrieved, which adds datastore or host-file access to the workflow. These options are useful during migration or diagnosis, but the API task is easier to authorize and monitor consistently in unattended automation.
Choosing the right method
| Method | Best use | Power state | Extra dependencies | vSphere 8 note |
|---|---|---|---|---|
createScreenshot_Task via PowerCLI/SDK |
Server-side scheduled capture and batch jobs | Must be powered on | Create-screenshot privilege; task polling; result retrieval | Supported API path |
| MOB method | Manual fallback or migration troubleshooting | Use the state required by the MOB operation | Browser/MOB access and retrieval from the VM directory | Documented alternative |
| ESXi host UI | One-off operator capture | Use the UI’s required state | Host access and manual download | Documented alternative |
Invoke-VMScript |
An image produced by software inside the guest | Must be powered on | VMware Tools, guest credentials, network access, guest-operation privileges | Not a console screenshot API |
When Invoke-VMScript is appropriate
Invoke-VMScript runs PowerShell, BAT, or Bash inside the guest. It is useful when the application itself can render an image—for example, a test browser in the VM saves a PNG to a known path. It does not automatically capture the vSphere console. The VM must be powered on, VMware Tools must be installed and running, guest (or applicable host) credentials must be available, network connectivity to ESXi is required, and guest-operation privileges are needed on vCenter/ESXi 5.0 and later.
Rank #3
$script = 'powershell.exe -NoProfile -Command "& { & ''C:Toolscapture-app.ps1'' -Output ''C:Tempapp.png'' }"'
Invoke-VMScript -VM (Get-VM -Name 'Web-01') `
-ScriptType Powershell `
-ScriptText $script `
-GuestCredential (Get-Credential) `
-ErrorAction Stop
Copy the resulting file with a guest file-transfer mechanism, or have the guest upload it to controlled storage. Use the API task instead when the desired image is the VM’s console display.
Snapshots are not screenshots
New-Snapshot records VM state; it does not create a viewable console image. On a powered-on VM, -Quiesce asks VMware Tools to quiesce the guest file system before the snapshot. A snapshot can protect you before testing a destructive automation change, but it is not a substitute for createScreenshot_Task, and snapshots require their own storage and lifecycle management.
Reliability, performance, and retention
- Wait for readiness: power-on is necessary but may not mean the guest UI is ready. If your goal is an application screen, coordinate readiness inside the guest or capture after a known delay.
- Poll tasks: treat queued, running, success, and error as distinct states; apply a timeout so a stuck task cannot consume a worker forever.
- Control concurrency: capture in bounded batches to avoid overloading vCenter, hosts, or shared storage.
- Make retries safe: retry transient connection failures with backoff, but do not blindly retry authorization errors, invalid power state, or a missing VM.
- Protect images: screenshots may contain credentials, customer data, or personal information. Restrict the output directory, encrypt transport and storage, and define deletion dates.
- Keep an audit record: store VM identity, vCenter, UTC timestamp, task ID, result location, and final status without placing passwords in logs.
Troubleshooting
InvalidPowerState
The VM is not powered on. Start it or select a different target. A powered-on state still does not guarantee that the desired application has finished loading.
Not authorized or privilege errors
Grant VirtualMachine.Interact.CreateScreenshot on the VM or an inherited inventory object, then reconnect so the session receives updated permissions. For guest scripts, separately verify guest-operation privileges.
Rank #4
404 or unsupported legacy URL
Remove the old /screen POST call and invoke createScreenshot_Task through PowerCLI or an SDK. Do not treat a changed width or height parameter as a fix.
Task succeeds but no image is found
Log the completed task’s result and follow the location documented by the interface you used. MOB captures are stored in the VM directory and require a separate retrieval step. Check datastore permissions, path escaping, and retention cleanup.
Guest script fails
Confirm VMware Tools is running, guest credentials are valid, the VM can reach the ESXi system, and the requested interpreter exists. Remember that the script’s output is guest-generated, not the vSphere console.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Or skip the browser setup
If what you actually need is automated screenshots of web pages rather than a VMware console, ScreenshotNeo provides a single HTTP call and an MCP server for AI clients. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report the page verdict and billing status. It is not a replacement for the vSphere VM-console API; it is a simpler service for website images and PDFs.
See the ScreenshotNeo API documentation for all options, including full-page and element capture, device and retina settings, PDF output, custom JavaScript/CSS, waits, request blocking, headers, cookies, geolocation, caching, signed links, async webhooks, bulk capture, and usage reporting.
Best Value
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const fs = await import('node:fs/promises');
await fs.writeFile('shot.webp', Buffer.from(await res.arrayBuffer()));
ScreenshotNeo includes an MCP server with take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.
FAQ
Does the API work on an ESXi host without vCenter?
The documented workflow targets the vSphere managed-object API through vCenter or an equivalent SDK session. For host-only operations, use the ESXi UI or the interface supported by your deployment and verify its permissions separately.
Can I choose PNG dimensions with createScreenshot_Task?
Do not depend on the removed /screen URL’s width and height parameters. Capture through the supported task and process or resize the returned image afterward if your downstream system requires fixed dimensions.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallWill a powered-off VM produce a screenshot of its last screen?
No. The API reports InvalidPowerState when the VM is not powered on.
Frequently Asked Questions
Does the API work on an ESXi host without vCenter?
The documented workflow targets the vSphere managed-object API through vCenter or an equivalent SDK session. For host-only operations, use the ESXi UI or the interface supported by your deployment and verify its permissions separately.
Can I choose PNG dimensions with createScreenshot_Task?
Do not depend on the removed /screen URL’s width and height parameters. Capture through the supported task and process or resize the returned image afterward if your downstream system requires fixed dimensions.
Will a powered-off VM produce a screenshot of its last screen?
No. The API reports InvalidPowerState when the VM is not powered on.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

