How to extend volume using powershell?

僤鯓⒐⒋嵵緔 提交于 2020-01-23 16:56:30

问题


How to extend volume using powershell (I prefer WMI over powershell remoting) on remote computer ?

OS is win XP sp3.


回答1:


I ended up with somethin like this:

Invoke-Command -ComputerName $compName -Credential $compCred -ScriptBlock {"rescan","select volume 2","extend" | diskpart}

I'm still looking for better solution, if there is one.




回答2:


There is a set of scripts Microsoft's Storage Team wrote to handle this that can also be hooked into System Insights as automated remediation actions:

https://blogs.technet.microsoft.com/filecab/2018/06/19/creating-remediation-actions-for-system-insights/

You can also see my answer with PowerShell function here, in Remotely extend a partition using WMI:



来源:https://stackoverflow.com/questions/4797173/how-to-extend-volume-using-powershell

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!