Le Café Central de DeVa
let.us.develop.share.messaging.more... DeVa blogs!!
I changed the way of blogging. Re-designed the site & started using the latest Windows Live Writer 2011!! Additionally added Microsoft Translator gadget available @ top of page, so that you can change the page in your preferred language!!
Hi, I am Deva working with Microsoft Dev. Messaging & Collaboration team.
This blog will assist developers who design/develop custom applications using Microsoft Messaging libraries. I will try to touch base other developer related info too.
Let us talk.develop.messaging.share.more.
Now Bing Search API is available on the Windows Azure Marketplace! Starting today, you can sign up in the Marketplace to access web, image, news, and video search results, as well as related searches and spelling suggestions using JSON or XML. As a one stop shop for cloud data, apps, and services, the Windows Azure Marketplace provides opportunities to access hundreds of other datasets and distribute your applications. In transitioning, the Search API is able to serve more relevant and up-to-date results. You can more info @ http://www.bing.com/community/site_blogs/b/developer/archive/2012/05/17/bing-developer-update-2.aspx
The above query is a common one that we receive from our customers. Have a look at our support KB regarding this (specific to US English version only) http://support.microsoft.com/kb/2625547 . This article provides a comprehensive list of the most recent hotfix updates and service packs for Microsoft Outlook. Some Outlook features are dependent on Microsoft Word and Microsoft Office components. Therefore, you should also install the latest updates for the Word and Office core components. The above article is applicable to Outlook 2003, Outlook 2007 and Outlook 2010. Also, the above article will be updated to reference new updates as they are released. Note: You can visit the Update Center for Microsoft Office (http://technet.microsoft.com/en-us/office/ee748587.aspx) to find links to the most recent cumulative and public updates for Microsoft Office.
Happy updating!!
One of my customer automated Exchange PowerShell with his .Net application. They had a requirement to enhance the functionality – to get the list of exchange mailboxes, folders and its sub folders, items in folder, foldersize. Finally it needs to be saved in .csv format. To implement this, we used Get-Mailbox and Get-MailboxFolderStatistics Exchange cmdlets. For looping the objects, we used foreach-object and couple of pipes to achieve the goal.
PowerShell (screenshot):
PowerShell (script) – adding for your reference:
[PS] C:\Documents and Settings\Administrator>Get-Mailbox | Select-Object alias | foreach-object {Get-MailboxFolderStatistics -Identity $_.alias | select-object Identity, ItemsInFolder, FolderSize} | Export-csv c:\Stats.csv -NoTypeInformation
Result:
As you know you can automate your application using .Net programmatically by referring the following articles:http://msdn.microsoft.com/en-us/library/bb332449(v=exchg.80).aspx and http://msdn.microsoft.com/en-us/library/ff326159(v=exchg.140).aspx.
Happy programming!!
In this post, we will have a look at the Calendar Checking tool (Calcheck) for Outlook which is published recently by Randy. This program checks the Microsoft Outlook Calendar and items for problems or for potential problems. It's is a command-line program that checks Outlook Calendars for problems. To use this tool, the Outlook calendar must reside on a Microsoft Exchange Server.
Note: The tool does not work with IMAP, with POP3, or with other non-Exchange mail servers.
The tool opens an Outlook profile, opens the Outlook Calendar, and then checks several things such as permissions, free/busy publishing, and auto booking. Then, the tool checks each item in the calendar folder for problems that can cause items to seem to be missing or that might otherwise cause problems in the Calendar.
It can be used with the following: Outlook 2003, 2007, 2010 and Exchange Server 2003, 2007, 2010.
To install this download:
1.Click the Download button on this page to download the file and save it to your computer. 2.Unzip the compressed file that you downloaded in a blank directory on your computer. Instructions for how to use this tool:
After you install this download, open a Command Prompt window in the directory that contains the CalCheck.exe file. To obtain detailed instructions, type the calcheck /? command in the Command Prompt window, and then press Enter.
Usage: Here is a list of command-line switches for CalCheck.exe:
CalCheck [-P <Profile name>] [-M <Mailbox name>] [-S <Server name>] [-O<path>] [-A] [-F] [-R] [-V] [-No] CalCheck -?
-P Profile name (If this parameter is not specified, the tool prompts you for a profile) -M Mailbox DN (If this parameter is specified, only process the mailbox that is specified) -S Server name (Process the complete server unless a mailbox is specified) -O Output path (path to place output files -default is the current directory) -A All calendar items are output to CALCHECK.CSV -F Create a CalCheck folder, and move flagged error items to the folder -R Put a Report message that contains the CalCheck.log file in the Inbox -V Verbose output to the Command Prompt window -No To omit a calendar item test The No parameter works with "org" to omit the “Attendee becomes Organizer” test and works with "dup" to omit duplicate item detection -? Print this message
To remove this download: To remove CalCheck, delete the directory where it is installed on the hard disk.
Download: You can download the utility in two flavors - CalCheckX64, CalCheckX86. You can download it from http://www.microsoft.com/en-us/download/details.aspx?id=28786&WT.mc_id=rss_office_allproducts
What the utility does & what you will see in the report?
When you try the Calcheck.exe, the following Calendar-specific checks are performed and logged in the report:
The following item-level checks are performed and logged in the report:
Note: If you have a problem with CalCheck - you can post information about it on http://calcheck.codeplex.com/workitem/list/basic
In this post, I will show you how to make use of usemap attribute of img HTML element in HTML emails programmatically. For this, I used Outlook 2010 VBA & Outlook Object Model. You can design the application with C# or VB.Net with Outlook Object Model library as per your wish.
We will do this exercise in two steps:
First, we need to set the Bodyformat of the message as olFormatHTML Second, at the Message body we need to include the usemap attribute with img HTML element.
Here is the code snippet that I tried:
1: ...
2: Dim str As String
3: Dim newMSG As Outlook.MailItem
4:
5: Set newMSG = Application.CreateItem(0)
6: newMSG.To = Session.CreateRecipient("test@testexchange.com")
7: newMSG.Subject = "Test message"
8: newMSG.BodyFormat = olFormatHTML
9: newMSG.Body = "start Body here. "
10: newMSG.Body = newMSG.Body & " Add more text."
11:
12: str = "<html> <body> <p>Click the logo:</p>"
13: str = str & " <img src='http://www.microsoft.com/presspass/imagegallery/images/products/office/office2010/MS_Office_w_2010_vertical_web.jpg' width=200 height=200 alt='Sites' usemap='#sitesmap' />"
14: str = str & " <map name='sitesmap'> <area shape='rect' coords='0,0,82,126' alt='Bing' href='http://www.bing.com'/>"
15: str = str & " <area shape='circle' coords='0,90,58,3' href='www.microsoft.com' alt='Microsoft'/>"
16: str = str & "</map> </body> </html>"
17:
18: newMSG.HTMLBody = str
19: newMSG.Save
20: 'newMSG.Send
21: newMSG.Display
22: ...
Once you’re done, try run the above sample – you’ll see the below results whenever you move to cursor to the above co-ordinates.
In my earlier article, we learnt how to get the Exchange Server version, version/build number of Exchange 2003 and it’s earlier. In this, we will see how to get these info & couple of additional info in Exchange Server 2007/2010 using Exchange Management Shell and Exchange Management Console.
Using Exchange Management Console:
To view the server properties in the Exchange Management console, try the following steps:
1.Start the Microsoft Exchange Management console. In the navigation pane, expand the Server Configuration objects until you locate the server object, and then select the server object. 2.On the right side, notice the Exchange version number.
Using Exchange Management Shell:
For this, I used Get-ExchangeServer cmdlet to view the server properties in Exchange Management Shell:
I want to save the above info in a .txt file (saved under c:\output.txt):
Now, I want to customize the above one by the following to get more clarity:
Still I want to add more info like Site, Server Role and Edition etc..
Hope this helps you to move ahead.
In Exchange Server 2007/2010, you can use Exchange PowerShell cmdlets (especially using Get-Mailbox, Get-MailboxPermission, Get-ADPermission, Get-MailboxFolderPermission) to get a verity of info. I played with couple of the below in different scenarios and want to share the same with you – so that you can give a shot and make use of.
Scenario # 1: How to query permissions on a mailbox (testuser1)? > Get-MailboxPermission test1
Scenario #2: How to query permissions of all the mailboxes on a particular server? > Get-Mailbox –Server “ServerName” | Get-MailboxPermission
Scenario #3: How to query permissions of all the mailboxes? > Get-Mailbox | Get-MailboxPermission Note: This will get the list of all permissions (including SELF permissions and inherited permissions)
Scenario # 4: How to query permissions of all the mailboxes (filter out SELF and inherited permissions)? > Get-Mailbox | Get-MailboxPermission | where {$_.user.tostring() -ne "NT AUTHORITY\SELF" -and $_.IsInherited -eq $false}
Scenario #5: How to query mailbox permissions and Security permissions (only enumerate permissions that are not Inherited)? > Get-Mailbox | Get-MailboxPermission | where {$_.IsInherited -eq $False} Note: The above query will get you the “explicitly assigned permissions”
Scenario #6: How to query the explicitly assigned permissions (filter out SELF permissions)? > Get-Mailbox | Get-MailboxPermission | where { ($_.IsInherited -eq $false) -and -not ($_.User -like “NT AUTHORITY\SELF”) }
Scenario #7: How to query list of all mailboxes with Send-As permission assigned on them? > Get-Mailbox | Get-ADPermission | where {($_.ExtendedRights -like “*Send-As*”)} | FT –Wrap Note: This will get the list of mailboxes with Send-As permission assigned. Also you can notice that it shows Send-As permissions assigned to SELF on all mailboxes also.
Scenario #8: How to query list of all mailboxes with Send-As permission assigned on them (filter out SELF and inherited permissions as similar to Scenario #4)? > Get-Mailbox | Get-ADPermission | where {($_.ExtendedRights -like “*Send-As*”) -and ($_.IsInherited -eq $false) -and -not ($_.User -like “NT AUTHORITY\SELF”)} | FT –Wrap
Scenario #9: How to query the permissions of shared calendar in Exchange 2010? > Get-MailboxFolderPermission –identity “mailboxaccount*:\Calendar” Note: If you just try Get-MailboxFolderPermission with identity with mailboxaccount won’t get you the above.
Scenario #10: How to query the users rights to a specific users mailbox? > Get-MailboxPermission –identity “username” | fl user, accessrights
Scenario #11: How to query the permissions for every users mailbox? > Get-MailboxPermission –identity * | fl user, identity, accessrights
Note: + Exporting the data: At anypoint of time, if you want to export the above results to a CSV file, then you can use “Export-csv”. Say, let we try with one of the above scenario – try with scenario # 2: > Get-Mailbox | Get-MailboxPermission | Export-csv C:\permissions.csv
+ Automation using .Net Framework: If you want to like to add Exchange management capabilities to your Microsoft .NET Framework–based applications then you can try the above by referring the following: http://msdn.microsoft.com/en-us/library/bb332449(v=exchg.80).aspx and http://msdn.microsoft.com/en-us/library/ff326159(v=exchg.140).aspx.
Happy PowerShelling and automation…!!
·To remove retention policy from Outlook:
When you remove a retention policy from an email message, the folder policy applies to the item, if one is assigned.
1. In the message list, click a message. (To select more than one message, press and hold CTRL as you click each message.)
2. On the Home tab, in the Tags group, click Assign Policy.
3. Under Retention Policy, click Use Folder Policy.
Note: The retention policy for a message appears in the header in the Reading Pane under the recipient names and includes the expiration date. If no retention policy is applied, no information appears under the message recipient names.
From Exchange: You can use the following exchange cmdlet: http://technet.microsoft.com/en-us/library/dd297962.aspx. Please note that the retention policies are used to apply message retention settings to folders and items in a mailbox.
The below cmdlet removes an existing retention policy "Business Critical", which is assigned to users, and suppresses the confirmation prompt.
> Remove-RetentionPolicy -Identity "Business Critical" -Confirm:$false -Force
In this post we will see how to assign a web page to a specific Outlook folder programmatically using C# and Outlook Object Model. For this I tried the following sample, which checks for a folder named “HtmlView” in Microsoft Office Outlook. If the folder does not exist, the code creates the folder and assigns a Web page to it. If the folder exists, the code displays the folder contents.
The following sample is written using C#.Net, Visual Studio 2010 and Outlook 2010 (Outlook Object Model API).
Code snippet:
1: //Microsoft.Office.Interop.Outlook._Application
2: // Create an Outlook application.
3: Outlook._Application oApp = new Outlook.Application();
5: // Get the MAPI NameSpace and Logon values.
6: Outlook._NameSpace oNS = (Outlook._NameSpace)oApp.GetNamespace("MAPI");
7: oNS.Logon(Missing.Value, Missing.Value, true, true);
8:
9: //Assign a Web page with a specific Outlook folder
10: Outlook.MAPIFolder newView = null;
11: string viewName = "HtmlView";
12: Outlook.MAPIFolder inBox = (Outlook.MAPIFolder) oApp.ActiveExplorer().Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);
13: Outlook.Folders searchFolders = (Outlook.Folders)inBox.Folders;
14: bool foundView = false;
15:
16: foreach (Outlook.MAPIFolder searchFolder in searchFolders)
17: {
18: if (searchFolder.Name == viewName)
19: {
20: newView = inBox.Folders[viewName];
21: foundView = true;
22: }
23: }
24:
25: if (!foundView)
26: {
27: newView = (Outlook.MAPIFolder)inBox.Folders. Add("HtmlView", Outlook.OlDefaultFolders.olFolderInbox);
28: newView.WebViewURL = "http://www.microsoft.com";
29: newView.WebViewOn = true;
30: }
31:
32: oApp.ActiveExplorer().SelectFolder(newView);
33: oApp.ActiveExplorer().CurrentFolder.Display();
Run the sample and you will see the following output in Outlook: