Archive

Posts Tagged ‘Exchange Server 2007’

Update Rollup 2 (UR2) for Exchange Server 2007 SP3 Released

December 14th, 2010 No comments

Microsoft has released the following update rollup for Exchange Server 2010:

  • Update Rollup 2 for Exchange Server 2007 SP3 (2407025)

If you’re running Exchange Server 2007 SP3, you need to apply Update Rollup 2 for Exchange 2007 to address the issues listed below.

Remember, you only need to download the latest update for the version of Exchange that you’re running.

Here is a list of the fixes included in update rollup 2:

  1. 972186 Need to include the server service as a required service for Exchange 2007 running on Server 2008
  2. 2290105 OWA SharePointe/UNC Access is broken after SP3

Download the rollup here.

Microsoft also announced that UR3 for Exchange 2007 SP3 should be released in February.

Installation Notes:

If you haven’t installed Exchange Server yet, you can use the info at Quicker Exchange installs complete with service packs and rollups to save you some time.

Microsoft Update can’t detect rollups for Exchange 2010 servers that are members of a Database Availability Group (DAG). See the post Installing Exchange 2010 Rollups on DAG Servers for info, and a script, for installing update rollups.

Update Rollups should be applied to Internet facing Client Access Servers before being installed on non-Internet facing Client Access Servers.

If you’re installing the update rollup on Exchange servers that don’t have Internet access, see “Installing Exchange 2007 & 2010 rollups on servers that don’t have Internet access” for some additional steps.

Also, the installer and Add/Remove Programs text is only in English – even when being installed on non-English systems.

Note to Forefront users:

If you don’t disable Forefront before installing a rollup or service pack, and enable afterwards, you run the risk of Exchange related services not starting. You can disable Forefront by going to a command prompt and navigating to the Forefront directory and running FSCUtility /disable. To enable Forefront after installation of a UR or SP, run FSCUtility /enable.

Password Reset Feature in Exchange 2007 and 2010

November 8th, 2010 1 comment

In many organizations, creating new mailbox enabled users includes checking the “User must change password at next logon” box on the account. From a security perspective, that makes sound sense. However, if the user is a mobile user and only signs in to OWA, this has been a problem, as checking the box would prevent the user from being able to log in the first time. The same problem exists if a user’s password expires before they change it. The resolution is a call to the Help Desk to have the account unlocked.

Microsoft recently added a feature that helps aleviate this issue. When enabled, users are allowed to change their password and then login – thus eliminating the call to the Help Desk.

In Exchange 2007, the feature was added in SP3, while in Exchange 2010, it was added in SP1. One important note is that the feature only works in Exchange servers running on Windows 2008 or later.

Enabling the feature is very easy, and takes only a minute. For either version of Exchange, go to the server(s) holding the Client Access Server role and open regedit.

Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSExchange OWA

Create a new DWORD (32-bit) value called ChangeExpiredPasswordEnabled

Assign the new DWORD a value of 1 as shown below.

Note: If the ChangeExpiredPasswordEnable registry key already exists, set its value to 1. Any value other than 1 will disable the feature.

Restart IIS by opening a cmd prompt and typing IISRESET /NOFORCE.

Repeat this process for all Client Access Servers. Once finished, when a user logs in with an expired password, they are prompted with a new screen as shown in both Exchange 2007 (left) and Exchange 2010 (right) below:

Once the user enters a valid new password, they are shown the following screen:

Once the user clicks on “OK”, they are prompted to login with their new password. Enjoy!

Exchange 2010 Architecture Diagrams Available for Download

October 25th, 2010 No comments

Those who remember the print version of TechNet Magazine will recall the giant posters you’d sometimes get showing the architecture of various products such as Windows Server, SQL, and Exchange. When the print version of TechNet was stopped, many thought we’d seen the end of these valuable tools. Well, that’s not the case. The Exchange product group has released the Exchange 2010 Architecture poster. This downloadable .pdf file is in the same format as the print versions, and it’s huge. A wealth of information is contained on it. Now, to find a printer that can handle it!

Also, the product group released released the Exchange 2010 Transport Architecture Diagrams. The two diagrams available there cover Hub Transport Role Architecture and Hub Transport Extensibility.

Exchange 2010 Hub Transport Role Architecture

Exchagne 2010 Hub Transport Extensibility

If you’re looking for the 2007 poster, it can be found at Exchange Server 2007 Component Architecture.

Update Rollup 1 (UR1) for Exchange Server 2007 SP3 Released

September 13th, 2010 No comments

Microsoft has released the following update rollup for Exchange Server 2007:

  • Update Rollup 1 for Exchange Server 2007 SP3 (2279655)

If you’re running Exchange Server 2007, you need to apply Update Rollup 1 for Exchange 2007 to address the issues listed below.

Remember, you only need to download the latest update for the version of Exchange that you’re running.

Here is a list of the fixes included in update rollup 1:

  1. 2188615 Event ID: 4999 is logged when the EdgeTransport.exe process crashes intermittently on an Exchange Server 2007 server
  2. 2203381 “554 5.6.0 STOREDRV.Deliver; Corrupt message content” NDR is generated when you send an email message to an Exchange Server 2007 user
  3. 2251714 The connecting information is not logged when a user accesses a mailbox that is hosted on an Exchange Server 2007 server by using POP3 or by using IMAP4
  4. 958305 An incorrect user is displayed as the caller in a mail message in an Exchange Server 2007 environment
  5. 973040 The Bcc information is lost when the Exchange Server 2003 journalized messages are sent to an Exchange Server 2007 mailbox
  6. 973637 Exchange Server 2007 creates incorrect Lotus Notes proxy email addresses
  7. 975424 The “legacyExchangeDN” value is shown in the “From” field of an email message instead of the Simple Display Name in an Exchange Server 2007 environment
  8. 975993 “The message could not be opened” error message when an Exchange Server 2007 user tries to open or accept a meeting request
  9. 976100 Shared calendar items are shown incorrectly in the server time zone instead of the time zone of an Exchange Server 2007 user who is accessing the shared calendar
  10. 977189 The meeting time of a meeting forward notification is incorrect on an Exchange Server 2007 server
  11. 978144 A warning message is received when you run the Test-ReplicationHealth cmdlet on an Exchange Server 2007 server
  12. 978468 You receive an error message and Event ID: 1008 is logged when you move an Exchange Server 2007 mailbox
  13. 979038 A memory leak occurs in the Microsoft.Exchange.Monitoring.exe process when you run the Test-OwaConnectivity cmdlet or the Test-ActiveSyncConnectivity cmdlet in Exchange Management Shell on an Exchange Server 2007 server
  14. 979194 Excluding domain names from the Sender ID filter does not take effect after you run the Set-SenderIDConfig cmdlet on an Exchange Server 2007 server
  15. 979338 Fax communication sessions are dropped by an Exchange Server 2007 Unified Messaging server
  16. 979519 The PR_REPORT_TEXT property represents an incorrect read notification in Exchange Server 2007
  17. 979803 Internet Explorer unexpectedly focuses on an Exchange Server 2007 user’s OWA inbox or on an OWA calendar that is added as a web part on a SharePoint Server-based website
  18. 980205 Public folder replication is blocked unexpected in an Exchange Server 2007 environment
  19. 980301 The Microsoft Exchange Information Store service stops responding during a Volume Shadow Copy Service backup on an Exchange Server 2007 server
  20. 980404 A multibyte character is converted into a “0xFFFD” character or into unrecognized characters when you use Exchange Web Services in an Exchange Server 2007 environment
  21. 980725 You experience issues when you move messages from one mailbox folder to another mailbox folder in an Exchange Server 2007 environment
  22. 980914 A user does not receive any new email messages by using a third-party POP3 client in a mixed Exchange Server 2007 and Exchange Server 2003 environment
  23. 980953 A second dot is added to the file names of the automatic generated attachments on an Exchange Server 2007 SP2 or later version server
  24. 981794 The Get-AgentLog cmdlet operation stops and you receive an error message Exchange Server 2007
  25. 982055 The store.exe process crashes occasionally on an active node when you move the Exchange Virtual Server from an active node to a passive node in an Exchange Server 2007 cluster environment
  26. 982099 Unexpected issues occur after you run the Set-mailbox cmdlet on an Exchange Server 2007 server to convert a shared mailbox into a regular mailbox
  27. 982118 The VSS backup operation fails occasionally and Event ID: 2034 is generated on an Exchange Server 2007 server
  28. 982213 The display name or the address of a user is displayed in garbage characters when you reply to an email message in an Exchange Server 2007 environment
  29. 982475 The inline image of an email message that is sent by using OWA with S/MIME enabled is lost for an Exchange Server 2007 user
  30. 982542 Attachments of certain email messages disappear at the client-side when you use an ExOLEDB-based application to change email messages in an Exchange Server 2007 environment
  31. 982722 It takes a long time to copy or move items from one public folder to another public folder by using Outlook in an Exchange Server 2007 environment
  32. 982928 The Msftesql.exe process continues using memory on an Exchange Server 2007 server
  33. 983296 Exchange ActiveSync crashes on an Exchange Server 2007 server causing the client synchronization to be unavailable
  34. 983447 A NDR is not generated when an email message is not delivered after you set the value for “Maximum number of recipients” of “Transport Settings” to “0” on an Exchange Server 2007 server
  35. 983529 The EdgeTransport.exe process crashes and then restarts on an Exchange Server 2007 server
  36. 983540 “Http 500” error message when you use Exchange Troubleshooting Assistant on an Exchange Server 2007 Client Access server to diagnose issues

Download the rollup here.

Installation Notes:

If you haven’t installed Exchange Server yet, you can use the info at Quicker Exchange installs complete with service packs and rollups to save you some time.

Microsoft Update can’t detect rollups for Exchange 2010 servers that are members of a Database Availability Group (DAG). See the post Installing Exchange 2010 Rollups on DAG Servers for info, and a script, for installing update rollups.

Update Rollups should be applied to Internet facing Client Access Servers before being installed on non-Internet facing Client Access Servers.

If you’re installing the update rollup on Exchange servers that don’t have Internet access, see “Installing Exchange 2007 & 2010 rollups on servers that don’t have Internet access” for some additional steps.

 

Exchange Server 2007 SP3 Released!

June 21st, 2010 No comments

Microsoft has released Service Pack 3 (SP3) for Exchange Server 2007.

The 800+MB download is just like SP1 – a full install package that incorporates the Service Pack. Existing installations can be upgraded, as new installs can be completed with the Service Pack integrated.

Service Pack 3 also includes support for running Exchange on Windows Server 2008 R2 – a much sought after feature, and for running the Management tools on Windows 7.

Update: I guess it would help if I included a download link.

Update Rollup 4 (UR4) for Exchange Server 2010 Released

June 19th, 2010 No comments

Microsoft has released the following update rollup for Exchange Server 2010:

  • Update Rollup 4 for Exchange Server 2010 (981401)

If you’re running Exchange Server 2010, you need to apply Update Rollup 4 for Exchange 2010 to address the issues listed below.

Remember, you only need to download the latest update for the version of Exchange that you’re running.

Here is a list of the fixes included in update rollup 4:

  1. 979342 An attachment is not visible when an Exchange Server 2010 user opens a signed mail message by using Outlook 2003
  2. 979517 You cannot send a message to a Dynamic Distribution Group in a mixed Exchange Server 2007 and Exchange Server 2010 environment
  3. 979790 An IMAP4 client crashes when accessing an Exchange Server 2010 mailbox
  4. 979801 An error message is generated in Exchange Server 2010 when you use Exchange Troubleshooting Assistant
  5. 979810 You cannot connect an Exchange Server 2010 mailbox by using a MAPI client
  6. 979848 Event ID 1066 is logged and you cannot move a mailbox from an Exchange Server 2003 server to an Exchange Server 2010 server
  7. 979862 Event ID 4999 and Event ID 7031 are logged when you move a mailbox to an Exchange Server 2010 server
  8. 979921 You cannot replicate a public folder from one Microsoft Exchange Server 2010 server to another, and Event ID 3079 is logged on the target server
  9. 980149 The Add-MailboxDatabaseCopy command fails when it is used to add a database copy to a Database Availability Group in an Exchange Server 2010 environment
  10. 980353 A MAPI application that is used to access Exchange Server 2010 mailboxes crashes when the application accesses an address book
  11. 980354 “MAPI_E_INVALID_PARAMETER” error message when you copy email messages from an Exchange Server 2010 mailbox
  12. 980364 Microsoft Exchange Transport service on an Exchange Server 2010 server crashes when a certain message is processed
  13. 980701 An Exchange Server 2010 mailbox user receives a NDR error message when the user sends an email message to multiple internal users
  14. 980852 The RpcClientAccess process on an Exchange Server 2010 server crashes when you access a mailbox by using a MAPI application
  15. 981033 Error message when you expand the Microsoft Exchange On-Premises node in the EMC of Exchange Server 2010
  16. 981961 Event ID 4033 is logged and the Free/Busy replication from an Exchange Server 2003 server to an Exchange Server 2010 server fails
  17. 982209 Some embedded messages are corrupted when they are contained in a message that is sent from an Exchange Server 2010 mailbox address
  18. 982378 A delegate receives only one meeting request when someone sends a meeting request to several principals in an Exchange Server 2010 RU1 or later environment
  19. 982944 The msExchVersion attribute value of a user is stamped incorrectly after you run the Enable-MailUser cmdlet to mail-enable the user
  20. 983200 The .xls file as an attachment is empty when you access an Exchange Server 2010 mailbox by using OWA
  21. 983631 “redirect it to people or distribution list” rule does not work on an Exchange Server 2010 mailbox address
  22. 2084061 A user intermittently fails to access an Exchange Server 2010 mailbox after the mailbox is moved

Download the rollup here.

Installation Notes:

If you haven’t installed Exchange Server yet, you can use the info at Quicker Exchange installs complete with service packs and rollups to save you some time.

Microsoft Update can’t detect rollups for Exchange 2010 servers that are members of a Database Availability Group (DAG). See the post Installing Exchange 2010 Rollups on DAG Servers for info, and a script, for installing update rollups.

Update Rollups should be applied to Internet facing Client Access Servers before being installed on non-Internet facing Client Access Servers.

If you’re installing the update rollup on Exchange servers that don’t have Internet access, see “Installing Exchange 2007 & 2010 rollups on servers that don’t have Internet access” for some additional steps.

Also, the installer and Add/Remove Programs text is only in English – even when being installed on non-English systems.

Script: Add-Cmdlets2Dictionary.ps1 – Adding PowerShell and Exchange Cmdlets to the Office Dictionary

May 12th, 2010 1 comment

I write a LOT of things that include technical terms, including email, book chapters, and client documentation. Of course, being the good soldier that I am, I try to spell and grammar check things so that the communications don’t make me look like a blabbering idiot.

The problem is that I’m constantly adding terms to the dictionary as I come across them. This include a ton of PowerShell, and usually, Exchange specific cmdlets. When I switched to a new workstation a week ago, I figured it was time to make life earlier. I mentioned online that there had to be a way to easily take a full list of PowerShell cmdlets and functions and dump them into the dictionary. Fellow Exchange MVP Michael B. Smith said it should be easy in PowerShell, and could be done in a single line of code. So we started to collaborate via Facebook (of all places!) on a solution. Michael posted the solution at Simplifying Life for Exchange Authors. I recommend you read his post for a way to do this painlessly. Thanks to Michael for indulging me.

After we came up with working code, it dawned on my that not everyone has remote PowerShell sessions into Exchange servers from their workstations. So I figured I’d make life a little easier, and compiled some various pieces together into a script. The script below will get a list of all Exchange servers in the same AD site as your workstation, randomly pick one, and establish a remote PowerShell session to it. Once established, it will dump all PowerShell functions and cmdlets to the Office dictionary. Copy the following code into Notepad on your workstation:

function Get-ExchangeServerInSite {
    $ADSite = [System.DirectoryServices.ActiveDirectory.ActiveDirectorySite]
    $siteDN = $ADSite::GetComputerSite().GetDirectoryEntry().distinguishedName
    $configNC=([ADSI]"LDAP://RootDse").configurationNamingContext
    $search = new-object DirectoryServices.DirectorySearcher([ADSI]"LDAP://$configNC")
    $objectClass = "objectClass=msExchExchangeServer"
    $version = "versionNumber>=1937801568"
    $site = "msExchServerSite=$siteDN"
    $search.Filter = "(&($objectClass)($version)($site))"
    $search.PageSize=1000
    [void] $search.PropertiesToLoad.Add("name")
    [void] $search.PropertiesToLoad.Add("msexchcurrentserverroles")
    [void] $search.PropertiesToLoad.Add("networkaddress")
    $search.FindAll() | %{
        New-Object PSObject -Property @{
            Name = $_.Properties.name[0]
            FQDN = $_.Properties.networkaddress |
                %{if ($_ -match "ncacn_ip_tcp") {$_.split(":")[1]}}
            Roles = $_.Properties.msexchcurrentserverroles[0]
        }
    }
}

#add all servers in the local site to an array
$servers = New-Object System.Collections.ArrayList
Get-ExchangeServerInSite | %{ [void]$servers.Add(($_.fqdn)) }

#select a random server from the current site
if($servers.count -gt 1) {
    $random = Get-Random -Minimum 0 -Maximum $servers.count
    $fqdn = $servers[$random]
}
else {
    $fqdn = $servers[0]
}

#create the session
$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "http://$fqdn/PowerShell/" -Authentication Kerberos
#import the session
Import-PSSession $session
$dicFile = (Get-Content Env:AppData) + "\Microsoft\UProof\CUSTOM.DIC"
Get-Command -module $global:importresults | Where-Object {$_.CommandType -eq "cmdlet" -or $_.CommandType -eq "function" -and $_.Name -notmatch ":"} | select-Object Name | Out-file -append $dicfile
#kill the session
Remove-PSSession $session

Save it as Add-Cmdlets2Dictionary.ps1. Now, open PowerShell, navigate to where you saved the file, and execute it using .\Add-Cmdlets2Dictionary.ps1. Once it’s finished, open Word or Outlook and test it with some random cmdlets like New-Mailbox. Keep in mind that Michael’s one-liner works great if you’ve already got a remote session into an Exchange server. My script above is in case you don’t, or you want a reusable script to share with colleagues.

Installation

Execution Policy: Third-party PowerShell scripts may require that the PowerShell Execution Policy be set to either AllSigned, RemoteSigned, or Unrestricted. The default is Restricted, which prevents scripts – even code signed scripts – from running. For more information about setting your Execution Policy, see Using the Set-ExecutionPolicy Cmdlet.

Donations

I’ve never been one to really solicit donations for my work. My offerings are created because *I* need to solve a problem, and once I do, it makes sense to offer the results of my work to the public. I mean, let’s face it: I can’t be the only one with that particular issue, right? Quite often, to my surprise, I’m asked why I don’t have a “donate” button so people can donate a few bucks. I’ve never really put much thought into it. But those inquiries are coming more often now, so I’m yielding to them. If you’d like to donate, you can send a few bucks via PayPal at https://www.paypal.me/PatRichard. Money collected from that will go to the costs of my website (hosting and domain names), as well as to my home lab.

Update Rollup 10 (UR10) for Exchange Server 2007 SP1 Released

April 13th, 2010 No comments

Microsoft has released the following update rollup for Exchange Server 2007:

  • Update Rollup 10 for Exchange Server 2007 SP1 (981407)

If you’re running Exchange Server 2007 SP1, you need to apply Update Rollup 10 for Exchange 2007 SP1 to address the issues listed below. If you’re running Exchange Server 2007 SP2 or later, this update does not apply to you.

Remember, you only need to download the latest update for the version of Exchange that you’re running.

Here is a list of the fixes included in update rollup 10:

  1. 981832 MS10-024: Vulnerabilities in Microsoft Exchange and Windows SMTP Service could allow denial of service

Download the rollup here.

Installation Notes:

If you haven’t installed Exchange Server yet, you can use the info at Quicker Exchange installs complete with service packs and rollups to save you some time.

Microsoft Update can’t detect rollups for Exchange 2010 servers that are members of a Database Availability Group (DAG). See the post Installing Exchange 2010 Rollups on DAG Servers for info, and a script, for installing update rollups.

Update Rollups should be applied to Internet facing Client Access Servers before being installed on non-Internet facing Client Access Servers.

If you’re installing the update rollup on Exchange servers that don’t have Internet access, see “Installing Exchange 2007 & 2010 rollups on servers that don’t have Internet access” for some additional steps.

 

Update Rollup 4 (UR4) for Exchange Server 2007 SP2 Released

April 10th, 2010 No comments

Microsoft has released the following update rollup for Exchange Server 2007:

  • Update Rollup 4 for Exchange Server 2007 SP2 (981383)

If you’re running Exchange Server 2007, you need to apply Update Rollup 4 for Exchange 2007 to address the issues listed below.

Remember, you only need to download the latest update for the version of Exchange that you’re running.

Here is a list of the fixes included in update rollup 4:

  1. 981832 MS10-024: Vulnerabilities in Microsoft Exchange and Windows SMTP Service could allow denial of service
  2. 981706 Exchange 2007 SP2 Update Rollup 1 or Exchange 2007 SP2 Update Rollup 2 does not install on a Spanish version of Exchange Server 2007 SP2
  3. 980639 A user can only set the time zone to Bucharest in OWA after you update Exchange Server 2007 Service Pack 1 to Exchange Server 2007 Service Pack 2

Download the rollup here.

Installation Notes:

If you haven’t installed Exchange Server yet, you can use the info at Quicker Exchange installs complete with service packs and rollups to save you some time.

Microsoft Update can’t detect rollups for Exchange 2010 servers that are members of a Database Availability Group (DAG). See the post Installing Exchange 2010 Rollups on DAG Servers for info, and a script, for installing update rollups.

Update Rollups should be applied to Internet facing Client Access Servers before being installed on non-Internet facing Client Access Servers.

If you’re installing the update rollup on Exchange servers that don’t have Internet access, see “Installing Exchange 2007 & 2010 rollups on servers that don’t have Internet access” for some additional steps.

 

Script: New-WelcomeEmail.ps1 – Automatically Sending a ‘Welcome’ Email to All New User Accounts

March 25th, 2010 47 comments

PowerShell-logo-128x84Note: I’ve updated this script to address a couple of issues. The first is that if a scheduled task was configured for a time frame other than what was configured in the script itself, this would yield sporadic results. I’ve addressed this by writing a time stamp to the registry when the script runs. This removed the requirement of configuring the time in the script itself, and provides resiliency if the script runs at different times. Run the script once manually to set the configuration. I’ve also added some code that verifies the Exchange PowerShell snapin is loaded before attempting to run. If you’d like a feature added, please let me know in the comments below.

Note #2: If you’re using a server that’s not configured for the normal U.S. style time-date format, such as in the U.K., see Neil Hobson’s post at http://neilhobson.blogspot.com/2010/11/powershell-bug.html for information.

Anything that we can do to cut down on repetitive calls to the Help Desk staff is a good thing. When a new employee starts, there are always questions about ‘what is my email address?’, and ‘how do I get to email from the web?”. For years, admins have come up with sometimes complicated methods to send a new user a canned email that tries to answer these questions. With Exchange 2007 and Exchange Management Shell (PowerShell), we can do this quite easily. In fact, the hardest part is deciding what to include in the email message. Let’s get started..

Let’s read some info from the registry to see when was the last time the script ran. If it hasn’t run before, let’s set some initial info:

$strScriptName =  $MyInvocation.MyCommand.Name
if (!(Get-ItemProperty HKLM:\Software\Innervation\$strScriptName -Name LastRun -EA SilentlyContinue)){
# this is the first time the script has run - let's create the registry key and value for future runs
New-Item -path HKLM:\Software\Innervation -EA SilentlyContinue | Out-Null
New-Item -path HKLM:\Software\Innervation\$strScriptName | Out-Null
New-ItemProperty -path HKLM:\Software\Innervation\$strScriptName -Name "LastRun" -Value (Get-Date) -propertyType String | Out-Null
write-host "Initial configuration completed." -ForegroundColor green
}
# get time stamp from registry so we know when it last ran
$LastRun = Get-Date ((Get-ItemProperty -path HKLM:\Software\Innervation\$strScriptName -Name LastRun).LastRun)
$ElapsedTime = ((Get-Date) - $lastrun).TotalSeconds

Let’s define some variables that we’ll use throughout the process.

$strMsgFrom = "Contoso HelpDesk "
$strMsgTitle = "Welcome to Contoso!"

These set the From and Title for the email that we’ll send, as well as get today’s date, and the name of the script. Next, we create a new object to allow sending SMTP email:

$SMTPClient = New-Object Net.Mail.SmtpClient("localhost")

We can replace “localhost” with the IP address of a remote hub transport server if the script is not running on a hub transport server.

Next, we get a list of mailboxes that we need to send the email to. We’ll use a scheduled task to actually run the task. I run mine every 4 hours, but the code doesn’t care how often it runs. It will use the time stamp established above to email all mailbox created since then. We also want to avoid any mailboxes that are disabled. So our query looks like this:

$MBXArray = @(Get-Mailbox -ResultSize Unlimited | ? {($_.WhenCreated -gt (Get-Date).AddSeconds(-$ElapsedTime)) -and ($_.ExchangeUserAccountControl -ne "AccountDisabled")})

We now have an array, $MBXArray, that contains all of the mailboxes that we’ll email. We now cycle through the array via ForEach, and begin to assemble a personalized email message to each user. $mailbox holds the current account in the loop, so we can pull specific info for each user. Note that the text in $strBody is completely arbitrary – you can include whatever you want. Here’s a sample of one I did for a recent client:

ForEach ($mailbox in $MBXArray ) {
$strMsgTo = $mailbox.PrimarySMTPAddress
$strMsgBody = "Hello, "+$mailbox.DisplayName+", and welcome to the Contoso family! Please keep this email for future use. It contains vital information.
--------------------------------------
Username and password
--------------------------------------
Your network username is '"+$mailbox.SamAccountName+"'. Use your username and password to login to the network. Your password should NEVER be shared with anyone except the I.T. department, and only then when requested. Please do not write it down on anything that can be seen by your coworkers. You will be prompted to change it regularly.
--------------------------------------
Email
--------------------------------------
Your email address is '"+$mailbox.PrimarySMTPAddress+"'.

To access your email, calendar, contacts, and tasks from outside of the building, such as from home, you can do so from any Internet connected computer. Simply open Internet Explorer and go to the Outlook Web Access (OWA) page at https://mail.contoso.com/ and log in using your username and password. Please note the 's' in https.

If you’d like to have access to your email and contacts from your cell phone, you will need a cell phone that has Windows Mobile 5 or later, or an Apple iPhone. Blackberry phones are not supported. Instructions for configuring your device can be found in the Frequently Asked Questions (FAQ) section of the Contoso Intranet at https://intranet.contoso.com/helpdesk/Lists/SupportFaq/AllItems.aspx
--------------------------------------
Contact information
--------------------------------------
Once you’re situated, please go to http://directory/DirectoryUpdate and update your information. Log in using your username and password. It’s important that you update your information anytime something changes, such as title, department, phone number, etc. This information is used in various systems and applications, and is your responsibility to keep up to date.
--------------------------------------
Computer, Email, and Internet policies
--------------------------------------
Contoso, Inc. provides a computer for your work tasks. The use of personally owned computers and related equipment is not permitted on our network. Additional information about use of Contoso computers, email, Internet, etc. can be found in the Employee Handbook located in the HR section of the intranet at https://intranet.contoso.com/hr/
--------------------------------------
Technical assistance
--------------------------------------
Should you need technical assistance, please check the Frequently Asked Questions (FAQ) section of the Contoso Intranet at https://intranet.contoso.com/helpdesk/Lists/SupportFaq/AllItems.aspx. If you cannot find an answer there, submit a Service Request on the Contoso intranet at https://intranet.contoso.com/helpdesk. If you are unable to access the intranet site, only then should you email HelpDesk@contoso.com. It is monitored by the whole IT department, and will ensure your issue is resolved in a timely manner.

Thank you, and, again, welcome to Contoso!
The Information Technology Department"

As you can see, we insert the user’s actual account name, email address, etc since that info is available in the ForEach loop. The message is just plain text, so spacing is preserved. URLs will be clickable links as well. Note: You’ll want to pay close attention to quotes and variables, as having an extra or missing quote can cause an error.

Now we actually send the message:

$SMTPClient.Send($strMsgFrom,$strMsgTo,$strMsgTitle,$strMsgBody)
}
# update registry here with a fresh time stamp
Set-ItemProperty HKLM:\Software\Innervation\$strScriptName -Name "LastRun" -Value (Get-Date) | Out-Null

We’ll run this script on a hub transport server. So take the script, available in the DOWNLOAD section below, and save it in your \scripts folder. You’ll also need an Exchange receive connector that will accept email sent from PowerShell scripts. For that, see Creating a receive connector to use for sending email from PowerShell. Now, schedule a task to run every 4 hours using the info in Running PowerShell scripts via Scheduled Tasks.

Point of interest: In the text I send to the users, you’ll see a link to the Directory Update (http://directory/DirectoryUpdate in the example above). This is for Directory-Update, a VERY lightweight ASP app developed by fellow MVP and author Jim McBee and another developer. It’s completely customizable, and allows users to update selected fields of their AD account to help keep the Global Address List (GAL) current. It is worth the small cost, and really helps you keep the GAL full of correct info. I have another PowerShell script that checks AD account fields, and when it finds empty fields (phone number, title, etc), it sends them an email with a link to the Directory-Update web page. Combine that with Automatically updating the Global Address List with mobile numbers from Exchange ActiveSync and it’s like a self-cleaning oven!

Installation

Execution Policy: Third-party PowerShell scripts may require that the PowerShell Execution Policy be set to either AllSigned, RemoteSigned, or Unrestricted. The default is Restricted, which prevents scripts – even code signed scripts – from running. For more information about setting your Execution Policy, see Using the Set-ExecutionPolicy Cmdlet.

Donations

I’ve never been one to really solicit donations for my work. My offerings are created because *I* need to solve a problem, and once I do, it makes sense to offer the results of my work to the public. I mean, let’s face it: I can’t be the only one with that particular issue, right? Quite often, to my surprise, I’m asked why I don’t have a “donate” button so people can donate a few bucks. I’ve never really put much thought into it. But those inquiries are coming more often now, so I’m yielding to them. If you’d like to donate, you can send a few bucks via PayPal at https://www.paypal.me/PatRichard. Money collected from that will go to the costs of my website (hosting and domain names), as well as to my home lab.

Download

v1.3 – 02-24-2013 – New-WelcomeEmail.v1.3.zip

Send-NewUserWelcome.zip

ScriptImages.zip – image files used in emails

Changelog

See the changelog for this script for information on versions and what’s included/addressed in each.