locked
How do I set a variable to the value contained in an ADGroup attribute? RRS feed

  • Question

  • Good evening. I'm trying to store the expected count of users in a group against the actual count. The plan is to use "extensionAttribute1" to store how many users should be in the group. I then want to query the count of members to compare and see if one is higher than the other (used to track owned licenses). I'm having no problem counting the group members, but I can't seem to set a variable to the attribute's value. Feel like this should be really easy. What am I doing wrong? My goal is to set $ExpectedMemberCount to the value stored in the attribute.

    $ExpectedMemberCount = Get-ADGroup -Identity "DoNotDelete-ProductALicensedUsers" -Properties extensionAttribute1
    $ExpectedMemberCount

    Thanks in advance!

    Friday, January 25, 2019 11:48 PM

All replies