Hi everyone
Im trying to make a script where i can list all computers with a name like 'ATANS*" and their group membership.
Im pretty newbie at scripting so i guess my code is not the best. But it does the job, all i want is to get the result to a csv file
Hope someone can be of assistance
Get-ADcomputer -Filter "Name -like 'ATANS*'" | ForEach {
Write-Host "$_ is a member of the following groups:"
Get-ADComputer $_ -Properties memberOf | Select -ExpandProperty memberOf
Write-Host
}
I have tried but all the csv files is empty?