Solved

Need to remove multiple DL's and security groups

Posted on 2016-11-10
2
51 Views
Last Modified: 2016-11-11
I need to bulk remove many security groups and DL's. Security groups and DL's are located in different OU's.

Can someone help me with a script?.

Thanks in advance!!
0
Comment
Question by:A D
2 Comments
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 41882077
If you are asking to delete groups from AD then use Remove-ADgroup
Example.. If you have a list of groups to remove in a text file, use following code to remove them from AD..
GC C:\temp\groups.txt | %{Remove-ADgroup $_}

Open in new window

0
 

Author Closing Comment

by:A D
ID: 41883632
Thanks Subsun. Worked perfectly!!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Powershell Script Error Handling 7 34
Adups vulnerability 5 66
AD reporting and update tool 9 50
regex expression 9 23
This article will help you understand what HashTables are and how to use them in PowerShell.
A procedure for exporting installed hotfix details of remote computers using powershell
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now