Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Remove table headers from array

$
0
0

Hi folks. I am pulling the sip proxy address from about a hundred AD users along with their samaccountname from a text file full of AD users listed one line at a time.

I know how to remove header information with "get-aduser $user -properties * | format-table samaccountname -HideTableHeaders | out-file c:\userID.txt" but in this case below i'm using Select-Object and an array.

When output to a text file the table header is repeating again and again. Can anyone please show me how to get rid of it? Thanks much

$path = c:\Exchange\ActiveDirectory\userlist.txt

foreach ($user in $path) {Get-ADUser -Identity $user -Properties * | Select-Object  samaccountname,@{Name='SIP';E={$_.Proxyaddresses|Select-string -Pattern "sip:"}}}


Viewing all articles
Browse latest Browse all 6937

Trending Articles