Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.FileServerDiscovery.DS (DataSourceModuleType)

Element properties:

TypeDataSourceModuleType
IsolationAny
AccessibilityInternal
RunAsDefault
OutputTypeSystem.Discovery.Data

Member Modules:

ID Module Type TypeId RunAs 
Scheduler DataSource System.Discovery.Scheduler Default
DiscoveryProbe ProbeAction Microsoft.Windows.PowerShellDiscoveryProbe Default

Overrideable Parameters:

IDParameterTypeSelector
IntervalSecondsint$Config/IntervalSeconds$
TimeoutSecondsint$Config/TimeoutSeconds$

Source Code:

<DataSourceModuleType ID="Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.FileServerDiscovery.DS" Accessibility="Internal">
<Configuration>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="IntervalSeconds" type="xsd:int"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="TimeoutSeconds" type="xsd:int"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ComputerName" type="xsd:string"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="IntervalSeconds" ParameterType="int" Selector="$Config/IntervalSeconds$"/>
<OverrideableParameter ID="TimeoutSeconds" ParameterType="int" Selector="$Config/TimeoutSeconds$"/>
</OverrideableParameters>
<ModuleImplementation>
<Composite>
<MemberModules>
<DataSource ID="Scheduler" TypeID="System!System.Discovery.Scheduler">
<Scheduler>
<SimpleReccuringSchedule>
<Interval Unit="Seconds">$Config/IntervalSeconds$</Interval>
</SimpleReccuringSchedule>
<ExcludeDates/>
</Scheduler>
</DataSource>
<ProbeAction ID="DiscoveryProbe" TypeID="Windows!Microsoft.Windows.PowerShellDiscoveryProbe">
<ScriptName>FileServerDiscovery.DS.ps1</ScriptName>
<ScriptBody><Script># Creates discovery data with Storage Objects
# else returns empty discovery data


# Targets Microsoft.SystemCenter.VirtualMachineManager.Storage.FileServer

Param( [String] $ElementID,
[String] $TargetID,
[String] $ComputerName,

[String] $StorageProviderClassID,
[String] $StorageProviderIDPropertyID,
[String] $StorageProviderTypePropertyID,
[String] $StorageProviderDescriptionPropertyID,

[String] $StorageArrayClassID,
[String] $StorageArrayIDPropertyID,
[String] $StorageArrayDescriptionPropertyID,
[String] $StorageArrayFirmwareVersionPropertyID,
[String] $StorageArrayManufacturePropertyID,
[String] $StorageArrayModelPropertyID,
[String] $StorageArraySerialNumberPropertyID,

[String] $StoragePoolClassID,
[String] $StoragePoolIDPropertyID,
[String] $StoragePoolDescriptionPropertyID,
[String] $StoragePoolPrimordialPropertyID,
[String] $StoragePoolTotalManagedSpacePropertyID,
[String] $StoragePoolProvisioningTypeDefaultPropertyID,
[String] $StoragePoolSupportedProvisioningTypesPropertyID,
[String] $StoragePoolStorageClassificationPropertyID,
[String] $StoragePoolStorageOverProvisionPercentID,

[String] $StorageLogicalUnitClassID,
[String] $StorageLogicalUnitIDPropertyID,
[String] $StorageLogicalUnitDescriptionPropertyID,
[String] $StorageLogicalUnitBlockSizePropertyID,
[String] $StorageLogicalUnitNumberOfBlocksPropertyID,
[String] $StorageLogicalUnitThinlyProvisionedPropertyID,
[String] $StorageLogicalUnitPrimordialPropertyID,
[String] $StorageLogicalUnitTotalCapacityPropertyID,
[String] $StorageLogicalUnitRemainingCapacityPropertyID,
[String] $StorageLogicalUnitStorageClassificationPropertyID,

[String] $VMHostDiskClassID,
[String] $VMHostDiskIDPropertyID,
[String] $VMHostDiskCapacityPropertyID,
[String] $VMHostDiskIsClusteredPropertyID,
[String] $VMHostDiskIsSanAttachedPropertyID,
[String] $VMHostDiskIsPassThroughCapablePropertyID,
[String] $VMHostDiskLocationPropertyID,
[String] $VMHostDiskDiskIDPropertyID,
[String] $VMHostDiskSMLunIDPropertyID,
[String] $VMHostDiskAvailableCapacityPropertyID,


[String] $HostVolumeClassID,
[String] $HostVolumeIDPropertyID,
[String] $HostVolumeMountPointsPropertyID,
[String] $HostVolumeCapacityPropertyID,
[String] $HostVolumeVolumeLabelPropertyID,
[String] $HostVolumeIsClusteredPropertyID,
[String] $HostVolumeIsClusterSharedVolumePropertyID,
[String] $HostVolumeFreeSpacePropertyID,
[String] $HostVolumeIsAvailableForPlacementPropertyID,
[String] $HostVolumeClassificationPropertyID,

[String] $VHDClassID,
[String] $VHDIDPropertyID,
[String] $VHDDescriptionPropertyID,
[String] $VHDVHDTypePropertyID,
[String] $VHDVHDFormatTypePropertyID,
[String] $VHDVirtualizationPlatformPropertyID,
[String] $VHDMaximumSizePropertyID,
[String] $VHDLocationPropertyID,
[String] $VHDCurrentSizePropertyID,

[String] $FileShareClassID,
[String] $FileShareIDPropertyID,
[String] $FileShareDescriptionPropertyID,
[String] $FileShareIsAvailableForPlacementPropertyID,
[String] $FileShareIsManagedPropertyID,
[String] $HostAssociationsPropertyID,
[String] $ClusterAssociationsPropertyID,
[String] $FileShareStorageClassificationPropertyID,
[String] $FileShareSharePathPropertyID,
[String] $FileShareStorageVolumeIDPropertyID,
[String] $FileShareFreeSpacePropertyID,
[String] $FileShareCapacityPropertyID,
[String] $FileShareMSContainsVirtualMachineRelationID,

[String] $VirtualMachineClassID,
[String] $VirtualMachineIDPropertyID,
[String] $StoragePoolGroupClassID,
[String] $StoragePoolGroupContainsStoragePoolMSClassID,
[String] $VMMServerPropertyID,
[String] $VMHostIDPropertyID,
[String] $StorageLogicalUnitContainsVMHostDiskClassID,
[String] $VMHostDiskContainsHostVolumeClassID,
[String] $VDDClassID,
[String] $VDDIDPropertyID,
[String] $ComputerPrincipalNameKey,
[String] $EntityDisplayNameKey,
[String] $VirtualDiskDriveReferencesVHDClassID,
[String] $VHDReferencesHostVolumeClassID,
[String] $VirtualDiskDriveReferencesVMHostDiskClassID,

[String] $FileServerClassID,
[String] $FileServerIDPropertyID,
[String] $FileServerVMMServerPropertyID,
[String] $FileServerClusterNamePropertyID,
[String] $FileServerDescriptionPropertyID,
[String] $FileServerTypePropertyID,
[String] $FileServerStorageNodesPropertyID,
[String] $FileServerFreeSpacePropertyID,
[String] $FileServerCapacityPropertyID,
[String] $FileServerModelPropertyID,
[String] $FileServerManufacturerPropertyID,
[String] $FileServerSerialNumberPropertyID,
[String] $ArrayReferencesFileServerClassID,

[String] $EnclosureClassID,
[String] $EnclosureDeviceIDPropertyID,
[String] $EnclosureUniqueIDPropertyID,
[String] $EnclosureVMMServerPropertyID,
[String] $EnclosureModelPropertyID,
[String] $EnclosureManufacturerPropertyID,
[String] $EnclosureSerialNumberPropertyID,
[String] $EnclosureFirmwareVersionPropertyID,
[String] $EnclosureNumberOfSlotsPropertyID,
[String] $StoragePoolMSContainsEnclosureRelationID,
[String] $ArrayReferencesEnclosureID,

[String] $StoragePoolMSClassID,
[String] $StoragePoolMSIDPropertyID,
[String] $StoragePoolMSDescriptionPropertyID,
[String] $StoragePoolMSPrimordialPropertyID,
[String] $StoragePoolMSTotalManagedSpacePropertyID,
[String] $StoragePoolMSProvisioningTypeDefaultPropertyID,
[String] $StoragePoolMSSupportedProvisioningTypesPropertyID,
[String] $StoragePoolMSStorageClassificationPropertyID,
[String] $StoragePoolMSStorageOverProvisionPercentID,
[String] $StoragePoolMSContainsStoragePoolRelationID,
[String] $StoragePoolMSContainsStoragePoolSpacesRelationID,

[String] $StoragePoolSpacesClassID,
[String] $StoragePoolSpacesUniqueIDPropertyID,
[String] $StoragePoolSpacesVMMServerPropertyID,
[String] $StoragePoolSpacesProvisioningTypeDefaultPropertyID,
[String] $StoragePoolSpacesResiliencySettingNameDefaultPropertyID,
[String] $StoragePoolSpacesSupportsDeduplicationPropertyID,
[String] $StoragePoolSpacesIsClusteredPropertyID,
[String] $StoragePoolSpacesIsReadOnlyPropertyID,
[String] $StoragePoolSpacesDescriptionPropertyID,

[String] $FileShareMSClassID,
[String] $FileShareMSIDPropertyID,
[String] $FileShareMSDescriptionPropertyID,
[String] $FileShareMSSharePathPropertyID,
[String] $FileShareMSStorageVolumeIDPropertyID,
[String] $FileShareMSStorageClassificationPropertyID,
[String] $FileShareMSIsManagedPropertyID,
[String] $FileShareMSContainsFileShareVMMRelationID,
[String] $FileShareMSContainsFileShareBaseRelationID,

[String] $FileShareSMBClassID,
[String] $FileShareSMBIDPropertyID,
[String] $FileShareSMBDescriptionPropertyID,
[String] $FileShareSMBVMMServerPropertyID,
[String] $FileShareSMBShareNamePropertyID,
[String] $FileShareSMBSharePathPropertyID,
[String] $FileShareSMBStorageVolumeIDPropertyID,
[String] $FileShareSMBStorageFileServerPropertyID,
[String] $FileShareSMBFreeSpacePropertyID,
[String] $FileShareSMBCapacityPropertyID,

[String] $principalName,
[String] $uniqueId,
[String] $vmmServer,
[String] $domain,
[String] $username,
[String] $password
)

Function AddTraceMessage
{
param($msg)
$timeStamp = (get-date -format "HH:mm:ss:fff");

$message = ("`n[" + $timeStamp + "]" + $msg)
$momAPI.LogScriptEvent("FileServerDiscovery.DS.ps1", 108, 0, $message);
}

Function CreateStoragePoolSpaceInstances
{
param($storagePools, $principalName, $uniqueId)

# StoragePoolSMBObject uses properties from MSFT_StoragePool while StoragePoolMSObject's key property is ID i.e. from VMM's Storage Pool object
# Since VMM storage pool and MSFT_StoragePool doesn't have similar properties
# need to get MSFT_StoragePool objects foreach storage pool in $storagePools and then fetch additional MSFT_StoragePool properties
$relatedPools = Get-StoragePool | ? {$_.IsPrimordial -eq $false} | Sort-Object UniqueId -Unique

$msg = " Storage Discovery: Creating StoragePoolSpaces ";
foreach ($poolSmb in $storagePools)
{
$msft_storagePool = $null
# get MSFT_StoragePool object for $poolSmb
foreach ($relatedPool in $relatedPools)
{
if($poolSmb.PoolId -eq $relatedPool.UniqueId.ToString())
{
$msft_storagePool = $relatedPool
break
}
}

if( ($msft_storagePool -ne $null) -and ($poolSmb -ne $null) )
{
$StoragePoolSMBObject = $discoveryData.CreateClassInstance($StoragePoolSpacesClassID);
$StoragePoolSMBObject.AddProperty($StoragePoolSpacesUniqueIDPropertyID, $msft_storagePool.UniqueId); #key/unique property
$StoragePoolSMBObject.AddProperty($ComputerPrincipalNameKey, $principalName); # $node.Name); #host key property1
$StoragePoolSMBObject.AddProperty($FileServerIDPropertyID, $uniqueId); # $node.UniqueId); #host key property2
$StoragePoolSMBObject.AddProperty($EntityDisplayNameKey, $msft_storagePool.FriendlyName); #display name
$StoragePoolSMBObject.AddProperty($StoragePoolSpacesVMMServerPropertyID, $ComputerName);

$StoragePoolSMBObject.AddProperty($StoragePoolSpacesProvisioningTypeDefaultPropertyID, $msft_storagePool.ProvisioningTypeDefault);
$StoragePoolSMBObject.AddProperty($StoragePoolSpacesResiliencySettingNameDefaultPropertyID, $msft_storagePool.ResiliencySettingNameDefault);
$StoragePoolSMBObject.AddProperty($StoragePoolSpacesSupportsDeduplicationPropertyID, $msft_storagePool.SupportsDeduplication);
$StoragePoolSMBObject.AddProperty($StoragePoolSpacesIsClusteredPropertyID, $msft_storagePool.IsClustered);
$StoragePoolSMBObject.AddProperty($StoragePoolSpacesIsReadOnlyPropertyID, $msft_storagePool.IsReadOnly);
$StoragePoolSMBObject.AddProperty($StoragePoolSpacesDescriptionPropertyID, $msft_storagePool.OtherUsageDescription);
$discoveryData.AddInstance($StoragePoolSMBObject);
$msg = $msg + "`n PoolName = " + $msft_storagePool.FriendlyName ;
# Create a storage pool object
$storagePoolMSObject = $discoveryData.CreateClassInstance($StoragePoolMSClassID)
if($storagePoolMSObject -ne $null)
{
$storagePoolMSObject.AddProperty($StoragePoolMSIDPropertyID, $poolSmb.ID.ToString())
#$discoveryData.AddInstance($storagePoolMSObject);

# Add the relationship
$relationship = $discoveryData.CreateRelationshipInstance($StoragePoolMSContainsStoragePoolSpacesRelationID)
$relationship.Source = $storagePoolMSObject
$relationship.Target = $StoragePoolSMBObject
$discoveryData.AddInstance($relationship);
$msg = $msg + "`n Parent StoragePool Contains " + $poolSmb.Name ;
}
}
}
AddTraceMessage -msg $msg
}

Function CreateStorageEnclosureInstances
{
param($storageEnclosures, $storagePools, $principalName, $uniqueId, $storageArrayProviderID, $storageArrayID, $remoteSession)

$msg = "File Server Discovery: Creating Enclosures";

foreach ($enclosure in $storageEnclosures)
{
$EnclosureObject = $discoveryData.CreateClassInstance($EnclosureClassID);
$EnclosureObject.AddProperty($EnclosureDeviceIDPropertyID, $enclosure.DeviceId); #key/unique property
$EnclosureObject.AddProperty($EnclosureUniqueIDPropertyID, $enclosure.UniqueId); #key/unique property
$EnclosureObject.AddProperty($ComputerPrincipalNameKey, $principalName); #host key property1
$EnclosureObject.AddProperty($FileServerIDPropertyID, $uniqueId); #host key property2
$EnclosureObject.AddProperty($EnclosureVMMServerPropertyID, $vmmServer);
$EnclosureObject.AddProperty($EntityDisplayNameKey, $enclosure.FriendlyName); #display name
$EnclosureObject.AddProperty($EnclosureModelPropertyID, $enclosure.Model);
$EnclosureObject.AddProperty($EnclosureManufacturerPropertyID, $enclosure.Manufacturer);
$EnclosureObject.AddProperty($EnclosureSerialNumberPropertyID, $enclosure.SerialNumber);
$EnclosureObject.AddProperty($EnclosureFirmwareVersionPropertyID, $enclosure.FirmwareVersion);
$EnclosureObject.AddProperty($EnclosureNumberOfSlotsPropertyID, [int]$enclosure.NumberOfSlots);
$discoveryData.AddInstance($EnclosureObject);
$msg = $msg + "`n Name = " + $enclosure.FriendlyName ;

if ($storageArrayProviderID -ne $null)
{
# Re-create storage array object and add the relationship
$storageArrayObject = $discoveryData.CreateClassInstance($StorageArrayClassID)
if($storageArrayObject -ne $null)
{
$storageArrayObject.AddProperty($StorageProviderIDPropertyID, $storageArrayProviderID)
$storageArrayObject.AddProperty($ComputerPrincipalNameKey, $vmmServer)
$storageArrayObject.AddProperty($StorageArrayIDPropertyID, $storageArrayID)
#$discoveryData.AddInstance($storageArrayObject);

# Add relationship
$relationship = $discoveryData.CreateRelationshipInstance($ArrayReferencesEnclosureID)
$relationship.Source = $storageArrayObject
$relationship.Target = $EnclosureObject
$discoveryData.AddInstance($relationship);
$msg = $msg + " `n Array References Enclosure " + $enclosure.FriendlyName;
}
}

#StoragePoolMSContainsEnclosureRelationID Relation: Get Unique StoragePool related to enclosure through physical disks
$relatedPools = $enclosure | Get-PhysicalDisk | Get-StoragePool | ? {$_.IsPrimordial -eq $false} | Sort-Object UniqueId -Unique
#$relatedPools | fl *
foreach ($relatedPool in $relatedPools)
{
foreach($storagePool in $storagePools)
{
if($storagePool.PoolId -eq $relatedPool.UniqueId.ToString())
{
# Re-add storage pool object
$storagePoolMSObject = $discoveryData.CreateClassInstance($StoragePoolMSClassID)
if($storagePoolMSObject -ne $null)
{
$storagePoolMSObject.AddProperty($StoragePoolMSIDPropertyID, $storagePool.ID.ToString())
#$discoveryData.AddInstance($storagePoolMSObject)

# Add relationship
$relationship = $discoveryData.CreateRelationshipInstance($StoragePoolMSContainsEnclosureRelationID)
$relationship.Source = $storagePoolMSObject
$relationship.Target = $EnclosureObject
$discoveryData.AddInstance($relationship);
$msg = $msg + "`n StoragePool (" + $relatedPool.FriendlyName + ") contains " + $enclosure.FriendlyName;
break
}
}
}
}
}
AddTraceMessage -msg $msg
}

Function CreateFileShareSMBInstances
{
param($smbFileShares, $principalName, $uniqueId)

$msg = "File Server Discovery: Creating SMB FileShares";
foreach ($share in $smbFileShares)
{
$FileShareSmbObject = $discoveryData.CreateClassInstance($FileShareSMBClassID);
$FileShareSmbObject.AddProperty($FileShareSMBIDPropertyID, $share.ID.ToString()); #key/unique property
$FileShareSmbObject.AddProperty($ComputerPrincipalNameKey, $principalName); #host key property1
$FileShareSmbObject.AddProperty($FileServerIDPropertyID, $uniqueId); #host key property2
$FileShareSmbObject.AddProperty($EntityDisplayNameKey, $share.ShareName); #display name
$FileShareSmbObject.AddProperty($FileShareSMBDescriptionPropertyID, $share.Description);
$FileShareSmbObject.AddProperty($FileShareSMBVMMServerPropertyID, $ComputerName);
$FileShareSmbObject.AddProperty($FileShareSMBShareNamePropertyID, $share.ShareName);
$FileShareSmbObject.AddProperty($FileShareSMBSharePathPropertyID, $share.SharePath);
$FileShareSmbObject.AddProperty($FileShareSMBStorageVolumeIDPropertyID, $share.StorageVolumeID.ToString());
$FileShareSmbObject.AddProperty($FileShareSMBStorageFileServerPropertyID, $share.StorageFileServer.Name);
$FileShareSmbObject.AddProperty($FileShareSMBFreeSpacePropertyID, $share.FreeSpace);
$FileShareSmbObject.AddProperty($FileShareSMBCapacityPropertyID, $share.Capacity);
$discoveryData.AddInstance($FileShareSmbObject);
$msg = $msg + "`n ShareName = " + $share.ShareName ;

# Re-Add FileShare object
$FileShareMSObject = $discoveryData.CreateClassInstance($FileShareMSClassID)
if($FileShareMSObject -ne $null)
{
$FileShareMSObject.AddProperty($FileShareMSIDPropertyID, $share.ID.ToString())
#$discoveryData.AddInstance($FileShareMSObject);

# Add relationship
$relationship = $discoveryData.CreateRelationshipInstance($FileShareMSContainsFileShareBaseRelationID);
$relationship.Source = $FileShareMSObject
$relationship.Target = $FileShareSmbObject
$discoveryData.AddInstance($relationship);
$msg = $msg + "`n FileShare Contains " + $share.ShareName ;
}
}
AddTraceMessage -msg $msg
}

$vmm = $null;
$script:traceMsg = "";
Try
{
$errorActionPreference = 'Continue'

# Create MOM API object
$momAPI = new-object -comObject MOM.ScriptAPI
$error.Clear();
# Create Discovery Data
$discoveryData = $momAPI.CreateDiscoveryData(0, $ElementID, $TargetID)
AddTraceMessage -msg "File Server Discovery: started."

# Credential to use for remote connection
$cred = $null;
if($domain -AND $username -AND $password)
{
#Append domain to get domain\username
$domainUser = $domain + "\" + $username;

#Create Cred object
$securePass = ConvertTo-SecureString -AsPlainText $password -force
$cred = New-Object System.Management.Automation.PSCredential $domainUser, $securePass;
}
$error.Clear();

$session = New-PSSession -ComputerName $vmmServer -Authentication Default -Credential $cred;
if ( ($error -ne $null) -and ($error.Count -ne 0) )
{
if ($session -ne $null)
{
Remove-PSSession $session;
}
return;
}
$error.Clear();

$scVMMServer = Invoke-Command -Session $session -ArgumentList $vmmServer -ScriptBlock {$module = get-module -name "virtualmachinemanager"; if ($module -eq $null) {Import-Module "virtualmachinemanager"; } $server = Get-SCVMMServer -ComputerName $args[0]; $server};
if ($scVMMServer -eq $null)
{
Remove-PSSession $session;
return;
}
else
{
AddTraceMessage -msg "File Server Discovery: Connected to VMM server."
}

$fs = $null
# Retrieve all storage file servers from VMM
# Find the file server for this Node.
$fs = $null
$storageArrayProviderID = $null
$storageArrayID = $null

$storageEnclosures = Get-StorageEnclosure

$sb = {
$fsUniqueId = $args[0]
$storagePoolsMap = @{}

$StorageFileServers = Get-SCStorageFileServer -VMMServer $server -All

foreach($StorageFileServer in $StorageFileServers)
{
if ($null -ne $StorageFileServer.StorageNodes -and $StorageFileServer.StorageNodes.Length -gt 0)
{
foreach ($node in $StorageFileServer.StorageNodes)
{
if($node.UniqueId -eq $fsUniqueId)
{
$fs = $StorageFileServer
break
}
}
}
}

if($fs.StorageArray -ne $null)
{
$storageArray = Get-SCStorageArray -VMMServer $server -ID $fs.StorageArray.ID
$storageArrayProviderID = $storageArray.StorageProvider.ID.ToString()
$storageArrayID = $storageArray.ID.ToString()
$storagePools = Get-SCStoragePool -VMMServer $server -All
$storagePoolsMap.Add("storagePools", $storagePools)
}

$fsMap = @{}
$fsMap.Add("StorageFileShares", $fs.StorageFileShares)

$storageArrayProviderID
$storageArrayID
$fsMap

$storagePoolsMap
};

$argumentsToSB=@($uniqueId)

$result = Invoke-Command -Session $session -ScriptBlock $sb -ArgumentList $argumentsToSB
if($result -ne $null)
{
$storageArrayProviderID = $result[0]

$storageArrayID = $result[1]

$fsMap = $result[2]
$fsStorageFileShares = $fsMap["StorageFileShares"]

$spMap = $result[3]
$storagePools = $spMap["storagePools"]

CreateStoragePoolSpaceInstances -storagePools $storagePools -principalName $principalName -uniqueId $uniqueId

CreateStorageEnclosureInstances -storageEnclosures $storageEnclosures -storagePools $storagePools -principalName $principalName -uniqueId $uniqueId -storageArrayProviderID $storageArrayProviderID -storageArrayID $storageArrayID -remoteSession $session

if($fsStorageFileShares -ne $null)
{
CreateFileShareSMBInstances -smbFileShares $fsStorageFileShares -principalName $principalName -uniqueId $uniqueId
}

AddTraceMessage -msg "Discovery: done!"
}
else
{
$momAPI.LogScriptEvent("FileServerdiscovery.DS.ps1", 108, 1, "Discovery failed: script failed while retrieving file server and storage array from VMM.");
}

# Return discovery data. If there is no data, return empty data (i.e. delete object and reference)
$discoveryData
AddTraceMessage -msg "File Server Discovery: completed."
}
Finally
{
if($session -ne $null)
{
Remove-PSSession $session;
}

if ($error -ne $null -and $error.Count -gt 0)
{
$momAPI.LogScriptEvent("FileServerDiscovery.DS.ps1", 108, 1, $error);
}

if ($server -ne $null)
{
$server.Disconnect();
}
}
</Script></ScriptBody>
<Parameters>
<!-- Discovery data arguments -->
<Parameter>
<Name>ElementID</Name>
<Value>$MPElement$</Value>
</Parameter>
<Parameter>
<Name>TargetID</Name>
<Value>$Target/Id$</Value>
</Parameter>
<Parameter>
<Name>ComputerName</Name>
<Value>$Target/Property[Type='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileServer']/VMMServer$</Value>
</Parameter>
<!-- Storage Provider -->
<Parameter>
<Name>StorageProviderClassID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.StorageProvider']$</Value>
</Parameter>
<Parameter>
<Name>StorageProviderIDPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.StorageProvider']/ID$</Value>
</Parameter>
<Parameter>
<Name>StorageProviderTypePropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.StorageProvider']/Type$</Value>
</Parameter>
<Parameter>
<Name>StorageProviderDescriptionPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.StorageProvider']/Description$</Value>
</Parameter>
<!-- Storage Array -->
<Parameter>
<Name>StorageArrayClassID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.StorageArray']$</Value>
</Parameter>
<Parameter>
<Name>StorageArrayDescriptionPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.StorageArray']/Description$</Value>
</Parameter>
<Parameter>
<Name>StorageArrayFirmwareVersionPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.StorageArray']/FirmwareVersion$</Value>
</Parameter>
<Parameter>
<Name>StorageArrayManufacturePropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.StorageArray']/Manufacture$</Value>
</Parameter>
<Parameter>
<Name>StorageArrayIDPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.StorageArray']/ID$</Value>
</Parameter>
<Parameter>
<Name>StorageArrayModelPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.StorageArray']/Model$</Value>
</Parameter>
<Parameter>
<Name>StorageArraySerialNumberPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.StorageArray']/SerialNumber$</Value>
</Parameter>
<!-- Storage Pool-->
<Parameter>
<Name>StoragePoolClassID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.StoragePool']$</Value>
</Parameter>
<Parameter>
<Name>StoragePoolIDPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.StoragePool']/ID$</Value>
</Parameter>
<Parameter>
<Name>StoragePoolDescriptionPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.StoragePool']/Description$</Value>
</Parameter>
<Parameter>
<Name>StoragePoolPrimordialPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.StoragePool']/Primordial$</Value>
</Parameter>
<Parameter>
<Name>StoragePoolTotalManagedSpacePropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.StoragePool']/TotalManagedSpace$</Value>
</Parameter>
<Parameter>
<Name>StoragePoolProvisioningTypeDefaultPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.StoragePool']/ProvisioningTypeDefault$</Value>
</Parameter>
<Parameter>
<Name>StoragePoolSupportedProvisioningTypesPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.StoragePool']/SupportedProvisioningTypes$</Value>
</Parameter>
<Parameter>
<Name>StoragePoolStorageClassificationPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.StoragePool']/StorageClassification$</Value>
</Parameter>
<Parameter>
<Name>StoragePoolStorageOverProvisionPercentID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.StoragePool']/OverProvisionPercent$</Value>
</Parameter>
<!-- Storage Volume-->
<Parameter>
<Name>StorageLogicalUnitClassID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.StorageLogicalUnit']$</Value>
</Parameter>
<Parameter>
<Name>StorageLogicalUnitIDPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.StorageLogicalUnit']/ID$</Value>
</Parameter>
<Parameter>
<Name>StorageLogicalUnitDescriptionPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.StorageLogicalUnit']/Description$</Value>
</Parameter>
<Parameter>
<Name>StorageLogicalUnitBlockSizePropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.StorageLogicalUnit']/BlockSize$</Value>
</Parameter>
<Parameter>
<Name>StorageLogicalUnitNumberOfBlocksPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.StorageLogicalUnit']/NumberOfBlocks$</Value>
</Parameter>
<Parameter>
<Name>StorageLogicalUnitThinlyProvisionedPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.StorageLogicalUnit']/ThinlyProvisioned$</Value>
</Parameter>
<Parameter>
<Name>StorageLogicalUnitPrimordialPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.StorageLogicalUnit']/Primordial$</Value>
</Parameter>
<Parameter>
<Name>StorageLogicalUnitTotalCapacityPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.StorageLogicalUnit']/TotalCapacity$</Value>
</Parameter>
<Parameter>
<Name>StorageLogicalUnitRemainingCapacityPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.StorageLogicalUnit']/RemainingCapacity$</Value>
</Parameter>
<Parameter>
<Name>StorageLogicalUnitStorageClassificationPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.StorageLogicalUnit']/StorageClassification$</Value>
</Parameter>
<!-- VM Host Disk-->
<Parameter>
<Name>VMHostDiskClassID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.VMHostDisk']$</Value>
</Parameter>
<Parameter>
<Name>VMHostDiskIDPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.VMHostDisk']/ID$</Value>
</Parameter>
<Parameter>
<Name>VMHostDiskCapacityPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.VMHostDisk']/Capacity$</Value>
</Parameter>
<Parameter>
<Name>VMHostDiskIsClusteredPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.VMHostDisk']/IsClustered$</Value>
</Parameter>
<Parameter>
<Name>VMHostDiskIsSanAttachedPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.VMHostDisk']/IsSanAttached$</Value>
</Parameter>
<Parameter>
<Name>VMHostDiskIsPassThroughCapablePropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.VMHostDisk']/IsPassThroughCapable$</Value>
</Parameter>
<Parameter>
<Name>VMHostDiskDiskIDPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.VMHostDisk']/DiskID$</Value>
</Parameter>
<Parameter>
<Name>VMHostDiskLocationPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.VMHostDisk']/Location$</Value>
</Parameter>
<Parameter>
<Name>VMHostDiskSMLunIDPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.VMHostDisk']/SMLunID$</Value>
</Parameter>
<Parameter>
<Name>VMHostDiskAvailableCapacityPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.VMHostDisk']/AvailableCapacity$</Value>
</Parameter>
<!-- Host volume-->
<Parameter>
<Name>HostVolumeClassID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.HostVolume']$</Value>
</Parameter>
<Parameter>
<Name>HostVolumeIDPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.HostVolume']/ID$</Value>
</Parameter>
<Parameter>
<Name>HostVolumeMountPointsPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.HostVolume']/MountPoints$</Value>
</Parameter>
<Parameter>
<Name>HostVolumeCapacityPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.HostVolume']/Capacity$</Value>
</Parameter>
<Parameter>
<Name>HostVolumeVolumeLabelPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.HostVolume']/VolumeLabel$</Value>
</Parameter>
<Parameter>
<Name>HostVolumeIsClusteredPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.HostVolume']/IsClustered$</Value>
</Parameter>
<Parameter>
<Name>HostVolumeIsClusterSharedVolumePropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.HostVolume']/IsClusterSharedVolume$</Value>
</Parameter>
<Parameter>
<Name>HostVolumeFreeSpacePropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.HostVolume']/FreeSpace$</Value>
</Parameter>
<Parameter>
<Name>HostVolumeIsAvailableForPlacementPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.HostVolume']/IsAvailableForPlacement$</Value>
</Parameter>
<Parameter>
<Name>HostVolumeClassificationPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.HostVolume']/Classification$</Value>
</Parameter>
<!-- VHD class-->
<Parameter>
<Name>VHDClassID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.VHD']$</Value>
</Parameter>
<Parameter>
<Name>VHDIDPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.VHD']/ID$</Value>
</Parameter>
<Parameter>
<Name>VHDDescriptionPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.VHD']/Description$</Value>
</Parameter>
<Parameter>
<Name>VHDVHDTypePropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.VHD']/VHDType$</Value>
</Parameter>
<Parameter>
<Name>VHDVHDFormatTypePropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.VHD']/VHDFormatType$</Value>
</Parameter>
<Parameter>
<Name>VHDVirtualizationPlatformPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.VHD']/VirtualizationPlatform$</Value>
</Parameter>
<Parameter>
<Name>VHDMaximumSizePropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.VHD']/MaximumSize$</Value>
</Parameter>
<Parameter>
<Name>VHDLocationPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.VHD']/Location$</Value>
</Parameter>
<Parameter>
<Name>VHDCurrentSizePropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.VHD']/CurrentSize$</Value>
</Parameter>
<!-- File Share-->
<Parameter>
<Name>FileShareClassID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.FileShare']$</Value>
</Parameter>
<Parameter>
<Name>FileShareIDPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileShare']/ID$</Value>
</Parameter>
<Parameter>
<Name>FileShareDescriptionPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileShare']/Description$</Value>
</Parameter>
<Parameter>
<Name>FileShareIsAvailableForPlacementPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileShare']/IsAvailableForPlacement$</Value>
</Parameter>
<Parameter>
<Name>FileShareIsManagedPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileShare']/IsManaged$</Value>
</Parameter>
<Parameter>
<Name>HostAssociationsPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileShare']/HostAssociations$</Value>
</Parameter>
<Parameter>
<Name>ClusterAssociationsPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileShare']/ClusterAssociations$</Value>
</Parameter>
<Parameter>
<Name>FileShareStorageClassificationPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileShare']/StorageClassification$</Value>
</Parameter>
<Parameter>
<Name>FileShareSharePathPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileShare']/SharePath$</Value>
</Parameter>
<Parameter>
<Name>FileShareStorageVolumeIDPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileShare']/StorageVolumeID$</Value>
</Parameter>
<Parameter>
<Name>FileShareFreeSpacePropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileShare']/FreeSpace$</Value>
</Parameter>
<Parameter>
<Name>FileShareCapacityPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileShare']/Capacity$</Value>
</Parameter>
<Parameter>
<Name>FileShareMSContainsVirtualMachineRelationID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.FileShareMSContainsVirtualMachine']$</Value>
</Parameter>
<!-- Relationships classes and referenced ckases and properties IDs-->
<Parameter>
<Name>VirtualMachineClassID</Name>
<Value>$MPElement[Name='VMM2016Discovery!Microsoft.SystemCenter.VirtualMachineManager.2016.VirtualMachine']$</Value>
</Parameter>
<Parameter>
<Name>VirtualMachineIDPropertyID</Name>
<Value>$MPElement[Name='VMMLibrary!Microsoft.SystemCenter.VirtualMachineManager.VirtualMachine']/VMMId$</Value>
</Parameter>
<Parameter>
<Name>StoragePoolGroupClassID</Name>
<Value>$MPElement[Name='VMM2016Discovery!Microsoft.SystemCenter.VirtualMachineManager.2016.StoragePoolGroup']$</Value>
</Parameter>
<Parameter>
<Name>StoragePoolGroupContainsStoragePoolMSClassID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.StoragePoolGroupContainsStoragePoolMS']$</Value>
</Parameter>
<Parameter>
<Name>VMMServerPropertyID</Name>
<Value>$MPElement[Name='VMM2016Discovery!Microsoft.SystemCenter.VirtualMachineManager.2016.StoragePoolGroup']/VMMServer$</Value>
</Parameter>
<Parameter>
<Name>StorageLogicalUnitContainsVMHostDiskClassID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.StorageLogicalUnitContainsVMHostDisk']$</Value>
</Parameter>
<Parameter>
<Name>VMHostDiskContainsHostVolumeClassID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.VMHostDiskContainsHostVolume']$</Value>
</Parameter>
<Parameter>
<Name>VMHostIDPropertyID</Name>
<Value>$MPElement[Name='VMMLibrary!Microsoft.SystemCenter.VirtualMachineManager.VMHost']/VMMId$</Value>
</Parameter>
<Parameter>
<Name>VDDClassID</Name>
<Value>$MPElement[Name='VMM2016Discovery!Microsoft.SystemCenter.VirtualMachineManager.2016.VirtualDiskDrive']$</Value>
</Parameter>
<Parameter>
<Name>VDDIDPropertyID</Name>
<Value>$MPElement[Name='VMMLibrary!Microsoft.SystemCenter.VirtualMachineManager.VirtualDiskDrive']/VMMId$</Value>
</Parameter>
<Parameter>
<Name>VirtualDiskDriveReferencesVHDClassID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.VirtualDiskDriveReferencesVHD']$</Value>
</Parameter>
<Parameter>
<Name>VHDReferencesHostVolumeClassID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.VHDReferencesHostVolume']$</Value>
</Parameter>
<Parameter>
<Name>VirtualDiskDriveReferencesVMHostDiskClassID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.VirtualDiskDriveReferencesVMHostDisk']$</Value>
</Parameter>
<Parameter>
<Name>ComputerPrincipalNameKey</Name>
<Value>$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$</Value>
</Parameter>
<Parameter>
<Name>EntityDisplayNameKey</Name>
<Value>$MPElement[Name="System!System.Entity"]/DisplayName$</Value>
</Parameter>
<!---File Server properties-->
<Parameter>
<Name>FileServerClassID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.FileServer.Windows']$</Value>
</Parameter>
<Parameter>
<Name>FileServerIDPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileServer']/ID$</Value>
</Parameter>
<Parameter>
<Name>FileServerClusterNamePropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileServer']/ClusterName$</Value>
</Parameter>
<Parameter>
<Name>FileServerVMMServerPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileServer']/VMMServer$</Value>
</Parameter>
<Parameter>
<Name>FileServerDescriptionPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileServer']/Description$</Value>
</Parameter>
<Parameter>
<Name>FileServerTypePropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileServer']/FileServerType$</Value>
</Parameter>
<Parameter>
<Name>FileServerStorageNodesPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileServer']/StorageNodes$</Value>
</Parameter>
<Parameter>
<Name>FileServerFreeSpacePropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileServer']/FreeSpace$</Value>
</Parameter>
<Parameter>
<Name>FileServerCapacityPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileServer']/Capacity$</Value>
</Parameter>
<Parameter>
<Name>FileServerModelPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileServer']/Model$</Value>
</Parameter>
<Parameter>
<Name>FileServerManufacturerPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileServer']/Manufacturer$</Value>
</Parameter>
<Parameter>
<Name>FileServerSerialNumberPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileServer']/SerialNumber$</Value>
</Parameter>
<Parameter>
<Name>ArrayReferencesFileServerClassID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.ArrayReferencesFileServer']$</Value>
</Parameter>
<!---Enclosure properties-->
<Parameter>
<Name>EnclosureClassID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.Enclosure']$</Value>
</Parameter>
<Parameter>
<Name>EnclosureDeviceIDPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.Enclosure']/DeviceID$</Value>
</Parameter>
<Parameter>
<Name>EnclosureUniqueIDPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.Enclosure']/UniqueID$</Value>
</Parameter>
<Parameter>
<Name>EnclosureVMMServerPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.Enclosure']/VMMServer$</Value>
</Parameter>
<Parameter>
<Name>EnclosureModelPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.Enclosure']/Model$</Value>
</Parameter>
<Parameter>
<Name>EnclosureManufacturerPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.Enclosure']/Manufacturer$</Value>
</Parameter>
<Parameter>
<Name>EnclosureSerialNumberPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.Enclosure']/SerialNumber$</Value>
</Parameter>
<Parameter>
<Name>EnclosureFirmwareVersionPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.Enclosure']/FirmwareVersion$</Value>
</Parameter>
<Parameter>
<Name>EnclosureNumberOfSlotsPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.Enclosure']/NumberOfSlots$</Value>
</Parameter>
<Parameter>
<Name>StoragePoolMSContainsEnclosureRelationID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.StoragePoolMSContainsEnclosure']$</Value>
</Parameter>
<Parameter>
<Name>ArrayReferencesEnclosureID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.ArrayReferencesEnclosure']$</Value>
</Parameter>
<!---Storage Pool MS properties-->
<Parameter>
<Name>StoragePoolMSClassID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.StoragePool.MS']$</Value>
</Parameter>
<Parameter>
<Name>StoragePoolMSIDPropertyID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.StoragePool.MS']/ID$</Value>
</Parameter>
<Parameter>
<Name>StoragePoolMSDescriptionPropertyID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.StoragePool.MS']/Description$</Value>
</Parameter>
<Parameter>
<Name>StoragePoolMSPrimordialPropertyID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.StoragePool.MS']/Primordial$</Value>
</Parameter>
<Parameter>
<Name>StoragePoolMSTotalManagedSpacePropertyID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.StoragePool.MS']/TotalManagedSpace$</Value>
</Parameter>
<Parameter>
<Name>StoragePoolMSProvisioningTypeDefaultPropertyID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.StoragePool.MS']/ProvisioningTypeDefault$</Value>
</Parameter>
<Parameter>
<Name>StoragePoolMSSupportedProvisioningTypesPropertyID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.StoragePool.MS']/SupportedProvisioningTypes$</Value>
</Parameter>
<Parameter>
<Name>StoragePoolMSStorageClassificationPropertyID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.StoragePool.MS']/StorageClassification$</Value>
</Parameter>
<Parameter>
<Name>StoragePoolMSStorageOverProvisionPercentID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.StoragePool.MS']/OverProvisionPercent$</Value>
</Parameter>
<Parameter>
<Name>StoragePoolMSContainsStoragePoolRelationID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.StoragePoolMSContainsStoragePool']$</Value>
</Parameter>
<Parameter>
<Name>StoragePoolMSContainsStoragePoolSpacesRelationID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.StoragePoolMSContainsStoragePoolSpaces']$</Value>
</Parameter>
<!---Storage Pool Spaces properties-->
<Parameter>
<Name>StoragePoolSpacesClassID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.StoragePool.StorageSpaces']$</Value>
</Parameter>
<Parameter>
<Name>StoragePoolSpacesUniqueIDPropertyID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.StoragePool.StorageSpaces']/UniqueID$</Value>
</Parameter>
<Parameter>
<Name>StoragePoolSpacesVMMServerPropertyID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.StoragePool.StorageSpaces']/VMMServer$</Value>
</Parameter>
<Parameter>
<Name>StoragePoolSpacesProvisioningTypeDefaultPropertyID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.StoragePool.StorageSpaces']/ProvisioningTypeDefault$</Value>
</Parameter>
<Parameter>
<Name>StoragePoolSpacesResiliencySettingNameDefaultPropertyID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.StoragePool.StorageSpaces']/ResiliencySettingNameDefault$</Value>
</Parameter>
<Parameter>
<Name>StoragePoolSpacesSupportsDeduplicationPropertyID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.StoragePool.StorageSpaces']/SupportsDeduplication$</Value>
</Parameter>
<Parameter>
<Name>StoragePoolSpacesIsClusteredPropertyID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.StoragePool.StorageSpaces']/IsClustered$</Value>
</Parameter>
<Parameter>
<Name>StoragePoolSpacesIsReadOnlyPropertyID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.StoragePool.StorageSpaces']/IsReadOnly$</Value>
</Parameter>
<Parameter>
<Name>StoragePoolSpacesDescriptionPropertyID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.StoragePool.StorageSpaces']/Description$</Value>
</Parameter>
<!-- File Share MS properties -->
<Parameter>
<Name>FileShareMSClassID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.FileShare.MS']$</Value>
</Parameter>
<Parameter>
<Name>FileShareMSIDPropertyID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.FileShare.MS']/ID$</Value>
</Parameter>
<Parameter>
<Name>FileShareMSDescriptionPropertyID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.FileShare.MS']/Description$</Value>
</Parameter>
<Parameter>
<Name>FileShareMSSharePathPropertyID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.FileShare.MS']/SharePath$</Value>
</Parameter>
<Parameter>
<Name>FileShareMSStorageVolumeIDPropertyID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.FileShare.MS']/StorageVolumeID$</Value>
</Parameter>
<Parameter>
<Name>FileShareMSStorageClassificationPropertyID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.FileShare.MS']/StorageClassification$</Value>
</Parameter>
<Parameter>
<Name>FileShareMSIsManagedPropertyID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.FileShare.MS']/IsManaged$</Value>
</Parameter>
<Parameter>
<Name>FileShareMSContainsFileShareVMMRelationID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.FileShareMSContainsFileShareVMM']$</Value>
</Parameter>
<Parameter>
<Name>FileShareMSContainsFileShareBaseRelationID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.FileShareMSContainsFileShareBase']$</Value>
</Parameter>
<!-- File Share SMB properties -->
<Parameter>
<Name>FileShareSMBClassID</Name>
<Value>$MPElement[Name='Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.FileShare.SMB']$</Value>
</Parameter>
<Parameter>
<Name>FileShareSMBIDPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileShare.Base']/ID$</Value>
</Parameter>
<Parameter>
<Name>FileShareSMBDescriptionPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileShare.Base']/Description$</Value>
</Parameter>
<Parameter>
<Name>FileShareSMBVMMServerPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileShare.Base']/VMMServer$</Value>
</Parameter>
<Parameter>
<Name>FileShareSMBShareNamePropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileShare.Base']/ShareName$</Value>
</Parameter>
<Parameter>
<Name>FileShareSMBSharePathPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileShare.Base']/SharePath$</Value>
</Parameter>
<Parameter>
<Name>FileShareSMBStorageVolumeIDPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileShare.Base']/StorageVolumeID$</Value>
</Parameter>
<Parameter>
<Name>FileShareSMBStorageFileServerPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileShare.Base']/StorageFileServer$</Value>
</Parameter>
<Parameter>
<Name>FileShareSMBFreeSpacePropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileShare.Base']/FreeSpace$</Value>
</Parameter>
<Parameter>
<Name>FileShareSMBCapacityPropertyID</Name>
<Value>$MPElement[Name='SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileShare.Base']/Capacity$</Value>
</Parameter>
<!-- BUGFIX -->
<Parameter>
<Name>principalName</Name>
<Value>$Target/Host/Property[Type='Windows!Microsoft.Windows.Computer']/PrincipalName$</Value>
</Parameter>
<Parameter>
<Name>uniqueId</Name>
<Value>$Target/Property[Type="SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileServer"]/ID$</Value>
</Parameter>
<Parameter>
<Name>vmmServer</Name>
<Value>$Target/Property[Type="SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileServer"]/VMMServer$</Value>
</Parameter>
<Parameter>
<Name>domain</Name>
<Value>$RunAs[Name="PROV2Library!Microsoft.SystemCenter.VirtualMachineManager.2012.VMMServerConnectionRunAsProfile"]/Domain$</Value>
</Parameter>
<Parameter>
<Name>username</Name>
<Value>$RunAs[Name="PROV2Library!Microsoft.SystemCenter.VirtualMachineManager.2012.VMMServerConnectionRunAsProfile"]/UserName$</Value>
</Parameter>
<Parameter>
<Name>password</Name>
<Value>$RunAs[Name="PROV2Library!Microsoft.SystemCenter.VirtualMachineManager.2012.VMMServerConnectionRunAsProfile"]/Password$</Value>
</Parameter>
</Parameters>
<TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds>
<StrictErrorHandling>false</StrictErrorHandling>
</ProbeAction>
</MemberModules>
<Composition>
<Node ID="DiscoveryProbe">
<Node ID="Scheduler"/>
</Node>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.Discovery.Data</OutputType>
</DataSourceModuleType>