select distinct
ME.ManagedEntityRowId
,ME.Name
,ME.DisplayName
,ME.Path
,MET.ManagedEntityTypeDefaultName
,p.PropertyXml.value('(/Root/Property[@Guid[. =
sql:column("vmetp.PropertyGuid")]]/text())[1]','nvarchar(256)')
as HostName
,p.PropertyXml.value('(/Root/Property[@Guid[. =
sql:column("vmetp2.PropertyGuid")]]/text())[1]','nvarchar(256)')
as cpucount
,p.PropertyXml.value('(/Root/Property[@Guid[. =
sql:column("vmetp3.PropertyGuid")]]/text())[1]','nvarchar(256)')
as guestHostName
,p.PropertyXml.value('(/Root/Property[@Guid[. =
sql:column("vmetp4.PropertyGuid")]]/text())[1]','nvarchar(256)')
as clustername
,p.PropertyXml.value('(/Root/Property[@Guid[. =
sql:column("vmetp5.PropertyGuid")]]/text())[1]','nvarchar(256)')
as MaxMem
,p.PropertyXml.value('(/Root/Property[@Guid[. =
sql:column("vmetp6.PropertyGuid")]]/text())[1]','nvarchar(256)')
as DiskAllocationGB
,p.PropertyXml.value('(/Root/Property[@Guid[. =
sql:column("vmetp7.PropertyGuid")]]/text())[1]','nvarchar(256)')
as UsesStorage
from vManagedEntity ME
inner join vManagedEntityManagementGroup MEMG on
MEMG.ManagedEntityRowId = ME.ManagedEntityRowId
inner join vManagedEntityType MET on
MET.ManagedEntityTypeRowId = ME.ManagedEntityTypeRowId
inner join vManagedEntityProperty p on
p.ManagedEntityRowId=ME.ManagedEntityRowId and p.ToDateTime is
Null
Inner join vManagedEntityTypeProperty vmetp on
vmetp.ManagedEntityTypeRowId=ME.ManagedEntityTypeRowId and
vmetp.PropertySystemname like 'hostname'
Inner join vManagedEntityTypeProperty vmetp2 on
vmetp2.ManagedEntityTypeRowId=ME.ManagedEntityTypeRowId and
vmetp2.PropertySystemname like 'cpucount'
Inner join vManagedEntityTypeProperty vmetp3 on
vmetp3.ManagedEntityTypeRowId=ME.ManagedEntityTypeRowId and
vmetp3.PropertySystemname like 'guestHostName'
Inner join vManagedEntityTypeProperty vmetp4 on
vmetp4.ManagedEntityTypeRowId=ME.ManagedEntityTypeRowId and
vmetp4.PropertySystemname like 'clustername'
Inner join vManagedEntityTypeProperty vmetp5 on
vmetp5.ManagedEntityTypeRowId=ME.ManagedEntityTypeRowId and
vmetp5.PropertySystemname like 'maxmem'
Inner join vManagedEntityTypeProperty vmetp6 on
vmetp6.ManagedEntityTypeRowId=ME.ManagedEntityTypeRowId and
vmetp6.PropertySystemname like 'DiskAllocationGB'
Inner join vManagedEntityTypeProperty vmetp7 on
vmetp7.ManagedEntityTypeRowId=ME.ManagedEntityTypeRowId and
vmetp7.PropertySystemname like 'UsesStorage'
order by MET.ManagedEntityTypeDefaultName
|