Tag Archives: Powershell

Powershell 3.0 – Out-GridView

Aldığınız komut çıkatılarını interaktive tablo halinde görmek ve filtrelemek istiyorsanız Out-gridview komutunu kullanabilirsiniz.  image

Benim favori komutumdur. Basit kriterler yaratarak istediğiniz aramayı çok kolay yapabilirsiniz.

Aşağıda örnekler mevcuttur

Read More …

Powershell ile Exchange sunucuda kullanıcıların alınan/gönderilen mail istatistiğini almak

Bazen yöneticinizden “Şirketimizdeki tüm kullanıcıların son bir ayda kaç adet email alıp/göndermiş” gibi bir isteğiyle karşılaşarbilirsiniz.

Aşağıdaki powershell scripti tam burada işinize yarayabilir.

Read More …

Search and Delete messages from mailboxes

Search-mailbox cmdlet can mainly be used for:

  • Copying messages to a another target mailbox
  • Deleting messages from a mailbox
  • Recovering items from a user’s Recoverable Items
  • Deleting items from Recoverable Items

 

To search for a specific emails in the mailbox and to delete them:

First, in order to be able to see and run this cmdlet in the EMS, the user running it should have “Discovery Management” rights. The “Discovery Management” role group bu default doesn’t have any members including administrators. This role group also grants “Mailbox Import Export” RBAC role, and it can also be used to export and/or import emails from/to user mailboxes.

To add your account to this group:

Add-RoleGroupMember “Discovery Management” –Member theadmin

 

Then, for example, to delete all emails that contains “your mailbox is full” in the subject of a user the following cmdlet can be used:

Search-Mailbox -Identity testuser –SearchQuery “Subject:’Your mailbox is full'” `

DeleteContent –Force

For detailed information on parameters of this cmdlet: http://technet.microsoft.com/en-us/library/dd298173(EXCHG.141).aspx