5

Is it possible to create a PowerShell script that will go into a mailbox (specifically for a meeting room), find all it's meeting requests and accept them?

We've implemented a new mechanism in our exchange environment so that requests sent to meeting rooms will be auto-accepted if the room is available, but there are a lot of old requests (especially recurring meetings) that were sent before this change that are marked as tentative. This is a problem because when a new request is sent for a time that is marked as tentative, it will accept the request, which is leading to some conflicts.

1
  • I'm not aware of any PowerShell cmdlets that do this, so you may be in EWS territory and have to write a program to do this. Aug 25, 2011 at 21:14

3 Answers 3

4

I'm a little late to the party; I imagine you're probably past this issue by now, but I just read this question today and thought it would be a fun exercise so here is the answer to your question. This bit of Powershell will log in to a Mailbox using the Outlook client, go through the Inbox and automatically accept any meeting invites. You can obviously tweak the code to be more to your liking (such as logging in to a different mailbox) but this would definitely get you started if you were still interested:

[Reflection.Assembly]::LoadWithPartialname("Microsoft.Office.Interop.Outlook") | Out-Null
$Folders = "Microsoft.Office.Interop.Outlook.OlDefaultFolders" -As [Type]
$Outlook = New-Object -ComObject Outlook.Application
$Namespace = $Outlook.GetNameSpace("MAPI")
$Inbox = $Namespace.getDefaultFolder($Folders::olFolderInbox)
ForEach ($_ In $Inbox.Items)
{
    If ($_.MessageClass -eq "IPM.Schedule.Meeting.Request") 
    {
        $AppointmentItem = $_.GetAssociatedAppointment($true)       
        $Response = $AppointmentItem.Respond(3,$True,$False)
        $Response.Send()
    }
}
0

Having just thumbed through all of the exchange cmd-lets, I can say I saw nothing that even touches appointments. I'm afraid you'll have to write it from .NET code, or go through by hand.

2
  • Writing a program up in .NET is an option, but what APIs would I be looking at?
    – Evan M.
    Aug 26, 2011 at 13:23
  • @EvanM For that, I wouldn't know. StackOverflow may be better for that.
    – sysadmin1138
    Aug 26, 2011 at 14:10
0

What version of exchange are you running ? Exchange 2007 has a tool called Calendar Concierge

Ex2010 has Auto Accept Agent.

What you are requesting is already baked into Exchange

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.