QueryResource
Applies To: Forefront Identity Manager 2010
This is an example of a Windows PowerShell function that queries the Forefront Identity Manager (FIM) Service database and returns references to all resources that matched the query. For more information, see FIM Windows PowerShell Cmdlet Examples.
QueryResource Function
This function takes an XML filter as a parameter and passes that filter to the Export-FIMConfig cmdlet.
function QueryResource
{
PARAM($Filter, $Uri = $DefaultUri)
END
{
$resources = Export-FIMConfig -CustomConfig $Filter -Uri $Uri
$resources
}
}
The previous code assumes that the following variable is included in the script that contains the QueryResource function:
$DefaultUri = "https://localhost:5725"
Remarks
This function is an example of how you can use the Import-FIMConfig cmdlet to query the FIM Service database for any information, not just configuration information as described in the Configuration Migration Deployment Guide. For example XPath filters, see XPath Filter Dialect Examples.
The AllRequestsToElevatedSecurityGroup and EnableAllMPRs examples use this function as a helper function.
See Also
Reference
Import-FIMConfig
Concepts
FIM Windows PowerShell Cmdlet Examples