Go Premium for a chance to win a PS4. Enter to Win

x
?
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
Medium Priority
?
1,186 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 2000 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
Ready for your healthcare security check-up?

In the past few years, healthcare organizations have become a prime target for advanced attacks. Does your organization have what it needs to defend itself? Schedule your healthcare security check-up today and download our free Healthcare Security Resource Kit today!

 

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
 
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

Ready for your healthcare security check-up?

In the past few years, healthcare organizations have become a prime target for advanced attacks. Does your organization have what it needs to defend itself? Schedule your healthcare security check-up today and download our free Healthcare Security Resource Kit today!

Question has a verified solution.

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

A walk-through example of how to obtain and apply new DID phone numbers to your cloud PBX enabled users that are configured in Office 365. Whether you have 1, 10 or 100+ users in your tenant, it's quite easy to get them phone-enabled and making/rece…
If you have come across a situation where you need to find some EDB mailbox recovery techniques, then here you will find the same. In this article, we will take you through three techniques using which you will be able to perform EDB recovery. You …
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
Loops Section Overview

916 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