cragos1984 Posted November 18, 2016 Posted November 18, 2016 Hi I am basically looking to clear all our distribution groups and re populate them with different students. Assuming the best way to do this would be with a CSV and Powershell script but my Powershell isn't massively great. Anyone able to point me in the right direction? it would be much appreciated. I already have a script and CSV to re populate but removing the old users is proving a challenge Thanks Craig
cragos1984 Posted November 18, 2016 Author Posted November 18, 2016 Got this sorted now thanks people, If anyone needs similar here is the script I have used Import-Module Activedirectory$ErrorActionPreference = "SilentlyContinue"Import-Csv c:\remove\groups.csv | ForEach { $groupMembers = Get-ADGroupMember $_.Group #$groupMembers Remove-ADGroupMember $_.Group -Members $groupMembers -Confirm:$false}$ErrorActionPreference = "Continue"
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now