VMware Cloud Community
tdubb123
Expert
Expert
Jump to solution

get-vmhostprofile - get configuration

any idea how I can get specific settings in a vm host profile?

something like

Screen Shot 2020-08-10 at 10.09.02 AM.png

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

There is no general rule, but in this case, it is rather straightforward.

$profName = 'My HostProfile'

$hp = Get-VMHostProfile -Name $profName

$hp.ExtensionData.Config.ApplyProfile.Property | where{$_.PropertyName -match 'snmp'} |

ForEach-Object -Process {

    $_.Profile.Property.Profile.Policy.policyoption.Parameter

}

Since the structure of a hostprofile is not too obvious and poorly documented, it mostly boils down to a trial and error situation.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

Reply
0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

There is no general rule, but in this case, it is rather straightforward.

$profName = 'My HostProfile'

$hp = Get-VMHostProfile -Name $profName

$hp.ExtensionData.Config.ApplyProfile.Property | where{$_.PropertyName -match 'snmp'} |

ForEach-Object -Process {

    $_.Profile.Property.Profile.Policy.policyoption.Parameter

}

Since the structure of a hostprofile is not too obvious and poorly documented, it mostly boils down to a trial and error situation.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
tdubb123
Expert
Expert
Jump to solution

thanks luc

Reply
0 Kudos