List images from WDS remotely

361 views Asked by At

I want to get list of Images from a WDS Server (Windows Deployment Services) remotely.

I'm using the PowerShell command Get-WdsInstallImage and it needs the highest privileges.

I'm tried the below commands, but they don't work:

Invoke-Command -ComputerName "<computer name>" -Authentication Kerberos -Credential $(Get-Credential) -ScriptBlock {Get-WdsInstallImage}

Invoke-Command -ComputerName "<computer name>" -ScriptBlock {Start-Process PowerShell.exe Get-WdsInstallImage -verb runAs}
1

There are 1 answers

0
Slogmeister Extraordinaire On

Try this:

$w=Get-WmiObject -ComputerName "<target system>" -Namespace "root\CIMV2" -Class "MSFT_WdsBootImage" -EnableAllPrivileges -List
$x=$w.Get()
$x.cmdletOutput

$y=Get-WmiObject -ComputerName "<target system>" -Namespace "root\CIMV2" -Class "MSFT_WdsInstallImage" -EnableAllPrivileges -List
$z=$y.Get()
$z.cmdletOutput

Don't forget to use -Credentials if necessary.