Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstanceDiscovery (Discovery)

Element properties:

TargetMicrosoft.KnowledgeServices.Exchange.2010.DatabaseEngine
EnabledTrue
Frequency44071
RemotableFalse

Object Discovery Details:

Discovered Classes and their attribuets:

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource Microsoft.Windows.TimedPowerShell.DiscoveryProvider Default

Source Code:

<Discovery ID="Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstanceDiscovery" Enabled="true" Target="MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseEngine" ConfirmDelivery="true" Remotable="true" Priority="Normal">
<Category>Discovery</Category>
<DiscoveryTypes>
<DiscoveryClass TypeID="MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.MailboxDatabaseCopy"/>
</DiscoveryTypes>
<DataSource ID="DS" TypeID="Windows!Microsoft.Windows.TimedPowerShell.DiscoveryProvider">
<IntervalSeconds>44071</IntervalSeconds>
<SyncTime/>
<ScriptName>ExchangeDatabaseDiscovery.ps1</ScriptName>
<ScriptBody><Script>

param($SourceId,$ManagedEntityId,$KeyPropertyPrincipalName,$ServerName)

$ErrorActionPreference = "Continue"

# Set up the arguments
$scriptargs = new-object psobject
$scriptargs | add-member NoteProperty "SourceId" $SourceId
$scriptargs | add-member NoteProperty "ManagedEntityId" $ManagedEntityId
$scriptargs | add-member NoteProperty "KeyPropertyPrincipalName" $KeyPropertyPrincipalName
$scriptargs | add-member NoteProperty "ServerName" $ServerName

# Set up the discovery output
function CreateDiscoveryOutput()
{
$discoveryoutput = new-object psobject
$discoveryoutput | add-member NoteProperty "Status" ""
$discoveryoutput | add-member NoteProperty "StatusHashCode" ""
$discoveryoutput | add-member NoteProperty "ContentIndexState" ""
$discoveryoutput | add-member NoteProperty "ContentIndexStateHashCode" ""
$discoveryoutput | add-member NoteProperty "ActiveCopy" ""
$discoveryoutput | add-member NoteProperty "DatabaseName" ""
$discoveryoutput | add-member NoteProperty "ServerName" ""
$discoveryoutput | add-member NoteProperty "DatabaseSize" ""
$discoveryoutput | add-member NoteProperty "DatabaseSizeMB" ""
$discoveryoutput | add-member NoteProperty "AvailableNewMailboxSpace" ""
$discoveryoutput | add-member NoteProperty "AvailableNewMailboxSpaceMB" ""
$discoveryoutput | add-member NoteProperty "EdbFilePath" ""
$discoveryoutput | add-member NoteProperty "EdbFilePathDriveName" ""
$discoveryoutput | add-member NoteProperty "EdbFilePathDriveFreeSpace" ""
$discoveryoutput | add-member NoteProperty "EdbFilePathDriveFreeSpacePercent" ""
$discoveryoutput | add-member NoteProperty "EdbFilePathDriveFreeSpaceMB" ""
$discoveryoutput | add-member NoteProperty "Mounted" ""
$discoveryoutput | add-member NoteProperty "MountedOnServer" ""
$discoveryoutput | add-member NoteProperty "OriginatingServer" ""
$discoveryoutput | add-member NoteProperty "NumberofDatabaseCopies" ""
$discoveryoutput | add-member NoteProperty "RpcClientAccessServer" ""
$discoveryoutput | add-member NoteProperty "Recovery" ""
$discoveryoutput | add-member NoteProperty "ReplicationType" ""
$discoveryoutput | add-member NoteProperty "ReplicationTypeHashCode" ""
$discoveryoutput | add-member NoteProperty "MasterServerOrAvailabilityGroup" ""
$discoveryoutput | add-member NoteProperty "MasterType" ""
$discoveryoutput | add-member NoteProperty "MasterTypeHashCode" ""
$discoveryoutput | add-member NoteProperty "LogFolderPath" ""
$discoveryoutput | add-member NoteProperty "LogFolderPathDriveName" ""
$discoveryoutput | add-member NoteProperty "LogFolderPathDriveFreeSpace" "" #"LogFolderDriveFreeSpace" ""
$discoveryoutput | add-member NoteProperty "WhenCreated" ""
$discoveryoutput | add-member NoteProperty "WhenChanged" ""
$discoveryoutput | add-member NoteProperty "CircularLoggingEnabled" ""
$discoveryoutput | add-member NoteProperty "BackgroundDatabaseMaintenance" "" #"BackgroundDatabaseMaIntegerenance" ""
$discoveryoutput | add-member NoteProperty "DatabaseCopies" ""
$discoveryoutput | add-member NoteProperty "Servers" ""
$discoveryoutput | add-member NoteProperty "ActivationPreference" ""
$discoveryoutput | add-member NoteProperty "SnapshotLastFullBackup" ""
$discoveryoutput | add-member NoteProperty "SnapshotLastIncrementalBackup" ""
$discoveryoutput | add-member NoteProperty "SnapshotLastDifferentialBackup" ""
$discoveryoutput | add-member NoteProperty "SnapshotLastCopyBackup" ""
$discoveryoutput | add-member NoteProperty "LastFullBackup" ""
$discoveryoutput | add-member NoteProperty "LastIncrementalBackup" ""
$discoveryoutput | add-member NoteProperty "LastDifferentialBackup" ""
$discoveryoutput | add-member NoteProperty "LastCopyBackup" ""
$discoveryoutput | add-member NoteProperty "MountAtStartup" ""
$discoveryoutput | add-member NoteProperty "DataMoveReplicationConstraint" "" #"DataMoveReplicationConstraInteger" ""
$discoveryoutput | add-member NoteProperty "DataMoveReplicationConstraintHashCode" "" #"DataMoveReplicationConstraIntegerHashCode" ""
$discoveryoutput | add-member NoteProperty "DistinguishedName" ""
$discoveryoutput | add-member NoteProperty "ReplayLagTimes" ""
$discoveryoutput | add-member NoteProperty "Truncationlagtimes" ""
$discoveryoutput | add-member NoteProperty "RetainDeletedItemsUntilBackup" ""
$discoveryoutput | add-member NoteProperty "IsMailboxDatabase" ""
$discoveryoutput | add-member NoteProperty "IsPublicFolderDatabase" ""
$discoveryoutput | add-member NoteProperty "PublicFolderDatabase" ""
$discoveryoutput | add-member NoteProperty "ProhibitSendReceiveQuota" ""
$discoveryoutput | add-member NoteProperty "ProhibitSendQuota" ""
$discoveryoutput | add-member NoteProperty "IndexEnabled" ""
$discoveryoutput | add-member NoteProperty "MailboxRetention" ""
$discoveryoutput | add-member NoteProperty "MailboxRetentionTotalSeconds" ""
$discoveryoutput | add-member NoteProperty "DeletedItemRetention" ""
$discoveryoutput | add-member NoteProperty "DeletedItemRetentionTotalSeconds" ""

$discoveryoutput
}
#-----------------------------------------------------
# Environment
#-----------------------------------------------------
$ScriptEnv = new-object psobject

$ScriptEnv | Add-Member ScriptMethod "GetMailboxDBCopies" -Value {
Get-MailboxDatabaseCopyStatus -Server $Env:COMPUTERNAME
}

function GetMailboxDBCopyStatbyName ($dbname,$ServerName){
Get-MailboxDatabaseCopyStatus ($dbname+ "\" + $ServerName)
}

function GetMailboxDBbyServer ($ServerName){
Get-MailboxDatabase -Server $ServerName -Status
}

#-----------------------------------------------------
# SetValue Function
# Returns value with default if property is null
# Example:
# $DiscoveryOutput.SnapshotLastFullBackup = SetValue -obj ($MailboxDB.SnapshotLastFullBackup) -default $false
#-----------------------------------------------------
function SetValue
{
param($obj,$default,$method)

if($obj -eq $null)
{
return $default
}
elseif($method -ne $null){

return Invoke-Expression "`$obj.$method"
}
else{
return $obj
}
}

#-----------------------------------------------------
# Main Discovery Function
#-----------------------------------------------------
function AdvisorDiscovery($MailboxDB, $DiscoveryOutput)
{

# Get MailboxDatabaseCopyStatus for MailboxDB
$dbcopystatus = GetMailboxDBCopyStatbyName ($MailboxDB.name) ($scriptargs.ServerName)
# Set Exchange 2010 MailboxDatabaseCopy Properties
$DiscoveryOutput.Status = SetValue -obj ($dbcopystatus.Status) -default "0" | Out-String #String
$DiscoveryOutput.StatusHashCode = SetValue -obj ($dbcopystatus.Status) -default 0 -method "GetHashCode()" #Int
$DiscoveryOutput.ContentIndexState = SetValue -obj ($dbcopystatus.ContentIndexState) -default "0" | Out-String #String
$DiscoveryOutput.ContentIndexStateHashCode = SetValue -obj ($dbcopystatus.ContentIndexState) -default 0 -method "GetHashCode()" #Int
$DiscoveryOutput.ActiveCopy = SetValue -obj ($dbcopystatus.ActiveCopy) -default $false #Bool

# Set Key Exchange 2010 Properties Common to Both Mailbox and PublicFolder Databases
$DiscoveryOutput.DatabaseName = SetValue -obj ($MailboxDB.AdminDisplayName) -default "0" | Out-String
$DiscoveryOutput.ServerName = SetValue -obj ($MailboxDB.ServerName) | Out-String
$DiscoveryOutput.DatabaseSize = SetValue -obj ($MailboxDB.DatabaseSize) -default "0" -method "ToString()"| Out-String
$DiscoveryOutput.DatabaseSizeMB = SetValue -obj ($MailboxDB.DatabaseSize) -default 0 -method "ToMB()"
$DiscoveryOutput.AvailableNewMailboxSpace = SetValue -obj ($MailboxDB.AvailableNewMailboxSpace) -default "0" -method "ToString()" | Out-String
$DiscoveryOutput.AvailableNewMailboxSpaceMB = SetValue -obj ($MailboxDB.AvailableNewMailboxSpaceMB) -default 0 -method "ToMB()"
$DiscoveryOutput.EdbFilePath = SetValue -obj ($MailboxDB.EdbFilePath.PathName) -default "0" | Out-String
$DiscoveryOutput.EdbFilePathDriveName = SetValue -obj ($MailboxDB.EdbFilePath.DriveName) -default "0" | Out-String
$EdbFilePathDriveWMIObject = (get-WmiObject win32_LogicalDisk | Where {$_.DeviceID -eq $MailboxDB.EdbFilePath.DriveName})
$DiscoveryOutput.EdbFilePathDriveFreeSpace = SetValue -obj $EdbFilePathDriveWMIObject.FreeSpace -default "0" | Out-String
$DiscoveryOutput.EdbFilePathDriveFreeSpacePercent = SetValue -obj ([Math]::Round(($EdbFilePathDriveWMIObject.FreeSpace / $EdbFilePathDriveWMIObject.Size * 100), 0)) -default 0
$DiscoveryOutput.EdbFilePathDriveFreeSpaceMB = SetValue -obj ([Math]::Round(($EdbFilePathDriveWMIObject.FreeSpace / 1024 / 1024), 0)) -default "0" | Out-String
$DiscoveryOutput.Mounted = SetValue -obj ($MailboxDB.Mounted) -default $false
$DiscoveryOutput.MountedOnServer = SetValue -obj ($MailboxDB.MountedOnServer) -default "0" | Out-String
$DiscoveryOutput.OriginatingServer = SetValue -obj $MailboxDB.OriginatingServer -default "0" | Out-String
$DiscoveryOutput.NumberofDatabaseCopies = SetValue -obj ($MailboxDB.DatabaseCopies.Count) -default 0
$DiscoveryOutput.RpcClientAccessServer = SetValue -obj ($MailboxDB.RpcClientAccessServer) -default "0" | Out-String
$DiscoveryOutput.Recovery = SetValue -obj ($MailboxDB.Recovery) -default $false
$DiscoveryOutput.ReplicationType = SetValue -obj ($MailboxDB.ReplicationType) -default "0" -method "ToString()" | Out-String
$DiscoveryOutput.ReplicationTypeHashCode = SetValue -obj ($MailboxDB.ReplicationType) -default 0 -method "GetHashCode()"
$DiscoveryOutput.MasterServerOrAvailabilityGroup = SetValue -obj ($MailboxDB.MasterServerOrAvailabilityGroup.Name) -default "0" | Out-String
$DiscoveryOutput.MasterType = SetValue -obj ($MailboxDB.MasterType) -default "0" -method "ToString()" | Out-String
$DiscoveryOutput.MasterTypeHashCode = SetValue -obj ($MailboxDB.MasterType) -default 0 -method "GetHashCode()"
$DiscoveryOutput.LogFolderPath = SetValue -obj ($MailboxDB.LogFolderPath.PathName) -default "0" | Out-String
$DiscoveryOutput.LogFolderPathDriveName = SetValue -obj ($MailboxDB.LogFolderPath.DriveName) -default "0" | Out-String
$DiscoveryOutput.LogFolderPathDriveFreeSpace = SetValue -obj (Get-WmiObject win32_LogicalDisk | Where {$_.DeviceID -eq $MailboxDB.LogFolderPath.DriveName}).FreeSpace -default "0" | Out-String
$DiscoveryOutput.WhenCreated = SetValue -obj ($MailboxDB.WhenCreated) -default (([datetime]::MinValue).ToString()) -method "ToString()" | Out-String
$DiscoveryOutput.WhenChanged = SetValue -obj ($MailboxDB.WhenChanged) -default (([datetime]::MinValue).ToString()) -method "ToString()" | Out-String
$DiscoveryOutput.CircularLoggingEnabled = SetValue -obj ($MailboxDB.CircularLoggingEnabled) -default $false
$DiscoveryOutput.BackgroundDatabaseMaintenance = SetValue -obj ($MailboxDB.BackgroundDatabaseMaintenance) -default $false
$DiscoveryOutput.DatabaseCopies = SetValue -obj (($MailboxDB.DatabaseCopies | ForEach {$_.Identity}) -join ", ") -default "0" | Out-String
$DiscoveryOutput.Servers = SetValue -obj (($MailboxDB.Servers | ForEach {$_.Name}) -join ", ") -default "0" | Out-String
$DiscoveryOutput.ActivationPreference = SetValue -obj (($MailboxDB.ActivationPreference | ForEach {$_.Key.Name + "=" + $_.Value.ToString()}) -join ", ") -default "0" | Out-String

$DiscoveryOutput.SnapshotLastFullBackup = SetValue -obj ($MailboxDB.SnapshotLastFullBackup) -default $false
$DiscoveryOutput.SnapshotLastIncrementalBackup = SetValue -obj ($MailboxDB.SnapshotLastIncrementalBackup) -default $false
$DiscoveryOutput.SnapshotLastDifferentialBackup = SetValue -obj ($MailboxDB.SnapshotLastDifferentialBackup) -default $false
$DiscoveryOutput.SnapshotLastCopyBackup = SetValue -obj ($MailboxDB.SnapshotLastCopyBackup) -default $false
$DiscoveryOutput.LastFullBackup = SetValue -obj ($MailboxDB.LastFullBackup) -method "ToString()" -default "0" | Out-String
$DiscoveryOutput.LastIncrementalBackup = SetValue -obj ($MailboxDB.LastIncrementalBackup) -method "ToString()" -default "0" | Out-String
$DiscoveryOutput.LastDifferentialBackup = SetValue -obj ($MailboxDB.LastDifferentialBackup) -method "ToString()" -default "0" | Out-String
$DiscoveryOutput.LastCopyBackup = SetValue -obj ($MailboxDB.LastCopyBackup) -method "ToString()" -default "0" | Out-String

$DiscoveryOutput.MountAtStartup = SetValue -obj ($MailboxDB.MountAtStartup) -default $true
$DiscoveryOutput.DataMoveReplicationConstraint = SetValue -obj ($MailboxDB.DataMoveReplicationConstraint) -method "ToString()" -default "0" | Out-String
$DiscoveryOutput.DataMoveReplicationConstraintHashCode = SetValue -obj ($MailboxDB.DataMoveReplicationConstraint) -method "GetHashCode()" -default 0
$DiscoveryOutput.DistinguishedName = SetValue -obj ($MailboxDB.DistinguishedName) -default "0" | Out-String
$DiscoveryOutput.ReplayLagTimes = SetValue -obj (($MailboxDB.ReplayLagTimes | ForEach {$_.Key.Name + "=" + $_.Value.ToString()}) -join ", ") -default "0" | Out-String
$DiscoveryOutput.TruncationLagTimes = SetValue -obj (($MailboxDB.TruncationLagTimes | ForEach {$_.Key.Name + "=" + $_.Value.ToString()}) -join ", ") -default "0" | Out-String
$DiscoveryOutput.RetainDeletedItemsUntilBackup = SetValue -obj ($MailboxDB.RetainDeletedItemsUntilBackup) -default $false
$DiscoveryOutput.IsMailboxDatabase = SetValue -obj ($MailboxDB.IsMailboxDatabase) -default $true
$DiscoveryOutput.IsPublicFolderDatabase = SetValue -obj ($MailboxDB.IsPublicFolderDatabase) -default $false

# Set Key Exchange 2010 Properties Specific to Mailbox Databases
$DiscoveryOutput.PublicFolderDatabase = SetValue -obj ($MailboxDB.PublicFolderDatabase.Name) -default "0" | Out-String
$DiscoveryOutput.ProhibitSendReceiveQuota = SetValue -obj ($MailboxDB.ProhibitSendReceiveQuota.Value) -method "ToString()" -default "0" | Out-String
$DiscoveryOutput.ProhibitSendQuota = SetValue -obj ($MailboxDB.ProhibitSendQuota.Value) -method "ToString()" -default "0" | Out-String
$DiscoveryOutput.IndexEnabled = SetValue -obj ($MailboxDB.IndexEnabled) -default $false
$DiscoveryOutput.MailboxRetention = SetValue -obj ($MailboxDB.MailboxRetention) -method "ToString()" -default "0" | Out-String
$DiscoveryOutput.MailboxRetentionTotalSeconds = SetValue -obj ($MailboxDB.MailboxRetention.TotalSeconds) -default 0
$DiscoveryOutput.DeletedItemRetention = SetValue -obj ($MailboxDB.DeletedItemRetention) -method "ToString()" -default "0" | Out-String
$DiscoveryOutput.DeletedItemRetentionTotalSeconds = SetValue -obj ($MailboxDB.DeletedItemRetention.TotalSeconds) -default 0
}

# Attempt to discover mailbox databases. Break if Get-MailboxDatabase returns less than one.
$mailboxDBs = GetMailboxDBbyServer $scriptargs.ServerName
If ($mailboxDBs.count -lt 1)
{
break
}

# Create a new discovery data packet
$oAPI = new-object -comObject "MOM.ScriptAPI"
$discoverydata = $oAPI.CreateDiscoveryData(0, $scriptargs.SourceId, $scriptargs.ManagedEntityId)

foreach ($mailboxDB in $mailboxDBs) {
$discoveryoutput = CreateDiscoveryOutput
$instance = $discoverydata.CreateClassInstance("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.MailboxDatabaseCopy']$")

$instance.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", $scriptargs.KeyPropertyPrincipalName)

AdvisorDiscovery $mailboxDB $discoveryoutput

# set the discovery output
$instance.AddProperty("$MPElement[Name='System!System.Entity']/DisplayName$", $discoveryoutput.DatabaseName)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/Status$", $discoveryoutput.Status)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/StatusHashCode$", $discoveryoutput.StatusHashCode)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/ContentIndexState$", $discoveryoutput.ContentIndexState)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/ContentIndexStateHashCode$", $discoveryoutput.ContentIndexStateHashCode)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.MailboxDatabaseCopy']/ActiveCopy$", $false) # $discoveryoutput.ActiveCopy)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/DatabaseName$", $discoveryoutput.DatabaseName)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/ServerName$", $discoveryoutput.ServerName)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/DatabaseSize$", $discoveryoutput.DatabaseSize)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/DatabaseSizeMB$", $discoveryoutput.DatabaseSizeMB)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/AvailableNewMailboxSpace$", $discoveryoutput.AvailableNewMailboxSpace)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/AvailableNewMailboxSpaceMB$", $discoveryoutput.AvailableNewMailboxSpaceMB)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/EdbFilePath$", $discoveryoutput.EdbFilePath)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/EdbFilePathDriveName$", $discoveryoutput.EdbFilePathDriveName)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/EdbFilePathDriveFreeSpace$", $discoveryoutput.EdbFilePathDriveFreeSpace)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/EdbFilePathDriveFreeSpacePercent$", $discoveryoutput.EdbFilePathDriveFreeSpacePercent)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/EdbFilePathDriveFreeSpaceMB$", $discoveryoutput.EdbFilePathDriveFreeSpaceMB)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/Mounted$", $discoveryoutput.Mounted)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.MailboxDatabaseCopy']/MountedOnServer$", $discoveryoutput.MountedOnServer)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/OriginatingServer$", $discoveryoutput.OriginatingServer)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.MailboxDatabaseCopy']/NumberofDatabaseCopies$", $discoveryoutput.NumberofDatabaseCopies)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/RpcClientAccessServer$", $discoveryoutput.RpcClientAccessServer)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/Recovery$", $discoveryoutput.Recovery)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.MailboxDatabaseCopy']/ReplicationType$", $discoveryoutput.ReplicationType)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.MailboxDatabaseCopy']/ReplicationTypeHashCode$", $discoveryoutput.ReplicationTypeHashCode)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.MailboxDatabaseCopy']/MasterServerOrAvailabilityGroup$", $discoveryoutput.MasterServerOrAvailabilityGroup)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.MailboxDatabaseCopy']/MasterType$", $discoveryoutput.MasterType)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.MailboxDatabaseCopy']/MasterTypeHashCode$", $discoveryoutput.MasterTypeHashCode)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/LogFolderPath$", $discoveryoutput.LogFolderPath)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/LogFolderPathDriveName$", $discoveryoutput.LogFolderPathDriveName)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/LogFolderPathDriveFreeSpace$", $discoveryoutput.LogFolderPathDriveFreeSpace)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/WhenCreated$", $discoveryoutput.WhenCreated)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/WhenChanged$", $discoveryoutput.WhenChanged)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/CircularLoggingEnabled$", $discoveryoutput.CircularLoggingEnabled)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/BackgroundDatabaseMaintenance$", $discoveryoutput.BackgroundDatabaseMaintenance)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.MailboxDatabaseCopy']/DatabaseCopies$", $discoveryoutput.DatabaseCopies)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.MailboxDatabaseCopy']/Servers$", $discoveryoutput.Servers)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.MailboxDatabaseCopy']/ActivationPreference$", $discoveryoutput.ActivationPreference)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/SnapshotLastFullBackup$", $discoveryoutput.SnapshotLastFullBackup)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/SnapshotLastIncrementalBackup$", $discoveryoutput.SnapshotLastIncrementalBackup)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/SnapshotLastDifferentialBackup$", $discoveryoutput.SnapshotLastDifferentialBackup)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/SnapshotLastCopyBackup$", $discoveryoutput.SnapshotLastCopyBackup)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/LastFullBackup$", $discoveryoutput.LastFullBackup)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/LastIncrementalBackup$", $discoveryoutput.LastIncrementalBackup)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/LastDifferentialBackup$", $discoveryoutput.LastDifferentialBackup)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/LastCopyBackup$", $discoveryoutput.LastCopyBackup)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/MountAtStartup$", $discoveryoutput.MountAtStartup)

$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/DistinguishedName$", $discoveryoutput.DistinguishedName)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.MailboxDatabaseCopy']/ReplayLagTimes$", $discoveryoutput.ReplayLagTimes)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.MailboxDatabaseCopy']/Truncationlagtimes$", $discoveryoutput.Truncationlagtimes)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/RetainDeletedItemsUntilBackup$", $discoveryoutput.RetainDeletedItemsUntilBackup)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/IsMailboxDatabase$", $discoveryoutput.IsMailboxDatabase)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/IsPublicFolderDatabase$", $discoveryoutput.IsPublicFolderDatabase)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/PublicFolderDatabase$", $discoveryoutput.PublicFolderDatabase)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/ProhibitSendReceiveQuota$", $discoveryoutput.ProhibitSendReceiveQuota)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/ProhibitSendQuota$", $discoveryoutput.ProhibitSendQuota)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/IndexEnabled$", $discoveryoutput.IndexEnabled)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/MailboxRetention$", $discoveryoutput.MailboxRetention)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/MailboxRetentionTotalSeconds$", $discoveryoutput.MailboxRetentionTotalSeconds)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/DeletedItemRetention$", $discoveryoutput.DeletedItemRetention)
$instance.AddProperty("$MPElement[Name='MKSE2K10Lib!Microsoft.KnowledgeServices.Exchange.2010.DatabaseInstance']/DeletedItemRetentionTotalSeconds$", $discoveryoutput.DeletedItemRetentionTotalSeconds)

$discoverydata.AddInstance($instance)

}

$discoverydata

</Script></ScriptBody>
<SnapIns>
<SnapIn>Microsoft.Exchange.Management.PowerShell.E2010</SnapIn>
</SnapIns>
<Parameters>
<Parameter>
<Name>SourceId</Name>
<Value>$MPElement$</Value>
</Parameter>
<Parameter>
<Name>ManagedEntityId</Name>
<Value>$Target/Id$</Value>
</Parameter>
<Parameter>
<Name>KeyPropertyPrincipalName</Name>
<Value>$Target/Host/Host/Host/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Value>
</Parameter>
<Parameter>
<Name>ServerName</Name>
<Value>$Target/Host/Host/Host/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetbiosComputerName$</Value>
</Parameter>
</Parameters>
<TimeoutSeconds>300</TimeoutSeconds>
<StrictErrorHandling>false</StrictErrorHandling>
</DataSource>
</Discovery>