0

Here is my script that works great:

Select-object -Property name,@{Name="bofaamlmember";Expression={$_.bofaamlmember -join ";"}},@{Name="canonicalName";Expression={$_.canonicalName -join ";"}} | Sort-object bofaamlmember | Export-Csv "C:\Users\nbkn4wz\documents\Scripts\bofaamlmemberExt.csv"

The script returns the values that I requested:

         **Name**               **Bofaamlmember**
RG-AdministratorsMembers    CN=CSW_IIS_Support_SvcAcct_BUSP_AP,OU=Common,etc....

The issue I am having is within the bofaamlmember attribute there are members of that attribute:

Example: Attribute Editor

I want to be able to export just the members.

I don't want to use the CN, its too much info. I want just the value(s) that are listed in that box.

uSlackr
  • 6,412
  • 21
  • 37

1 Answers1

0

This snippet should be close, but I cannot test. It splits the bofaamlmember on commas and selects the first element (0) then splits on = and takes the second (1)

;Expression={(($_.bofaamlmember).split(",")[0]).split("=")[1] -join ";"}

(May need one more set of (...) at the beginning and before join)

uSlackr
  • 6,412
  • 21
  • 37
  • This worked pretty good, but we have accounts like: Type S\M346. The output of this script gives me the Type S\ but nothing after it. – ChadKFranks Jul 21 '22 at 22:24