Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Formatting Powershell Output

$
0
0

Hello Everyone,

When i use Get-ADPrincipalGroupMembership $username | select name in my powershell code I Get all the groups that the user belongs to, but now when i assign the same as below it doesn't output the results and just goes blank.

I would like it give the results and if possible i would like it do only show distribution groups only.

$DisplayGroups = Get-ADPrincipalGroupMembership $username | select name

write-host -foregroundcolor Yellow "$DisplayGroups"

shows blank

Am running it on Server 2008 R2 - powershell 2

Kindly assist in formating to get the desired output.


Meshack


Viewing all articles
Browse latest Browse all 21975

Trending Articles