CraigMan
asked on
Powershell - Sort results alphabetically
I'm new to powershell, and am looking for a way to modify a line of script so the output will be in alphabetical order. Currently, the output appears as a column of users in no order. I would prefer to see the ouput arranged alphabetically. Here is the script code in question.
Get-User -DomainController $SrcDC.SelectedItem -Credential $Remote |
Where-Object {$_.RecipientType -match "UserMailbox"}|
ForEach-Object {$SrcMx.Items.Add($_.Name) }
Get-User -DomainController $SrcDC.SelectedItem -Credential $Remote |
Where-Object {$_.RecipientType -match "UserMailbox"}|
ForEach-Object {$SrcMx.Items.Add($_.Name)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
nice restructuring
ASKER
Perfect solution!
Thanks Gus. I didn't need to do anything. Just cut and pasted to replace my code.
Thanks again
Thanks Gus. I didn't need to do anything. Just cut and pasted to replace my code.
Thanks again
http://technet.microsoft.com/en-us/library/ee176968.aspx