<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>Comments on: Exchange 2010 remove disabled users from distribution group</title>
	<atom:link href="http://exchangeblog.pl/en/2013/02/exchange-2010-remove-disabled-users-from-distribution-group/feed/" rel="self" type="application/rss+xml" />
	<link>http://exchangeblog.pl/en/2013/02/exchange-2010-remove-disabled-users-from-distribution-group/</link>
	<description>Blog technologii MS Exchange Server</description>
	<lastBuildDate>Thu, 20 Aug 2015 06:37:04 +0000</lastBuildDate>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.0.38</generator>
	<item>
		<title>By: Remigiusz Szatkowski</title>
		<link>http://exchangeblog.pl/en/2013/02/exchange-2010-remove-disabled-users-from-distribution-group/#comment-105403</link>
		<dc:creator><![CDATA[Remigiusz Szatkowski]]></dc:creator>
		<pubDate>Mon, 11 Nov 2013 17:56:50 +0000</pubDate>
		<guid isPermaLink="false">http://exchangeblog.pl/?p=2976#comment-105403</guid>
		<description><![CDATA[This script will remove users disabled in Exchange. You can use below 
[array]$mem = Get-DistributionGroupMember -id $_ -ResultSize Unlimited &#124; where-object {$_.RecipientTypeDetails -eq &quot;Disableduser&quot;}
to find all uses not from specified OU. 
or if you just want to find all Distribution Groups and remove all users whos Active Directory accounts are disabled then you can use this:
$groups = Get-DistributionGroup -ResultSize Unlimited
foreach($group in $groups){
 Get-DistributionGroupMember $group &#124;
  ?{$_.RecipientType -like &#039;*User*&#039; -and $_.ResourceType -eq $null} &#124; Get-User &#124; ?{$_.UserAccountControl -match &#039;AccountDisabled&#039;} &#124;  Remove-DistributionGroupMember $group -Confirm:$false
} 
  
you need to run this command in Exchange Management Shell.]]></description>
		<content:encoded><![CDATA[<p>This script will remove users disabled in Exchange. You can use below<br />
[array]$mem = Get-DistributionGroupMember -id $_ -ResultSize Unlimited | where-object {$_.RecipientTypeDetails -eq &#8220;Disableduser&#8221;}<br />
to find all uses not from specified OU.<br />
or if you just want to find all Distribution Groups and remove all users whos Active Directory accounts are disabled then you can use this:<br />
$groups = Get-DistributionGroup -ResultSize Unlimited<br />
foreach($group in $groups){<br />
 Get-DistributionGroupMember $group |<br />
  ?{$_.RecipientType -like &#8216;*User*&#8217; -and $_.ResourceType -eq $null} | Get-User | ?{$_.UserAccountControl -match &#8216;AccountDisabled&#8217;} |  Remove-DistributionGroupMember $group -Confirm:$false<br />
} </p>
<p>you need to run this command in Exchange Management Shell.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: New to PS</title>
		<link>http://exchangeblog.pl/en/2013/02/exchange-2010-remove-disabled-users-from-distribution-group/#comment-104775</link>
		<dc:creator><![CDATA[New to PS]]></dc:creator>
		<pubDate>Fri, 08 Nov 2013 15:54:44 +0000</pubDate>
		<guid isPermaLink="false">http://exchangeblog.pl/?p=2976#comment-104775</guid>
		<description><![CDATA[Hi, 

Thanks for the reply.  So would I replace Get-DistributionGroupMember -id $_ -ResultSize Unlimited &#124; where-object {($_.identity -like &quot;domain/company/Corporate1/Users/*&quot; -or $_.identity -like &quot;domain/company/Corporate2/Users*&quot;) -and $_.RecipientTypeDetails -eq &quot;Disableduser&quot;} with Search-ADAccount -AccountDisabled -UsersOnly?]]></description>
		<content:encoded><![CDATA[<p>Hi, </p>
<p>Thanks for the reply.  So would I replace Get-DistributionGroupMember -id $_ -ResultSize Unlimited | where-object {($_.identity -like &#8220;domain/company/Corporate1/Users/*&#8221; -or $_.identity -like &#8220;domain/company/Corporate2/Users*&#8221;) -and $_.RecipientTypeDetails -eq &#8220;Disableduser&#8221;} with Search-ADAccount -AccountDisabled -UsersOnly?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Remigiusz Szatkowski</title>
		<link>http://exchangeblog.pl/en/2013/02/exchange-2010-remove-disabled-users-from-distribution-group/#comment-104687</link>
		<dc:creator><![CDATA[Remigiusz Szatkowski]]></dc:creator>
		<pubDate>Fri, 08 Nov 2013 08:17:03 +0000</pubDate>
		<guid isPermaLink="false">http://exchangeblog.pl/?p=2976#comment-104687</guid>
		<description><![CDATA[Hi
If you use this script you don&#039;t have to modify it. It will find disabled users in specified group and remove them. But if you want to find all disabled users in Active Directory then you need to start powershell console then import-module activedirectory and next run:
Search-ADAccount -AccountDisabled -UsersOnly
this will return all disabled users in AD.]]></description>
		<content:encoded><![CDATA[<p>Hi<br />
If you use this script you don&#8217;t have to modify it. It will find disabled users in specified group and remove them. But if you want to find all disabled users in Active Directory then you need to start powershell console then import-module activedirectory and next run:<br />
Search-ADAccount -AccountDisabled -UsersOnly<br />
this will return all disabled users in AD.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: New to PS</title>
		<link>http://exchangeblog.pl/en/2013/02/exchange-2010-remove-disabled-users-from-distribution-group/#comment-104636</link>
		<dc:creator><![CDATA[New to PS]]></dc:creator>
		<pubDate>Fri, 08 Nov 2013 02:18:15 +0000</pubDate>
		<guid isPermaLink="false">http://exchangeblog.pl/?p=2976#comment-104636</guid>
		<description><![CDATA[Hi there,

I&#039;m fairly new to PS, how would I modify this to search for disabled AD users?  Would I need to import that AD module and then do something like a variable for get-aduser -filter disabled?]]></description>
		<content:encoded><![CDATA[<p>Hi there,</p>
<p>I&#8217;m fairly new to PS, how would I modify this to search for disabled AD users?  Would I need to import that AD module and then do something like a variable for get-aduser -filter disabled?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Remigiusz Szatkowski</title>
		<link>http://exchangeblog.pl/en/2013/02/exchange-2010-remove-disabled-users-from-distribution-group/#comment-95969</link>
		<dc:creator><![CDATA[Remigiusz Szatkowski]]></dc:creator>
		<pubDate>Mon, 16 Sep 2013 16:24:24 +0000</pubDate>
		<guid isPermaLink="false">http://exchangeblog.pl/?p=2976#comment-95969</guid>
		<description><![CDATA[Exaclty, this script removes disabled mailbox from distribution group. If you need to remove disabled AD accounts you can easly modify this script.
If you will have any problems with this let me know.]]></description>
		<content:encoded><![CDATA[<p>Exaclty, this script removes disabled mailbox from distribution group. If you need to remove disabled AD accounts you can easly modify this script.<br />
If you will have any problems with this let me know.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Craig</title>
		<link>http://exchangeblog.pl/en/2013/02/exchange-2010-remove-disabled-users-from-distribution-group/#comment-95966</link>
		<dc:creator><![CDATA[Craig]]></dc:creator>
		<pubDate>Mon, 16 Sep 2013 16:12:47 +0000</pubDate>
		<guid isPermaLink="false">http://exchangeblog.pl/?p=2976#comment-95966</guid>
		<description><![CDATA[Just figured out my problem after examining the script more closely.  It works for Disabled accounts in Exchange, not in AD which is what I was looking for.  I think I still may find use for this excellent script.]]></description>
		<content:encoded><![CDATA[<p>Just figured out my problem after examining the script more closely.  It works for Disabled accounts in Exchange, not in AD which is what I was looking for.  I think I still may find use for this excellent script.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Craig</title>
		<link>http://exchangeblog.pl/en/2013/02/exchange-2010-remove-disabled-users-from-distribution-group/#comment-95964</link>
		<dc:creator><![CDATA[Craig]]></dc:creator>
		<pubDate>Mon, 16 Sep 2013 15:47:23 +0000</pubDate>
		<guid isPermaLink="false">http://exchangeblog.pl/?p=2976#comment-95964</guid>
		<description><![CDATA[I cannot get this to work.  It does run, but the log file is blank]]></description>
		<content:encoded><![CDATA[<p>I cannot get this to work.  It does run, but the log file is blank</p>
]]></content:encoded>
	</item>
</channel>
</rss>
