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,149 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

A hard and fast method for reducing Active Directory Administrators members.
This article will help to fix the below error for MS Exchange server 2010 I. Out Of office not working II. Certificate error "name on the security certificate is invalid or does not match the name of the site" III. Make Internal URLs and External…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
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
Suggested Courses

624 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