Try this instead:
Get-ADGroupMember -Identity "group name" -recursive |
Where {$_.ObjectClass -eq 'computer'} |
Get-ADComputer -Properties Name, Description |
sort name |
Format-Table -AutoSize -Property name,description

Put you where before your sort; will speed things up and reduce memory 
consumption. :)
And you can use format-table to filter the properties and save a step.

DAMIEN SOLODOW
Senior Systems Engineer
317.447.6033 (office)
317.447.6014 (fax)
HARRISON COLLEGE
________________________________
From: [email protected] [[email protected]] on behalf 
of BURKEY Evan [[email protected]]
Sent: Thursday, March 24, 2016 7:12 PM
To: [email protected]
Subject: [mssms] RE: OT - PowerShell help?

Try adding Format-Table –autosize like so:

Get-ADGroupMember -Identity "Group Name" -recursive | sort name |
Where {$_.ObjectClass -eq 'computer'} |
Get-ADComputer -Properties Name, Description |
Select Name, Description |
Format-Table -AutoSize


From: [email protected] [mailto:[email protected]] On 
Behalf Of Murray, Mike
Sent: Thursday, March 24, 2016 4:00 PM
To: [email protected]
Subject: [mssms] OT - PowerShell help?

Hola,

I’m running the script below to list computers within an AD security group (the 
group in question has members of multiple other security groups). It works, but 
it cuts off the name if it’s more than 6 characters in length. Annoying! Any 
idea why?

Get-ADGroupMember -Identity "Group Name" -recursive | sort name |
Where {$_.ObjectClass -eq 'computer'} |
Get-ADComputer -Properties Name, Description |
Select Name, Description

Example:
[cid:[email protected]]


Best Regards,

Mike Murray
Desktop Management Coordinator - IT Support Services
California State University, Chico
530.898.4357
[email protected]<mailto:[email protected]>






Reply via email to