ListBox DisplayMember

Welcome Forums General PowerShell Q&A ListBox DisplayMember

This topic contains 1 reply, has 2 voices, and was last updated by

3 years, 3 months ago.

  • Author
  • #32091

    Points: 0
    Rank: Member

    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

    Points: 1
    Rank: Member

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

The topic ‘ListBox DisplayMember’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort