I’m working on an offboarding for my company and for the most part it’s all going pretty well. I have all the AD actions down well enough and even the majority of my Exchange tasks work as expected. But I cannot for the life of me figure out how to remove an individual user from all security and distribution lists.
I know where to start I believe, by calling a variable like:
$groups = Get-Distributiongroup -Resultsize Unlimited
Then passing that variable into a foreach loop to get the user and Remove-DistributionGroupMember. But it seems no matter what format I try, it fails. Some help would be much appreciated.
submitted by /u/brian1183
[link] [comments]
The post Office 365/Exchange – Remove user from all groups appeared first on How to Code .NET.