使用Invoke-VMScript并运行powershell脚本以管理员身份扩展HDD?

时间:2017-10-30 12:19:26

标签: powershell powercli

我已经尝试了所有可能的解决方案,使用Invoke-VMScript扩展硬盘使用未分配的空间来扩展磁盘。我使用了域名管理员和本地管理员凭证的guestcredential,但每次我尝试它都显示相同的错误。

 Resize-Partition : Access to a CIM 
resource was not available to the client.
|  At line:1 char:4
|  + & {Resize-Partition -DriveLetter E -Size 200.85GB}
|  +    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|      + CategoryInfo          : PermissionDenied: 
(MSFT_Partition:ROOT/Microsoft 
|     /.../MSFT_Partition) [Resize-Partition], CimException
|      + FullyQualifiedErrorId : MI RESULT 2,Resize-Partition

我正在使用以下命令:

Invoke-VMScript -VM server1 -GuestUser admin -GuestPassword Asd@12345 -ScriptText "Resize-Partition -DriveLetter D -Size 99.50GB"

请帮助我们,因为我已经尝试了论坛中的所有解决方案以及其他资源。

请不要将其标记为重复的问题,因为任何答案都没有帮助。

0 个答案:

没有答案
相关问题