none
MMSWebService SearchMV Method RRS feed

  • Question

  • I'm running FIM 2010 (non R2) and am have been leveraging the MMSWebService API in PowerShell. I've been trying to figure out the syntax for the filter argument of the SearchMV method and keep getting "<error>Value does not fall within the expected range.</error>"

     $fimUiUtils = [Reflection.Assembly]::LoadFrom("$fimDir\UiShell\UiUtils.dll")
     $fimProperties = [Reflection.Assembly]::LoadFrom("$fimDir\UIShell\PropertySheetBase.dll")
     $fimWS = new-object Microsoft.DirectoryServices.MetadirectoryServices.UI.WebServices.MMSWebService

    I've tried using XML from exporting the metaverse search from the Synchronization Service app as well as XPath filters (like "/Person[(Contains(proxyaddresses, 'smtp:user@domain.com'))]") with no results. Can anyone give me an example that works?

    Friday, March 1, 2013 5:29 AM

Answers

  • Using this API is not supported, and is not the way to search for data when using XPath.

    Data in the metaverse is stored in a sql table called mms_metaverse, if you specifically need information from there i suggest doing a sql search (beware that you don't lock the database), running a query directly is also not the supported way.

    If you need to run xpath I suggest looking into the scriptbox topic, here you have plenty examples that can help you developing your script that searches for the correct persons.

    a short snippet will probably look like (not tested if the xpath is correct):

    set-variable -name URI -value "http://localhost:5725/resourcemanagementservice" -option constant
    
    If(@(get-pssnapin | where-object {$_.Name -eq "FIMAutomation"} ).count -eq 0) {add-pssnapin FIMAutomation}
    
    $CurObject = export-fimconfig -uri $URI 
                                   –onlyBaseResources 
                                   -customconfig ("/Person[(Contains(proxyaddresses,; smtp:user@domain.com'))]")`
                                   -ErrorVariable Err 
                                   -ErrorAction SilentlyContinue 


    Need realtime FIM synchronization and advanced reporting? check out the new http://www.imsequencer.com that supports FIM 2010, Omada Identity Manager, SQL, File, AD or Powershell real time synchronization!

    Friday, March 1, 2013 5:52 AM