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,138 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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 

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

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

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

This article demonstrates probably the easiest way to configure domain-wide tier isolation within Active Directory. If you do not know tier isolation read https://technet.microsoft.com/en-us/windows-server-docs/security/securing-privileged-access/s…
Auditing domain password hashes is a commonly overlooked but critical requirement to ensuring secure passwords practices are followed. Methods exist to extract hashes directly for a live domain however this article describes a process to extract u…
how to add IIS SMTP to handle application/Scanner relays into office 365.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

752 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