ConvertFrom-String then Join Properties ?

Hi everyone!

I’m working on a PowerShell script that uses Windows Form elements to display the owners of an Exchange distribution group. In the course of parsing the data, I’ve managed to convert the string but I’ve not been able to join the properties so that when displayed in a datagridview, the properties aren’t separated.

Here’s what I’m doing with the script so far:

$dgManagers = Get-DistributionGroup -Identity <groupname> | Select -expand ManagedBy $dgManagersList = New-Object System.Collections.ArrayList foreach ($dgManager in $dgManagers) { $manager = (Get-Mailbox $dgManager).name $dgManagersList.Add($manager) } $dgManagersListConverted = $dgManagersList | ConvertFrom-String -PropertyNames DisplayName 

The resulting data has 4 properties for each person and it looks simliar to this:

Displayname P2 P3 P4
Lastname, Firstname Middleinitial Suffix

I would love to take those 4 properties and combine them into one property but not a string so each person listed reads like this:

Displayname
Lastname, Firstname Middleinitial Suffix

What do you folks think?

submitted by /u/fargleblargen
[link] [comments]

Leave a Reply