VMware Cloud Community
tdubb123
Expert
Expert
Jump to solution

Get-spbmEntityConfiguration shows complianceStatus is blank

I am trying to get a compliance report check with 

 

Get-spbmEntityConfiguration -VM $vm

 

but the ComplianceStatus column is showing blank even though in vcenter it shows as compliant

 

any idea?

 

tdubb123_0-1619184330303.png

 

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

I see the same in 12.3.
Might be a "feature", perhaps best to open an SR.


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

View solution in original post

0 Kudos
6 Replies
LucD
Leadership
Leadership
Jump to solution

I see the same in 12.3.
Might be a "feature", perhaps best to open an SR.


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

0 Kudos
tdubb123
Expert
Expert
Jump to solution

thanks Luc

Tags (1)
0 Kudos
tdubb123
Expert
Expert
Jump to solution

Luc,

 

I tried it on powercli v11 and works.

 

question is how do I get the Storage policy/status for both The VM and hard disks

 

 

0 Kudos
LucD
Leadership
Leadership
Jump to solution

There are 2 parametersets for the Get-spbmEntityConfiguration cmdlet, the 2nd one has a Harddisk parameter.


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

0 Kudos
tdubb123
Expert
Expert
Jump to solution

trying to get this to work. But only able to get the VM 

 

 

foreach ($dc in $dcs) {

      $clusters = $dc | get-cluster

        foreach ($cluster in $clusters) {

                    foreach ($vm in $vms) {

                        $VMpol = Get-SpbmEntityConfiguration $vm 

                       # foreach ($hd in (Get-HardDisk -VM $vm) {

                        $VMHDPol = Get-SpbmEntityConfiguration -HardDisk $hd

                        $row = "" | select VC, datacenter, cluster, VMHost, VM, HD, StoragePolicy, TimeofCheck, ComplianceStatus

                        $row.vc = $vc

                        $row.datacenter = $dc.name

                        $row.cluster = $cluster.Name

                        $row.VM = $vmpol.Name

                        $row.Storagepolicy = $vmpol.Storagepolicy.Name

                        $row.TimeofCheck = $vmpol.TimeofCheck

                        $row.ComplianceStatus = $vmpol.ComplianceStatus

                        $report += $row

                        } 

 

                    } 

                 }

              }

              $report | ft -AutoSize

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Did you try like this?

Get-Datacenter -PipelineVariable dc |
    Get-Cluster -PipelineVariable cluster |
    Get-VM -PipelineVariable vm |
    Get-HardDisk -PipelineVariable hd |
    ForEach-Object -Process {
        New-Object -TypeName PSObject -Property ([ordered]@{
                Datacenter   = $dc.Name
                Cluster      = $cluster.Name
                VM           = $vm.Name
                VMSpbmStatus = (Get-SpbmEntityConfiguration -VM $vm).ComplianceStatus
                HD           = $hd.Name
                HDSpbmStatus = (Get-SpbmEntityConfiguration -HardDisk $hd).ComplianceStatus
            })
    } | Format-Table -AutoSize


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

0 Kudos