Maximize your protection, eliminate business risks.
Optimize and modernize with cloud transformation.
Empower your people to work securely from anywhere.
Let us handle IT so you can focus on growing your business.
Get multichannel 24/7/365 expert end-user support.
Protect, detect, and respond—Dataprise keeps your business secure.
Maximize uptime with with industry-leading DRaaS.
Swiftly mitigate cyber threats and restore security.
Improve efficiency, productivity and outcomes with cloud.
Ensure all mobile devices, everywhere, are secure.
Gain a competitive edge with strategic IT solutions.
This battle-tested checklist enables your team to swiftly initiate a ransomware response.
IT for businesses of all sizes, in any industry.
Empower institution growth with custom IT solutions.
Ensure your firm is always in compliance.
Improve patient care and staff morale.
Deal with pressing legal matters, not IT.
Keep up with the evolving digital landscape.
Focus on your mission by outsourcing IT.
Accelerate PE client deals and secure data.
Empower Your Municipality with Secure, Reliable IT Services
Execute initiatives and develop IT strategies.
Get the latest industry insights and trends.
Join us at events in person and online.
Hear from clients and learn more about strategic IT.
See how Dataprise can make IT your greatest asset.
Get informative technical resources from IT experts.
Stay on stop of emerging cybersecurity threats.
Discover the key areas of DR your organization needs to address to ensure downtime is minimized.
Gain a strategic asset by bringing harmony to IT.
Ensure 24/7 support and security with dedicated teams.
Drive business forward by partnering with Dataprise.
Meet our one-of-a-kind leadership team.
Discover the recognition Dataprise has earned.
Help us help businesses with strategic IT.
Grow through acquisition and partnership with Dataprise.
Embracing different perspectives and backgrounds.
Find a Dataprise location near you.
Dataprise is committed to empowering more women to consider a career in technology.
Explore our trusted partnerships with leading tech innovators.
Posts
By: Dataprise
Table of content
In recently working on an email migration for a customer, I was tasked with documenting the group membership of multiple distribution groups so that they could be created in the new target AD environment.
The quickest way to do this is to export all your groups to a file, then use that file to parse the group members and output that information to a final csv.
So, your first step is to export your groups to a file. Open powershell as an administrator:
Import-Module ActiveDirectory
Get-ADGroup –Filter ‘GroupCategory –eq “Distribution”’ | sort name | select name | export-csv c:tempGroups.csv -NoTypeInformation
This will give you a listing of all of your distribution groups. From here I had trouble using the csv as an input source, so I just removed all the quotation marks and commas and renamed it to groups.csv
Next I tried a canned power shell from the internet to export the information:
$groups = Get-Content c:tempgroups.txt
foreach($Group in $Groups) {
Get-ADGroupMember -Id $Group | select @{Expression={$Group};Label=”Group Name”},SamAccountName | Export-CSV -append c:tempGroupInfo.CSV -NoTypeInformation
}
However what I found was that it was not appending the information to the csv file – I was only getting information from the last group in the txt file. So I decided to create an array to hold all the information, then output it to file:
$groups = Get-Content c:tempdlgroups1.txt
$results = @()
$file = “c:tempgroupmem.csv”
$results +=Get-ADGroupMember -Id $Group | select @{Expression={$Group};Label=”Group Name”},SamAccountName
$results | export-csv -notypeinformation -path $file
This was the information I was looking for. From here I was able to give this to the client to use in creating the new AD Groups.
Josef Hanning, PEI
INSIGHTS
Subscribe to our blog to learn about the latest IT trends and technology best practices.