首页 > 其他 > 详细

Custom attributes for VM in vCenter

时间:2021-03-15 19:20:37      阅读:18      评论:0      收藏:0      [点我收藏+]
For VMs in the Same Folder

Get-Folder "Server" | Get-VM | Sort Name | FT -Autosize
Get-Folder "Server" | Get-VM | Set-Annotation -CustomAttribute "Department" -Value "IT"
Get-Folder "Server" | Get-VM | Set-Annotation -CustomAttribute "Owner" -Value "Richard"
Get-Folder "Server" | Get-VM | Set-Annotation -CustomAttribute "Requester" -Value "Amy"

For VM Name with the Same Prefix

Get-VM "FAMSC*" | Sort Name | Select Name, PowerState, NumCpu, MemoryGB, VMHost, Folder | FT -Autosize
Get-VM "FAMSC*" | Set-Annotation -CustomAttribute "Department" -Value "IT"
Get-VM "FAMSC*" | Set-Annotation -CustomAttribute "Owner" -Value "Richard"
Get-VM "FAMSC*" | Set-Annotation -CustomAttribute "Requester" -Value "Amy"

For single VM

Get-VM "FAMSCAD01" | Set-Annotation -CustomAttribute "Department" -Value "IT"
Get-VM "FAMSCAD01" | Set-Annotation -CustomAttribute "Owner" -Value "Richard"
Get-VM "FAMSCAD01" | Set-Annotation -CustomAttribute "Requester" -Value "Amy"

Custom attributes for VM in vCenter

原文:https://blog.51cto.com/549687/2660423

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!