ListBox DisplayMember

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of Curtis Smith Curtis Smith 11 months, 1 week ago.

  • Author
  • #32091
    Profile photo of Joseph Monarch
    Joseph Monarch

    I currently have a script that works correctly. However, the way it loads is a little hard to read. I am loading AD Groups into a listbox. Currently it shows the FQDN. I need it to show a shortname so that it is easier to read.

    $maduname = $mfuser.Text
    $mfusergroups = Get-ADUser -Identity $maduname -Properties *
    $mfadrname = $mfusergroups.CN
    $mfusergroups = $mfusergroups.MemberOf | Sort
    foreach ($group in $mfusergroups) {
    $groupstart = $group.IndexOf("=") + 1
    $groupend = $group.IndexOf(",") - 3

    This is only the small section that needs to be changed.

  • #32107
    Profile photo of Curtis Smith
    Curtis Smith

    For terminology's sale, it is showing DistinguishedName, not FQDN; however, check out this post on the same topic.

You must be logged in to reply to this topic.