0

我想从 WDS 服务器(Windows 部署服务)远程获取图像列表。

我正在使用 PowerShell 命令Get-WdsInstallImage,它需要最高权限。

我尝试了以下命令,但它们不起作用:

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}
4

1 回答 1

0

尝试这个:

$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

-Credentials必要时不要忘记使用。

于 2021-02-01T15:33:29.640 回答