Custom attributes for VM in vCenter
16lz
2021-03-15
For VMs in the Same Folder
Get-Folder "Server" | Get-VM | Sort Name | FT -AutosizeGet-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 -AutosizeGet-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"
©著作权归作者所有:来自51CTO博客作者520feng2007的原创作品,如需转载,请注明出处,否则将追究法律责任好知识,才能预见未来
赞赏
0人进行了赞赏支持
更多相关文章
- centos7 系统自带的OpenJDK切换成的Oracle JDK版本(以JDK1.8为例)
- 同用户不能同时打开Google Chrome谷歌浏览器
- CodeHub#4 前情预告|H5 容器在技术实践中的应用
- JavaScript 将字符串转换为对象
- ack 挂载nas-pvc报错 mount: wrong fs type bad option
- ORA-27154: post/wait create failed
- 对linux配置文件的处理----grep&sed
- MySQL5.6 myisam表修复
- 超级简单的应用虚拟化软件 [RemoteApp Tool]