I have a script that works, and creates a list of all the groups in my domain and spills them out on screen.
I would like to enhance it so that it changes the distiguished name format to just the CN name of the members.
I would also like to get it to spill the items into a csv file.
I'm not a scripter, i have pieced together scripts in the past and im able to follow powershell enought to eventually get what I want. But a little help anyone.
Heres the script.
$Groups = Get-ADGroup -Properties * -Filter * -SearchBase "OU=Some OU,OU=Locations,DC=Some Companty,DC=net"
Foreach($G In $Groups)
{
Write-Host $G.Name
Write-Host "-------------"
$G.Members
Write-Host " "
}
Returns
Group Name
------------------
CN=User1,OU=Users,OU=Locations,DC=Some Companty,DC=net
CN=User2,OU=Users,OU=Locations,DC=Some Companty,DC=net
CN=User3 ,OU=Users,OU=Locations,DC=Some Companty,DC=net
What I want is below spilled into a csv file.
Group Name
----------------
User1
User2
User3