Powershell script that list all members employeeID RRS feed

  • Question

  • Hi guys,

    I have a issue I am unable to resolve. I would like to create a list of employeeID's of users that are manually-managed members in a security group.

    if(@(get-pssnapin | where-object {$_.Name -eq “FIMAutomation”} ).count -eq 0) {add-pssnapin FIMAutomation} $exportData = Export-FIMConfig -CustomConfig "/Group[Type='Security' and DisplayName='My Security Group']/ExplicitMember" foreach($member in $exportData){ $displayName = $member.ResourceManagementObject.ResourceManagementAttributes | Where-Object {$_.AttributeName -eq "DisplayName"} Write-Host $displayName.Value


    The strange thing is that I get the domain, members and owner when I run this XPath query. Do you guys have any pointers? I am really stuck!


    Wednesday, November 14, 2012 1:35 PM


All replies

  • Note that when I run:

    $exportData = Export-FIMConfig -CustomConfig "/Group[Type='Security' and DisplayName='My security group']"

    it returns the resource itself that I'm looking for, and all other resources that have relation to 'My Security Group'

    Wednesday, November 14, 2012 1:38 PM
  • Does this help?


    Markus Vilcinskas, Knowledge Engineer, Microsoft Corporation

    Wednesday, November 14, 2012 1:57 PM
  • Yes, thank you, adding -OnlyBaseResources solved my problem.

    Although it seems strange to me that it's not covered here.
    Hopefully this will help somebody else.

    Thanks again!

    Wednesday, November 14, 2012 2:05 PM