Solved

need a quest AD cmdlets or powershell script to delete all conference room bookings made by a terminated employee

Posted on 2014-02-06
11
1,086 Views
Last Modified: 2014-02-11
Hello, can someone provide a script that we can run to check all conference room mailboxes for meetings that were booked by a terminated employee, and delete them.

many thanks!

S.
0
Comment
Question by:siber1
  • 6
  • 4
11 Comments
 
LVL 4

Expert Comment

by:michaelalphi
ID: 39841144
Use "Import-CSV or Get-Content" to read in a list of users then make your search operations inside those loops.
get-mailbox -RecipientTypeDetails RoomMailbox | foreach-object
$room = $_
import-csv blah.csv | foreach-object{

}}

Source : http://social.msdn.microsoft.com/Forums/exchange/en-US/53988536-17f2-4bcf-bdae-f28018b2bd87/clean-up-on-room-mailbox?forum=exchangesvrdevelopment

You can also check this earlier discussed thread with the same concern : http://social.technet.microsoft.com/Forums/exchange/en-US/3343c2af-eefa-4d0a-a55b-3a086f1d898d/room-mailbox-cleanup-by-deleting-the-meetings-made-by-terminated-user-e2010sp2?forum=exchange2010
0
 

Author Comment

by:siber1
ID: 39841826
I googled the exact same sites before I posted my question.  does anyone have an actual script that they have developed that will work for this cleanup?

Subsun do you have a Quest AD Cmdlets script that will work here?

thx - S.
0
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 39843349
Quest commands wont work with mailboxes... You may use Search-Mailbox command from EMS to remove the meetings.. Following code will report the meetings.. If you are getting the correct results then you can use  -DeleteContent switch to delete the contents..
Get-Mailbox -recipienttypedetails roommailbox -resultsize unlimited | 
Search-Mailbox -SearchQuery "kind:calendar and from:Subsun@max.com" -TargetMailbox Admin@max.com -TargetFolder "Deleted Meetings" -LogLevel Full

Open in new window

Ref : http://technet.microsoft.com/en-us/library/dd298173%28v=exchg.150%29.aspx
0
 

Author Closing Comment

by:siber1
ID: 39843411
brilliant Subsun! thanks much!
0
 

Author Comment

by:siber1
ID: 39848964
hi Subsun,

the reference script you provided works great for copying over the messages to a target folder. but it doesn't seem to work with the -deletecontent switch.
0
Why are Office 365 signatures so complicated?

Trying to setup transport rules for Office 365 email signatures and can’t quite figure it out? Having to test the signature over and over? Make things simple by using Exclaimer Cloud - Signatures for Office 365.

 
LVL 40

Expert Comment

by:Subsun
ID: 39849270
What is the error?
0
 

Author Comment

by:siber1
ID: 39849981
hi Subsun,
here is the error I see:

The input object cannot be bound to any parameters for the command either because the command does not take pipeline in
put or the input and its properties do not match any of the parameters that take pipeline input.
    + CategoryInfo          : InvalidArgument: (ConfRoom - Sant...eats, projector:PSObject) [Search-Mailbox], Paramete
   rBindingException
    + FullyQualifiedErrorId : InputObjectNotBound,Search-Mailbox


here is exactly what i'm running:
Get-Mailbox -recipienttypedetails roommailbox -resultsize unlimited | Search-Mailbox -SearchQuery "kind:calendar and from:jsmith@mydomain.com" -TargetMailbox hostmaster@mydomain.com -TargetFolder "Deleted Meetings" -LogLevel Full -DeleteContent

Open in new window

0
 
LVL 40

Expert Comment

by:Subsun
ID: 39850142
You probably don't have permission.. Check Mailbox Import Export Role from following article..
http://technet.microsoft.com/en-us/library/dd638205(v=exchg.150).aspx
0
 

Author Comment

by:siber1
ID: 39850186
hi Subsun,

I've followed that article and added my account to have import/export rights.

however when I run the command I still get the same error:

The input object cannot be bound to any parameters for the command either because the command does not take pipeline in
put or the input and its properties do not match any of the parameters that take pipeline input.
    + CategoryInfo          : InvalidArgument: (ConfRoom - Sant...eats, projector:PSObject) [Search-Mailbox], Paramete
   rBindingException
    + FullyQualifiedErrorId : InputObjectNotBound,Search-Mailbox
0
 

Author Comment

by:siber1
ID: 39850195
subsun, you were right! I just had to restart the exchange mgmt shell afterwards, and it now works.

thank you!!
0
 
LVL 40

Expert Comment

by:Subsun
ID: 39850259
Great!!
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this video we show how to create a Contact in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Contact ta…
how to add IIS SMTP to handle application/Scanner relays into office 365.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now