Monday, August 22, 2016

Get the value of a NoteProperty

You get to a NoteProperty by putting the entire note property in quotes like this:

(Get-SCOMClass -Name 'Microsoft.Windows.Computer'|Get-SCOMClassInstance)[0].'[Microsoft.Windows.Computer].PrincipalName'.Value

I had a hard time Googling how-to get to the value of NoteProperty fields on (OpsMgr) powershell objects until I found Steve's blog:

http://stevesbog.loungent.com/2014/02/19/using-square-brackets-in-powershell-queries/#.V7sELvmF5aQ

The simple trick I needed was to put the entire property in quotes.





No comments: