Hey all
Can anyone help me with the cmdlet above pls?
What I'm trying to do is simply do a search in our VC against certain 'custom attributes' and confirm the VMs associated with them.
(i.e. custom attribute 'RED' has a VM servers called 'SERVER1,SERVER2 etc.')
i've tried to find the objects associated with this and all i get is the following objects:
ServerId
Server
Key
Name
TargetType
Uid
Client
So how can i use these to get something that reports back a VM servernames ???
As usual - Many thanks in advance for your help
Munster99
Sure, try it like this
Get-VM | Get-Annotation -CustomAttribute "Red" | Where {$_.Value}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Not sure I "get" the question, but do you mean something like this
Get-VM | Get-Annotation -CustomAttribute "Red"
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
thanks LucD
Wow, is that it ??? (I love powercli).
I've noticed it brings back ALL the entries is there a way to filter out the ones with no value please ?
munster99
Sure, try it like this
Get-VM | Get-Annotation -CustomAttribute "Red" | Where {$_.Value}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
As per usual LucD your a life saver !
thanks
munster99