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,074 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
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

We are happy to announce a brand new addition to our line of acclaimed email signature management products – CodeTwo Email Signatures for Office 365.
A procedure for exporting installed hotfix details of remote computers using powershell
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…
how to add IIS SMTP to handle application/Scanner relays into office 365.

706 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

16 Experts available now in Live!

Get 1:1 Help Now