I've been trying to export a list of members from AD groups which match a certain condition EG. *ABC* in the AD group name and I've been struggling to find the correct sequence of piped commands to accomplish this.
I've ended up trying to use the Quest addons, but am still having no luck with the format.
I require the data to be in CSV format similar to;
Groupname,Groupnamedescription,logonname,...
This outputs the detail I need but not in the correct format. Substituting out-file with Export-CSV merely exports a group list and throws out a few errors when the script runs.
Any help/pointers, much appreciated.
Cheers, Paul.
I've ended up trying to use the Quest addons, but am still having no luck with the format.
I require the data to be in CSV format similar to;
Groupname,Groupnamedescription,logonname,...
Code:
Add-PSSnapin Quest.ActiveRoles.ADManagement
$Groups = Get-QADGroup *ABC*
foreach ($Group in $Groups) {
$Group | out-file .\Groups.txt -Append
Get-QADGroupMember $Group | out-file .\Groups.txt -Append
}
This outputs the detail I need but not in the correct format. Substituting out-file with Export-CSV merely exports a group list and throws out a few errors when the script runs.
Any help/pointers, much appreciated.
Cheers, Paul.