<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Exchange Powershell &#187; Exchange</title>
	<atom:link href="http://www.exchange-powershell.com/category/exchange/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.exchange-powershell.com</link>
	<description>Exchange and Powershell Helps, Tips, and Tricks</description>
	<lastBuildDate>Mon, 12 Jul 2010 17:23:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
<meta xmlns="http://www.w3.org/1999/xhtml" name="robots" content="noindex,follow" />
		<item>
		<title>List Members of a Dynamic Distribution List</title>
		<link>http://www.exchange-powershell.com/2010/07/12/list-members-of-a-dynamic-distribution-list/</link>
		<comments>http://www.exchange-powershell.com/2010/07/12/list-members-of-a-dynamic-distribution-list/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 17:23:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Exchange]]></category>
		<category><![CDATA[GAL - Global Address List]]></category>
		<category><![CDATA[get-dynamicdistributiongroup]]></category>
		<category><![CDATA[get-recipient]]></category>
		<category><![CDATA[RecipientPreviewFilter]]></category>
		<category><![CDATA[Select]]></category>
		<category><![CDATA[Sort]]></category>

		<guid isPermaLink="false">http://www.exchange-powershell.com/?p=5675</guid>
		<description><![CDATA[This post was inspired by a post found on www.howexchangeworks.com But I have modified the commands some to get a better listing. $group = Get-DynamicDistributionGroup –identity “AllStaff” Get-Recipient –RecipientPreviewFilter $group.RecipientFilter &#124; sort name &#124; select name > d:\_temp\dlist_members.txt These changes will give you an alphabetical list of members, with names only in the list. I [...]]]></description>
			<content:encoded><![CDATA[<p>This post was inspired by a post found on <a href="http://www.howexchangeworks.com/2009/10/task-listing-members-of-exchange-2007.html">www.howexchangeworks.com</a></p>
<p>But I have modified the commands some to get a better listing.</p>
<blockquote><p>$group = Get-DynamicDistributionGroup –identity “AllStaff”</p></blockquote>
<blockquote><p>Get-Recipient –RecipientPreviewFilter $group.RecipientFilter | sort name | select name > d:\_temp\dlist_members.txt</p></blockquote>
<p>These changes will give you an alphabetical list of members, with names only in the list.   I find this easier for managers to use to verify list membership.</p>
<p>The list we have uses the PO filed to filter it.  So we then just have to go to the user account and add specific text in the PO filed to add or remove them from the distribution list.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.exchange-powershell.com/2010/07/12/list-members-of-a-dynamic-distribution-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exchange &#8211; Cannot remove ACE on object &#8230; because it is not present.</title>
		<link>http://www.exchange-powershell.com/2010/06/03/exchange-cannot-remove-ace-on-object-because-it-is-not-present/</link>
		<comments>http://www.exchange-powershell.com/2010/06/03/exchange-cannot-remove-ace-on-object-because-it-is-not-present/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 16:05:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Exchange]]></category>
		<category><![CDATA[PowerShell V2]]></category>
		<category><![CDATA[remove-mailboxpermission]]></category>
		<category><![CDATA[Role: Mailbox]]></category>

		<guid isPermaLink="false">http://www.exchange-powershell.com/?p=5648</guid>
		<description><![CDATA[I have run into a problem while doing some routine maintenance on some shared mailboxes for the company I work for. During the maintenance process, we audit the list of users that have full mailbox rights to any shared mailbox. In the process, I was trying to remove full permissions from several user accounts. Here [...]]]></description>
			<content:encoded><![CDATA[<p>I have run into a problem while doing some routine maintenance on some shared mailboxes for the company I work for.   During the maintenance process, we audit the list of users that have full mailbox rights to any shared mailbox.  In the process, I was trying to remove full permissions from several user accounts.  Here is what the Manage Full Access Permission screen looked like.<br />
<a href="http://www.exchange-powershell.com/wp-content/uploads/2010/06/emc_manage_full_access_permission.png"><img src="http://www.exchange-powershell.com/wp-content/uploads/2010/06/emc_manage_full_access_permission-300x261.png" alt="Exchange Management Console - Manage Full Access Permission" title="emc_manage_full_access_permission" width="300" class="alignnone size-medium wp-image-5646" /></a><br />
If you notice, that last one on the list has a weird Icon associated with it.  The icon is that of a user account with a small blue question mark in it.</p>
<p>But when you try to delete the message, you get the following screen that contains the following error</p>
<p><a href="http://www.exchange-powershell.com/wp-content/uploads/2010/06/emc_full_access_permission_error.png"><img src="http://www.exchange-powershell.com/wp-content/uploads/2010/06/emc_full_access_permission_error-150x150.png" alt="Cannot remove ACE on object ... because it is not present." title="emc_full_access_permission_error" width="150" height="150" class="alignnone size-thumbnail wp-image-5647" /></a></p>
<blockquote><p>Summary: 1 item(s). 0 succeeded, 1 failed.<br />
Elapsed time: 00:00:00</p>
<p>[REMOVED]\dtaylor<br />
Failed</p>
<p>Error:<br />
Cannot remove ACE on object &#8220;CN=MAIL ROOM,OU=Email Accounts,OU=[REMOVED]&#8221; for account &#8220;[REMOVED]\dtaylor&#8221; because it is not present.</p>
<p>Exchange Management Shell command attempted:<br />
Remove-MailboxPermission -Identity &#8216;CN=MAIL ROOM,OU=Email Accounts,OU=[REMOVED]&#8216; -User &#8216;[REMOVED]\dtaylor&#8217; -InheritanceType &#8216;All&#8217; -AccessRights &#8216;FullAccess&#8217;</p>
<p>Elapsed Time: 00:00:00</p></blockquote>
<p>Let me give you a little background.  Several years ago, we had three domains.  Two of the domains contained Exchange 2003 servers with mailboxes.  We migrated all the mailboxes from the two domains to the domain that did not currently have an Exchange server in it.  So basically we took three domains and consolidated to a single domain and migrated from Exchange 2003 to Exchange 2007.  All three domains belonged to the same AD forest.  </p>
<p><strong>Solution</strong><br />
One way I found to get past this error was to copy the error message, and change the domain to the previous domain in the command.  This would then delete the ACE for that user.  This method works great, if the domain still exists in the organization so that it can do a SID lookup and then delete the ACE.  (NOTE: I even tried to modify the command so instead of using [DOMAIN]\[USERNAME] I used the SID, but this did not work).</p>
<p>Exchange for some odd reason will always send the command to the Remove-MailboxPermission with the username in domain\username format.  It will always do a lookup on the SID and then translate it to that format.  So even by using the sid you get the same error.  Here is an example:</p>
<p>[PS] >Remove-MailboxPermission -Identity &#8216;CN=MAIL ROOM,OU=Email Accounts,OU=[REMOVED]&#8216; -User &#8216;S-1-5-21-1398355167-[REMOVED]-15821&#8242; -InheritanceType &#8216;All&#8217; -AccessRights &#8216;FullAccess&#8217;</p>
<p>Confirm<br />
Are you sure you want to perform this action?</p>
<blockquote><p>Removing mailbox permission &#8220;[REMOVED]/Corp/Email Accounts/MAIL ROOM&#8221; for user &#8220;S-1-5-21-1398355167-[REMOVED]-15821&#8243; with access rights &#8220;&#8216;FullAccess&#8217;&#8221;.</p>
<p>[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help<br />
(default is &#8220;Y&#8221;):y</p>
<p>Remove-MailboxPermission : Cannot remove ACE on object &#8220;CN=MAIL ROOM,OU=Email Accounts,OU=[REMOVED]&#8221; for account &#8220;[REMOVED]\dtaylor&#8221; because it is not present.<br />
At line:1 char:25</p></blockquote>
<p>Notice that the first line has the SID in the remove-mailboxPermission command, but in the failed text, it has replaced the SID with the username.  </p>
<p>To get the sid to do this, I went into AD Users and Computers and then after selecting the advanced view did an Attribute Editor lookup on the sIDHistory field.</p>
<p>So what do you do to remove the ACE for this account?   The problem is that no matter what input you give the remove-MailboxPermission cmdlet, it will always do a lookup and resolve the sid to a username format.  But if the sid it does the lookup on is not the primary sid for that account it will fail.  To solve this problem you have to remove the ability for the cmdlet to resolve the sid in the first place.  To do this, you have to remove the sIDHistory from the AD account.</p>
<p>Microsoft has a script on their site called &#8220;<a href="http://support.microsoft.com/kb/295758" target="_new">How To Use Visual Basic Script to Clear SidHistory</a>&#8220;.  If you run this script, it will remove the sid history, then when you look at the FULL Permissions, you will see a unresolved SID instead of the username.  The remove-mailboxpermission cmdlet can then remove the ACE from that mailbox.</p>
<p>NOTE:  I would record the sid value in the sIDHistory field somewhere, because chances are you will find other accounts that now show that sid as having full mailbox rights.  You will then want to have a history of the sid so you can then grant permission to the correct account when you see an unresolved sid.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.exchange-powershell.com/2010/06/03/exchange-cannot-remove-ace-on-object-because-it-is-not-present/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Delete all messages after date from mailbox</title>
		<link>http://www.exchange-powershell.com/2009/11/24/delete-all-messages-after-date-from-mailbox/</link>
		<comments>http://www.exchange-powershell.com/2009/11/24/delete-all-messages-after-date-from-mailbox/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 23:16:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Exchange]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[export-mailbox]]></category>
		<category><![CDATA[Role: Mailbox]]></category>

		<guid isPermaLink="false">http://www.exchange-powershell.com/?p=443</guid>
		<description><![CDATA[I was asked to delete everything from a mailbox called familydomains that was older than 2009. Here is the Exchange Powershell command that I used to delete everything earlier than 12/31/2008 to a PST file located in my C:\temp directory. export-mailbox familydomains -PSTFolderPath C:\temp\ -DeleteContent -endDate 12/31/2008 The advantage to doing it this way is [...]]]></description>
			<content:encoded><![CDATA[<p>I was asked to delete everything from a mailbox called familydomains that was older than 2009.  Here is the Exchange Powershell command that I used to delete everything earlier than 12/31/2008 to a PST file located in my C:\temp directory.</p>
<blockquote><p>export-mailbox familydomains -PSTFolderPath C:\temp\ -DeleteContent -endDate 12/31/2008</p></blockquote>
<p>The advantage to doing it this way is that no emails are actually deleted.  They are moved from the mailbox to the PST file, so they can be imported, or viewed through Outlook at a later date if the end user changes their mind.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.exchange-powershell.com/2009/11/24/delete-all-messages-after-date-from-mailbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Command to list all messages to a specific domain for the day</title>
		<link>http://www.exchange-powershell.com/2009/11/20/command-to-list-all-messages-to-a-specific-domain-for-the-day/</link>
		<comments>http://www.exchange-powershell.com/2009/11/20/command-to-list-all-messages-to-a-specific-domain-for-the-day/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 22:21:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Exchange]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[get-messagetrackinglog]]></category>
		<category><![CDATA[get-transportserver]]></category>

		<guid isPermaLink="false">http://www.exchange-powershell.com/?p=395</guid>
		<description><![CDATA[If you want to list all of the messages sent to a recipient with a specific domain, you can run this command. It will export a list of all message from 8:00AM &#8211; 5:00PM on 10/17/2009 that were to someone on the domainname.com domain. The list will be saved to c:\send.xls get-transportserver &#124; Get-MessageTrackingLog -ResultSize [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to list all of the messages sent to a recipient with a specific domain, you can run this command.  It will export a list of all message from 8:00AM &#8211; 5:00PM on 10/17/2009 that were to someone on the domainname.com domain.  The list will be saved to c:\send.xls</p>
<blockquote><p>get-transportserver | Get-MessageTrackingLog -ResultSize Unlimited -Start &#8220;10/17/2009 8:00AM&#8221; -End &#8220;11/17/2009 5:00PM&#8221; -eventid Send  | WHERE {$_.recipients -like &#8220;*domainname.com*&#8221;} > &#8220;c:\send.xls&#8221;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.exchange-powershell.com/2009/11/20/command-to-list-all-messages-to-a-specific-domain-for-the-day/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
