Skip to main content

Posts

Exchange Where is scripted Instant Message response Bot using LCS and Communicator Web Access (Ajax)

In my pervious post I showed how to create a simple LCS scripted response bot that did something a little bit boring such as tell you what day it is. Presence technology is something that’s changing and growing all the time the Outlook integration of the Office 2005 communicator is one example. The script is partially inspired by this but I decided to see if I could push the limits when it comes to privacy and the presence type information that is available to system administrators that you may not think normally about using. So what does this bot do ? The bot allows you to ask it the question where is fred@domain.com. It then takes this information and does the following First it queries the calendar to see if they are currently in an appointment and creates a response that shows details of the appointment a person may currently be attending and the location that appointment is and what time it started and finished. It also sends a full list of their calendar appointments over the ne...

Simple scripted Instant Message response Bot using LCS and Communicator Web Access (Ajax)

Continuing on from the other week I’ve been playing around further with the new Ajax interface for LCS communicator web access. Response bots are not only a lot of fun to play around with but can be a practical way of getting a little bit more out of an Instant messaging system. Like the send message script this script works by using the browser object to post and get data to the LCS Communicator Web Access server. The script is a little crude in some aspects for some reason the XML returned from LCS does seem to parse well so I’ve used a cruder text parse method to interpret the server responses. I have really only tested this in one environment so this logic may fall down in other environments where there are some differing variables. The first section of the script logs on to the web access server using NTLM over https and most importantly retrieves the latestupdate id which must be posted with every request to the server. The reasons why you need to do this and how the timeouts wor...

Removing Disabled Users from Distribution lists via a script

One thing that I seem to do with monotonous regularity is disable user accounts as people churn though the companies that I work for. Usually once an account is disabled the chances of it being re-enabled while possible are always slim. One of the things that mostly gets forgotten when disabling an account is to also remove it from any distribution lists that account maybe in. Now with the new hot-fix this is not as much of a problem because a disabled mailbox can now be configured to still receive email. However it is still desirable for these disabled accounts not to be receiving email from distribution lists. Instead of going though each disabled user to work out if it’s a member of any distribution list and then remove it I decided to create a script that would fist let me list all the disable users that are in a distribution lists and also have an option so it will remove these users from that group. For the script itself I’ve used ADSI and the ADO data shaping provider again. As ...

Sending an Instant Message via Script using LCS and Communicator Web Access (Ajax)

Its been some time since I had a chance to play around with any LCS code I saw the release of the AJAX SDK so I decided to have a bit of read and see if I could put together a few bits of code. If you’re comfortable writing WebDAV code you’ll feel at home with Ajax its just a matter of posting and getting data via a Http control. Starting real easy I thought I’d try a simple VBS script to send a message from the command line. The script itself is fairly basic it uses NTLM authentication to first logon to a LCS server using the Logon URL. After it logs on successfully you need to get the cookie for the session which is used when calling any further functions. To send a message the StartIm method is used which basically tries to start an IMSession along with sending a message. The last section of code then calls the logoff URL. Before you run the script you need to configure the hardcoded variables in the config section basically you need to put in the name of the LCS CWA server Servern...

Displaying the Junk-Email setting of all users on a Server (Exchange 2003)

I got a good question this week about one of my previous posts about displaying and setting junk Email setting on Exchange 2003. What this person wanted to do was display the junkemail setting of all users on a server so they could see who had enabled junk email filtering in OWA. This was a good idea which I thought could be expended a little further an also include reporting on the junk email settings from Outlook 2003 as well. So what I’ve done is put together a script that creates a CSV file that shows you firstly weather the Extended Junk Email rule has been created in a mailbox, If junk email filtering is enabled in OWA, what level junk email filter has been set to in Outlook 2003 and what the delete setting is set to in Outlook 2003. What you end up with is a pretty useful little report on how people are using the Junk Email filtering setting in Outlook and OWA on your server. I’ve created two versions of the script the first is a WebDAV version which can be run locally or remot...

Replicating an Exchange Folder using WebDAV Replication and CDO 1.2

One of the lesser know and cooler (well I think) features of WebDAV with Exchange is the ability to perform replication of a collection (or a folder). The Exchange SDK has some documentation on how this works and the general plumbing of how you structure requests and responses. Previously I had a script that would copy contacts between a public folder and mailbox this was a pretty simple script with no intelligence so it would produce duplicates if it was run twice etc. I wanted something that would go a little further then this script and allow full one way sync of a private contacts folder with a public contacts folder so basically a script that could be run at intervals and any updates to the private contacts folder such as changes of email addresses, phone number, addition of contacts or deletion of contacts would be reflected in the public contacts folder. For this combining the original CDO 1.2 script to copy contacts (the reason that CDO is used to do the copy instead of WebDAV...

Using Monad to query an Exchange Mailbox via WebDAV to display Unread Emails

I’ve had a chance this week to play around a bit more with MSH and the .NET 2.0 framework and thought I’d share this sample that uses the .net framework to query an Exchange mailbox via WebDAV to display the number of unread email in a mailbox and the subject of the unread email. One of the good things with monad is that you can use both Com and .NET objects pretty easy so all the Microsoft.http browser object stuff will still work but its better to use the new stuff whenever you can. Vivek and Lee Holmes have come up with a good sample of doing a http get using Monad. This helped along with the basic .NET sample from the Exchange SDK in coming up with a simple script that queries an Exchange mailbox using the currently logged on users credentials for any email that is unread. The query itself is a simple WebDAV search that looks for any mail in the inbox folder where the urn:schemas:httpmail:read property is false. The script itself takes two command-line parameters which is the ser...
All sample scripts and source code is provided by for illustrative purposes only. All examples are untested in different environments and therefore, I cannot guarantee or imply reliability, serviceability, or function of these programs.

All code contained herein is provided to you "AS IS" without any warranties of any kind. The implied warranties of non-infringement, merchantability and fitness for a particular purpose are expressly disclaimed.