<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0">
  <channel>
    <title>0x80004005</title>
    <link>http://www.0x80004005.net/</link>
    <description>0x80004005 Blog</description>
    <language>en-us</language>           
    <generator>Nucleus CMS v3.24</generator>
    <copyright>Â©</copyright>             
    <category>Weblog</category>
    <docs>http://backend.userland.com/rss</docs>
    <image>
      <url>http://www.0x80004005.net//nucleus/nucleus2.gif</url>
      <title>0x80004005</title>
      <link>http://www.0x80004005.net/</link>
    </image>
    
<item>
 <title>.NK2 Files</title>
 <link>http://www.0x80004005.net/index.php?itemid=463</link>
<description><![CDATA[There are several banes to my existance as an Exchange Administrator.  Outlook is one of them (not including the MAC that pretends to be a PC). <br />
 <br />
One of the biggest problems is .NK2 files (the Outllok Nickname look-up cache).<br />
<br />
This file is VERY touchy.   If you open it with anything and save it, the file is hosed.  It will not work correctly anymore.<br />
<br />
Here are a few things I have learned that will help anyone working with .NK2 files.<br />
<br />
1- They cannot be over 500 KB in size.  If they get that big, they will not add any more items.<br />
<br />
2- You can delete items from them by starting a new email, and when it displays the options, highlight the one you don't want anymore and press delete.  It is now gone from the cache.<br />
<br />
3- They always get corrupted.   I have found a cool utility that lets you view them (for free), but you have to pay to be able to fix it.<br />
<br />
<a href="http://www.ingressor.com" onclick="javascript:window.open(this.href, '_blank'); return false;">http://www.ingressor.com</a> is the place where you can get the file.<br />
<br />
4- If you cut and paste an email address into the to field, it will not add it to the cache, you have to actually type it in the to field for it to add it to the cache.  I know, weird, but that is the case.<br />
<br />
Bottom line, the easiest way to deal with them is to just delete the file and have Outlook rebuild it.]]></description>
 <category>Microsoft Exchange Server 2007</category>
<comments>http://www.0x80004005.net/index.php?itemid=463</comments>
 <pubDate>Wed, 3 Sep 2008 15:35:20 -0600</pubDate>
</item><item>
 <title>Full Access rights to all mailboxes in Storage Group</title>
 <link>http://www.0x80004005.net/index.php?itemid=461</link>
<description><![CDATA[I wanted an easy way to give myself full mailbox rights to all the mailboxes in a specific storage group.   (I need to log into our resource or email only accounts to see what type of traffic and when the last items were read).Here is the script that I used to do this:<br />
<br />
[PS] C:\Windows\System32>get-mailbox -server ex01 | where-object {$_.Database -like "EX01\RSG1\*"} | add-mailboxpermission -AccessRights fullaccess -user mkieffer<br />
<br />
This worked well, when I am done I will run the following command to remove the access.<br />
<br />
[PS] C:\Windows\System32>get-mailbox -server ex01 | where-object {$_.Database -like "EX01\RSG1\*"} | remove-mailboxpermission -AccessRights fullaccess -user mkieffer]]></description>
 <category>Exchange 2007 - PowerShell Script</category>
<comments>http://www.0x80004005.net/index.php?itemid=461</comments>
 <pubDate>Thu, 28 Aug 2008 09:28:06 -0600</pubDate>
</item><item>
 <title>What mailboxes are ready to be purged</title>
 <link>http://www.0x80004005.net/index.php?itemid=460</link>
<description><![CDATA[If you want to see what mailboxes are going to be purged during the next mailbox cleanup this script is for you.<br />
<br />
This script will display what mailboxes are going to be purged, how big they are, and when they were disconnected.<br />
Get-MailboxStatistics -server ex01 | where-object {$_.DisconnectDate -ne $null} | Select Displayname,DisconnectDate,TotalItemSize | sort-object DisconnectDate >> c:\temp\stats.txt<br />
<br />
<br />
Output is then sent to C:\temp\stats.txt.  Then you can email the results, or save them for future use.]]></description>
 <category>Exchange 2007 - PowerShell Script</category>
<comments>http://www.0x80004005.net/index.php?itemid=460</comments>
 <pubDate>Tue, 29 Jul 2008 10:21:44 -0600</pubDate>
</item><item>
 <title>Terminated users script</title>
 <link>http://www.0x80004005.net/index.php?itemid=459</link>
<description><![CDATA[We have a process where when somone is terminated from the company we move their AD account to a specific OU.  We then have a script that runs that disables their mailbox.<br />
Here are the commands we use<br />
<br />
1- Generate an HTML of users to have email disabled<br />
get-mailbox -OrganizationalUnit [REMOVED]/Corp/Users/Terminations | convertto-html -property Name,OrganizationalUnit -Title 'Terminated Users' > C:\term_log.html" <br />
<br />
2- Do the actual disable-mailboxes<br />
get-mailbox -OrganizationalUnit [REMOVED]/Corp/Users/Terminations | disable-mailbox -confirm:$false" <br />
<br />
<br />
We then email the results by using a .vbs script that takes the output and emails it.   This gives us the ability to view what will be deleted in 45 days.]]></description>
 <category>Exchange 2007 - PowerShell Script</category>
<comments>http://www.0x80004005.net/index.php?itemid=459</comments>
 <pubDate>Tue, 29 Jul 2008 10:19:18 -0600</pubDate>
</item><item>
 <title>Department Script</title>
 <link>http://www.0x80004005.net/index.php?itemid=458</link>
<description><![CDATA[We needed a way to list all of the users in a mailstore and what department they belong to.  We have our mail store membership based on department, so we need to audit it and verify mail store membership.  (Just in case someone changes  from one department to another department).<br />
<br />
Here is the script.<br />
<br />
$a= get-mailboxdatabase -server ex01 | Sort-Object Name<br />
<br />
<br />
foreach ($mailstore in $a) {<br />
$b= get-mailbox -SortBy Name | where {$_.Database -eq $mailstore.Identity}<br />
write-host $mailstore.Identity -foregroundcolor red -backgroundcolor green<br />
write-host "**********************************"<br />
	foreach ($username in $b) {<br />
		$c = get-user $username.Name<br />
		write-host $c.WindowsEmailAddress -nonewline<br />
		write-host "," -nonewline<br />
		write-host $c.Department<br />
	}	<br />
}<br />
<br />
<br />
<br />
<br />
]]></description>
 <category>Exchange 2007 - PowerShell Script</category>
<comments>http://www.0x80004005.net/index.php?itemid=458</comments>
 <pubDate>Tue, 29 Jul 2008 10:15:27 -0600</pubDate>
</item><item>
 <title>New users script.</title>
 <link>http://www.0x80004005.net/index.php?itemid=457</link>
<description><![CDATA[We wanted to automate the process of creating new Exchange users.   Because you can't create mailboxes using AD users and computers, we did not want to have to instruct everyone on how to use the new tools.<br />
 <br />
So we set-up a script that runs every day and takes all the users in an OU that are not mail enabled and then we mail enable them.   (We ONLY wanted the ones in the parent OU, not the sub OUs.  Our contractors and terminated employees are in sub OUs).Here is the script:<br />
<br />
<br />
$a = get-user -OrganizationalUnit "[REMOVED]/Corp/Users" -RecipientTypeDetails "User" | where {$_.DistinguishedName -notlike '*OU=Generic Accounts,OU=Employees,OU=Users,OU=Corp,DC=[REMOVED],DC=int' -and $_.DistinguishedName -notlike '*OU=Contractors,OU=Employees,OU=Users,OU=Corp,DC=[REMOVED],DC=int'}<br />
<br />
remove-item d:\scripts\newusers.txt<br />
<br />
$date = get-date<br />
<br />
Add-Content d:\scripts\newusers.txt "=============================================="<br />
Add-Content d:\scripts\newusers.txt "Starting New User Mailbox Run"<br />
Add-Content d:\scripts\newusers.txt " "<br />
<br />
foreach ($item in $a) {<br />
<br />
Add-Content d:\scripts\newusers.txt "Creating Mailbox for: $item"<br />
Add-Content d:\scripts\newusers.txt " "<br />
enable-mailbox -Identity $item -Alias $item.SamAccountName -Database "EX01\TempSG1\TempSG1-MS1"<br />
<br />
}<br />
<br />
Add-Content d:\scripts\newusers.txt "Finished New User Mailbox Run"<br />
Add-Content d:\scripts\newusers.txt "=============================================="<br />
Add-Content d:\scripts\newusers.txt "Users in the TempSG1-MS1 Mail Database"<br />
Add-Content d:\scripts\newusers.txt "SamAccountName (Department) WindowsEmailAddress "<br />
Add-Content d:\scripts\newusers.txt " "<br />
<br />
$b = get-mailbox -Database "EX01\TempSG1\TempSG1-MS1"<br />
<br />
foreach ($itemb in $b) {<br />
$userdata = get-user $itemb<br />
$userdatastring = $userdata.SamAccountName + " (" + $userdata.Department + ") " + $userdata.WindowsEmailAddress<br />
Add-Content d:\scripts\newusers.txt $userdatastring<br />
Add-Content d:\scripts\newusers.txt " "<br />
}<br />
Add-Content d:\scripts\newusers.txt "=============================================="<br />
Add-Content d:\scripts\newusers.txt "Script Finished"<br />
<br />
<br />
-----------------------------------------------<br />
Because we add them to a temporary mail store, we then generate a list that shows us what department they user belongs to.  Then we can move them to the correct mail store (we base mail store membership on department) the following week.<br />
]]></description>
 <category>Exchange 2007 - PowerShell Script</category>
<comments>http://www.0x80004005.net/index.php?itemid=457</comments>
 <pubDate>Tue, 29 Jul 2008 10:12:58 -0600</pubDate>
</item><item>
 <title>Dynamic - non dynamic distribution list</title>
 <link>http://www.0x80004005.net/index.php?itemid=456</link>
<description><![CDATA[We have a distribution list that needs to have specific members in it, but we don't want to update it all the time.   This distribution list needs to be a little more selective than we can get a dynamic distribution list to be.   So we created a script that blows away the distribution lists membership, and then re-adds it using powershell script.Here is the code:<br />
<br />
$DLIST = "FYI All"<br />
<br />
# Delete Distribution List Members<br />
 <br />
Get-DistributionGroupMember -Identity $DLIST | Remove-DistributionGroupMember -Identity $DLIST -confirm:$false<br />
<br />
# Add Mailbox Users<br />
<br />
get-mailbox -OrganizationalUnit "[OU GOES HERE]" | where {$_.OrganizationalUnit -eq "[OU GOES HERE]"} | Add-DistributionGroupMember -Identity $DLIST<br />
<br />
# Add Email Enabled Users<br />
<br />
$a= get-mailuser -OrganizationalUnit "[OU GOES HERE]"<br />
<br />
foreach ($item in $a) {<br />
Add-DistributionGroupMember -Identity $DLIST -Member $item.UserPrincipalName<br />
}<br />
-------------------------------------------------<br />
<br />
The main problem we ran into was that it would also include all of the users in the the sub OUs (contractors, and terminations).   So this script only adds thoes in the parent OU, not the sub OUs.  We also needed to add the second part to add users that are mail users, but don't have mailboxes.]]></description>
 <category>Exchange 2007 - PowerShell Script</category>
<comments>http://www.0x80004005.net/index.php?itemid=456</comments>
 <pubDate>Tue, 29 Jul 2008 10:08:37 -0600</pubDate>
</item><item>
 <title>Distribution List - Multiple Owners</title>
 <link>http://www.0x80004005.net/index.php?itemid=455</link>
<description><![CDATA[How do you give a distribution list owner rights to multiple owners?In Exchange 2007 it is pretty easy.<br />
<br />
First you create a Security group that contains all the users you wish to be list owners (ability to modify list membership).   Then you can use the add-adpermission commandlet to create the membership.<br />
<br />
In this example we have a distribution list called "MF Mentors" and a security group called "Distribution List Editors".  This is the command you can use to do this.<br />
<br />
[PS] C:\Windows\System32>add-adpermission "MF mentors" -user "Distribution List Editors" -AccessRights ReadProperty,WriteProperty -Properties Member<br />
<br />
You should then be able to see the following if you get-adpermission on that distribution list.<br />
<br />
User                : [DOMAIN INFORMATION]\Distribution List Editors<br />
Identity            : [DOMAIN INFORMAIONT]\MF Mentors<br />
Deny                : False<br />
AccessRights        : {ReadProperty, WriteProperty}<br />
ExtendedRights      :<br />
IsInherited         : False<br />
Properties          : {Member}<br />
ChildObjectTypes    :<br />
InheritedObjectType :<br />
InheritanceType     : None]]></description>
 <category>Microsoft Exchange Server 2007</category>
<comments>http://www.0x80004005.net/index.php?itemid=455</comments>
 <pubDate>Mon, 21 Jul 2008 10:28:11 -0600</pubDate>
</item><item>
 <title>Powershell - Exchange 2007 - All Addresses</title>
 <link>http://www.0x80004005.net/index.php?itemid=454</link>
<description><![CDATA[I needed to get a list of all email adresses in our organization so I could then upload this list to our ANTI-SPAM appliance so it would reject sessions from other SMTP hosts where the email address is not found in this list.Here is the script that I use....<br />
<br />
$a = get-recipient -ResultSize Unlimited<br />
foreach ($recipient in $a) {<br />
$b = get-recipient $recipient.alias<br />
foreach ($item in $b.EmailAddresses) {<br />
If ($item -like 'SMTP:*' -or $item -like 'smtp:*') { <br />
write-output $item.SmtpAddress.ToLower()<br />
}<br />
}<br />
}<br />
<br />
As always, contact me if you have questions....]]></description>
 <category>Microsoft Exchange Server 2007</category>
<comments>http://www.0x80004005.net/index.php?itemid=454</comments>
 <pubDate>Mon, 16 Jun 2008 11:56:08 -0600</pubDate>
</item><item>
 <title>Run Script as at job to disable terminated users mailboxes.</title>
 <link>http://www.0x80004005.net/index.php?itemid=453</link>
<description><![CDATA[We have a procedure where after a user is terminated their AD User object is moved into a terminated users OU.  Then they are removed from all security/distribution groups.<br />
 <br />
We needed a way to have their Mailbox disabled as well.   So we setup a at script that does this.<br />
To run the script, you need to use the following command:<br />
<br />
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -PSConsoleFile "C:\Program Files\Microsoft\Exchange Server\bin\exshell.psc1"  -command ". 'C:\ps-scripts\terminated_users.ps1'”<br />
<br />
This will runn the script termiated_users.ps1 as an Exchange PowerShell script.<br />
<br />
Here is what the termiated_users.ps1 script contains:<br />
<br />
get-mailbox -OrganizationalUnit "myfamily.int/Corp/Users/Terminations" | disable-mailbox -WhatIf<br />
<br />
<br />
Basically the script grabs all the mailbox objects in the Terminations OU, then disables them.  You will want to remove the -WhatIf after you verify that it is only affecting the accounts you want affected.<br />
]]></description>
 <category>Microsoft Exchange Server 2007</category>
<comments>http://www.0x80004005.net/index.php?itemid=453</comments>
 <pubDate>Mon, 2 Jun 2008 11:30:40 -0600</pubDate>
</item>
  </channel>
</rss>