Showing posts with label Exchange 2007. Show all posts
Showing posts with label Exchange 2007. Show all posts

Wednesday, August 4, 2010

Exchange: Outlook and OWA attachment issues

Outlook client does not display attachments

There are a number of reasons why this might be the case.
  • See http://knicksmith.blogspot.com/2007/03/exchange-2007-and-outlook-2003-where.html. An issue was resolved by Microsoft in Exchange 2003 Service Pack 1 where Exchange 2007 was incorrectly causing Outlook 2003 to hide inline attachments. Even though you could not see the attachment, if you flagged the email, or clicked forward on the email, the attachment would appear correctly. Also if you selected Save attachments from the file menu, it would still save the attachments. OWA is not affected by this.
  • See http://social.technet.microsoft.com/Forums/en-US/exchangesvrclients/thread/478c326b-486b-461c-9141-dd544b245c75. Symptoms: You can see the attachment in OWA but not in any of the current versions of Outlook. Outlook blocks the attachment completely and there is no way to retrieve it through this interface. This is also more likely to happen when an inhouse application has been programmed to send email with attachments. if the MIME is formatted incorrectly then Outlook will not display it. RFC 2387 describes the intended use of multipart/related:
    http://www.ietf.org/rfc/rfc2387.txt:
    "The Multipart/Related media type is intended for compound objects consisting of several inter-related body parts. For a Multipart/Related object, proper display cannot be achieved by individually displaying the constituent body parts."
    Steps to resolve this issue involve changing the MIME header to Multipart/Mixed instead of Multipart/Related. Multipart/Related will cause the attachment to be considered inline by Outlook. As there is no reference to the attachment in the body, it will then effectively be ignored. OWA has more smarts and is able to determine if an attachment is really inline or not. If it finds no reference to the attachment in the body of the email then it displays the attachment as a separate entity.


Friday, July 2, 2010

Outlook 2007: Outlook prompting for password issue

Symptoms: Outlook 2007 clients are prompting for password when connecting to Exchange 2007.

Possible solutions if affecting single users:

  • Open the profile settings and make sure there is no checkbox in "Always prompt for user name and password" on the Security tab
  • Check credential manager. It may be storing an incorrect password for the user and Outlook may be using this to connect to Exchange. Run control userpasswords2. On the Advanced tab, select "Manage Passwords". Remove any entries to the Exchange server. Alternatively, erase the server name and enter "S1" or the simple name of your global catalog server and leave the password blank. If prompted again, enter your username and password and check off "remember my password" one last time and it should not prompt again.
  • Try typing in the username by including the domain name. i.e. DOMAINNAME\Username. This has been known to resolve the issue.
  • In the task tray, hold down CTRL Key and right click the Outlook icon and select Test Email Auto Configuration. Uncheck Use Guessmart and Secure Guessmart Authentication. Click Test. When the test is completed, view the XML results.
  • Check that the autodiscover URLs are in the proxy exceptions list.
  • Open the following path: In Vista: \Users\YourUserName\AppData\Roaming\Microsoft Once open you will see numerous folders including a “protect” folder. Delete the “protect” folder. When you have deleted the protect folder, restart Outlook. You will be requested to enter your password again, but it will be the last time.
    Check that an Internet security product is not blocking a port.

Possible solutions if affecting a large number of people:



  • Open IIS on theExchange server and checked the following directories under the default website: the root site, oab, autodiscover. Under the directory security tab, click Edit in the Secure Communications section. If you have "require SSL" checked and the 128 bit encryption, but under Client Certificates, it is set to ignore, then this may be the problem. Change this to "Accept" for each of the folders and restart IIS. This may not be a satisfactory solution for everyone.
  • Try to connect to the autodiscover URLs listed in the SCP and in Exchange Management Console.
  • Make sure the OABurl is set to https and not http
  • In the task tray, hold down CTRL Key and right click the Outlook icon and select Test Email Auto Configuration. Uncheck Use Guessmart and Secure Guessmart Authentication. Click Test. When the test is completed, view the XML results. If the URL for the OAB is starting with HTTP instead of HTTPS then you may need to change this from the Exchange Management Console. Do an iisreset and test again.
    Make sure integrated security is enabled on the virtual directories where required.
  • Ensure Offline Address Book has been migrated to Exchange 2007.
  • Look at the properties of the autodiscover virtual directory and ensure a version of ASP is selected. If none is selected, clients may be prompted for password.
  • Ensure Windows authentication is enabled on the Autodiscover virtual directory.
  • See http://support.microsoft.com/kb/236032

If the problem exists when using RPC over HTTP:

If you are working RPC over https you are using or basic, or NTLM authentication, you need to be sure you are working NTLM. Now in order to ensure that outlook not uses any cached password we need to do the following. Go to Control Panel>User AcountsPress on Advanced Tab button. Click on Manage Passwords button. Review stored passwords , and if you see IP address of your mail server you should delete it.
Now we need to patch te registry
Click StartRun
Type regedit and press enter
Go to HKLM\SYSTEM\CurrentControlSet\Control\Lsa\
Find lmcompatibilitylevel DWORD parameter
Double-click on it and change its value to 3

Friday, June 11, 2010

PowerShell: Exchange 2007: Create Mail Enabled Contacts from a Spreadsheet

Script is below. This script can be modified to work with almost anything. What it demonstrates is reading from a spreadsheet and enacting commands against the data.

Script follows: -


#Fields contained in spreadsheet:
#FirstName LastName FullName JobTitle Division BU Department StreetAddress Suburb State
#PostCode Country Telephone Mobile Fax UserID Password Email PerkinsEmail
#HomMailServer AccountType ErrorCount ErrorMessages


#
#
$LIST=IMPORT-CSV C:\BULKUPDATE.CSV
#
# Go through EACH item in the list (Header row is treated as variable names by default)
#
FOREACH ($USER in $LIST) {
#
#
$Firstname=$USER.Firstname
$Lastname=$USER.Lastname + " (Perkins)"
$Fullname=$USER.FullName + " (Perkins)"
$BU=$USER.BU
$USERID=$USER.USERID
$ForwardingAddress=$USER.PerkinsEmail


write-Host
write-Host "Full name: " $FullName
write-Host "Firstname: " $Firstname
write-Host "UserID: " $UserID
write-Host "Forwarding address: " $ForwardingAddress
write-Host

Write-Host "Press the c key to continue to create a contact with the above variables"
$x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
if ($x.Character -ne "c")
{
write-Host $x.Character
exit
}
#
#
# Enter your commands here that will work with the variables above.
New-MailContact -Name $Fullname -DisplayName $FullName -FirstName $Firstname -LastName $Lastname -Alias $UserID -ExternalEmailAddress $ForwardingAddress -OrganizationalUnit "User-Contacts-Imported" | Set-MailContact -HiddenFromAddressListsEnabled $true

#
#
}



Other commands that have proven useful with this routine are: -
  • GET-USER $MailboxUserName | SET-MAILBOX -ForwardingAddress $ForwardingAddress

Here is another sample script which creates resource mailboxes and turns off the autoaccept agent. This is good for resource mailboxes where the users want to directly update the calendar. Note: It is not best practice to update calendars directly however this is what some people like.


#
#
$LIST=IMPORT-CSV C:\TAGPFIMPORT2.CSV
#
# Go through EACH item in the list (Header row is treated as variable names by default)
#
FOREACH ($USER in $LIST) {

$MailboxName=$USER.MailboxName
$Alias=$USER.Alias
$UPN=$Alias + "@tollgroup.local"
$ResourceType=$USER.ResourceType
$Database=$USER.Database
$OUName=$USER.OU
$Database=$USER.Database
$ResourceAdmin1=$USER.ResourceAdmin1
$ResourceAdmin2=$USER.ResourceAdmin2
$ResourceAdmin3=$USER.ResourceAdmin3
$AutomateProcessing=$USER.AutomateProcessing
$DeleteNonCalendarItems=[System.Convert]::ToBoolean($USER.DeleteNonCalendarItems)

write-Host
write-Host "Mailbox name: " $MailboxName
write-Host "UPN: " $UPN
write-Host "Resource Type: " $ResourceType
write-Host "ResourceAdmin1: " $ResourceAdmin1
write-Host "ResourceAdmin2: " $ResourceAdmin2
write-Host "ResourceAdmin3: " $ResourceAdmin3
write-Host "AutomateProcessing: " $AutomateProcessing
write-Host "DeleteNonCalendarItems: " $DeleteNonCalendarItems
write-Host "Database: " $Database
write-Host "OU: " $OUName
write-Host

Write-Host "Press the c key to continue to create a resource mailbox with the above variables"
$x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
if ($x.Character -ne "c")
{
write-Host $x.Character
exit
}
#
#
# Enter your commands here that will work with the variables above.
write-Host New-Mailbox -UserPrincipalName $UPN -database $Database -Name $MailboxName -OrganizationalUnit $OUName -DisplayName $MailboxName -ResetPasswordOnNextLogon $TRUE Set-Mailbox -Type $ResourceType
New-Mailbox -UserPrincipalName $UPN -database $Database -Name $MailboxName -OrganizationalUnit $OUName -DisplayName $MailboxName -ResetPasswordOnNextLogon $TRUE Set-Mailbox -Type $ResourceType

Get-Mailbox $MailboxName Add-MailboxPermission -AccessRights FullAccess -User $ResourceAdmin1
Get-Mailbox $MailboxName Add-MailboxPermission -AccessRights FullAccess -User $ResourceAdmin2
Get-Mailbox $MailboxName Add-MailboxPermission -AccessRights FullAccess -User $ResourceAdmin3
write-host SET-MAILBOXCALENDARSETTINGS $MailboxName -AutomateProcessing $AutomateProcessing -DeleteNonCalendarItems $DeleteNonCalendarItems

SET-MAILBOXCALENDARSETTINGS $MailboxName -AutomateProcessing $AutomateProcessing -DeleteNonCalendarItems $DeleteNonCalendarItems


}

Thursday, May 27, 2010

Excel 2007: Date formats

Ever tried copying dates into Excel, to have Excel refuse to format them as a date?

If you press F2 on the cell containing the date and press enter, it may then update to the format, but what if you have a 1000 dates to update?

Well, you could always record a Macro that does ActiveCell.Value = ActiveCell.Value and then moves to the next line to do the same thing. However there is a "bug" with this. Excel VBA will always interpret dates as a US format, unless it encounters a date that cannot be US e.g. 25/12/2005, in which case it will interpret it as dd/mm/yyyy. Ouch!

Solution:
1. Set an empty cell to the date format that you require.
2. Set the cells containing the dates to the date format that you require.
3. Copy the empty cell, and "Paste Special" over the cells containing dates. Select "All" and "Add" then click OK.

Thursday, May 20, 2010

Exchange 2007: Remove and add public folder permissions recursively

When adding permissions to public folders in Exchange 2007, if one of the permissions to be assigned already exists, it will throw an error and not work. To work around this, you can remove the permissions for the user and then add back in the correct permissions.

a) Remove permissions recursively for anonymous

get-publicfolder \PublicFolder1\Airport -recurse | Get-PublicFolderClientPermission -user anonymous | remove-publicfolderclientpermission -confirm:$false


b) Remove permissions recursively for default

get-publicfolder \PublicFolder1\Airport -recurse | Get-PublicFolderClientPermission -user default | remove-publicfolderclientpermission -confirm:$false


c) Add permissions recursively for default

get-publicfolder \PublicFolder1\Airport -recurse | add-publicfolderclientpermission -user Default -AccessRight PublishingEditor

Exchange 2007: Report on Exchange statistics in Exchange 2007

a)
Get-MailboxServer | where {$._Name -Like "*EX*"} | Get-Mailbox | export-csv -Path C:\Mailboxes.csv

b)
Get-MailboxServer | where {$._Name -Like "*EX*"} | Get-Mailbox | Get-User | export-csv -Path C:\MailboxADProperties.csv

c)
Get-MailboxServer | where {$_.Name -Like "*EX*"} | get-mailboxstatistics | export-csv -Path C:\Mailboxstat.csv

Use Excel to match up the results of a) and b) and c).

There is apparently a way to do all this matchup in Powershell but I haven't looked into these options yet. One such suggestion on a forum was:

Get-Mailbox MBXName | Select-Object name,primarysmtpaddress, DisplayName,Database,@{n="Size(MB)";e = {$MBXstat = Get-MailboxStatistics $_.name; $MBXstat.totalItemsize.value.toMB()}},@{n="Items"; e = {$MBXstat = Get-MailboxStatistics $_.name ; $MBXstat.itemcount}}

Friday, May 14, 2010

Exchange: Check if email addresses are or are not on a mailbox in Exchange 2007

These scripts check whether a mailbox does or does not contain an email address. This is a great way to find out which mailbox in an organisation contains a certain email address.

Check if an email address is on a mailbox:

get-mailbox | where {$_.EmailAddresses -like "*@emailaddress.com"}

Check if an email address is NOT on a mailbox:
get-mailbox | where {-not ($_.EmailAddresses -like "*@emailaddress.com")}

Another way to check that an email address is not on a mailbox is to cycle through the EmailAddresses array:
Get-Mailbox | foreach {
For ($i=0;$i –lt $_.EmailAddresses.Count;$i++)
{
$address = $_.EmailAddresses[$i]
If($address.SmtpAddress –like "*@test.com")
{
Write-Host $_.Name
Break
}
}
}