How would i to get the AD security group name and the computer name for each on my spreadsheet.
Right now I am only getting the group. Need the Computer Name.
$Get2008s = "TEXTFILEPATHHERE"
Get-Content $Get2008s | ForEach-Object {
Get-ADPrincipalGroupMembership (Get-ADComputer $_) | select name | Where-Object {$_.name -like '*SCCM*' } | Sort Name
} |
Export-Csv "FILEPATHHERE" -NoTypeInformation -UseCulture