With the average size of Mailbox\Archives getting larger by the day eDiscovery on Exchange 2013 is useful for a broad array of tasks. eDiscovery makes use of the KQL (Keyword Query Language https://msdn.microsoft.com/EN-US/library/office/ee558911(v=office.15).aspx ) which allows you to query for both free text and Queryable properties that have been indexed by the Exchange store and it also allows the use of some more complex operators such as proximity and Synonyms.
Let's look at a specific user case for eDiscover, the Lync client on 2013 will automatically add contacts to your Exchange Mailbox in the "Lync Contacts" folder and flag the body of the contact with something like
2/02/2015 This contact was added from Microsoft Lync 2013 (15.0.4675.1000)
(if you want to bind directly to the Lync Contacts folder in 2013 you should be able to use the QuickContacts WellKnownFolder Enum eg
$folderid= new-object Microsoft.Exchange.WebServices.Data.FolderId([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::QuickContacts,$MailboxName)
$LyncContacts = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($service,$folderid)
)
If you wanted to look at a Mailbox and find all the contacts that where added by the Lync client regardless of what folder that are now located in then eDiscovery is good option. For this you would need to construct a KQL query that first restricted the results to Contacts only using
Kind:contacts
Then add another predicate to this query using a Boolean And to perform a freetext query for the phrase
added from Microsoft Lync
The reason for using a freetext query rather then a property query eg Body:SearchPhrase is explained in the Notes section of https://technet.microsoft.com/en-us/library/jj983804%28v=exchg.150%29.aspx . Put simply the Body property is searchable (available in Freetext) but not Queryable (meaning you can do a property restriction).
To use eDiscovery is EWS you need to granted the Discovery Search RBAC role https://technet.microsoft.com/en-us/library/dd298059%28v=exchg.150%29.aspx
The following script does a eDiscovery of the Mailbox you enter as a commandline parameter for the KQL Kind:contacts And "added from Microsoft Lync". It then does a batch GetItem on the results and validate the Body of the contact to ensure its not False positive and produce a csv report like
Let's look at a specific user case for eDiscover, the Lync client on 2013 will automatically add contacts to your Exchange Mailbox in the "Lync Contacts" folder and flag the body of the contact with something like
2/02/2015 This contact was added from Microsoft Lync 2013 (15.0.4675.1000)
(if you want to bind directly to the Lync Contacts folder in 2013 you should be able to use the QuickContacts WellKnownFolder Enum eg
$folderid= new-object Microsoft.Exchange.WebServices.Data.FolderId([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::QuickContacts,$MailboxName)
$LyncContacts = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($service,$folderid)
)
If you wanted to look at a Mailbox and find all the contacts that where added by the Lync client regardless of what folder that are now located in then eDiscovery is good option. For this you would need to construct a KQL query that first restricted the results to Contacts only using
Kind:contacts
Then add another predicate to this query using a Boolean And to perform a freetext query for the phrase
added from Microsoft Lync
The reason for using a freetext query rather then a property query eg Body:SearchPhrase is explained in the Notes section of https://technet.microsoft.com/en-us/library/jj983804%28v=exchg.150%29.aspx . Put simply the Body property is searchable (available in Freetext) but not Queryable (meaning you can do a property restriction).
To use eDiscovery is EWS you need to granted the Discovery Search RBAC role https://technet.microsoft.com/en-us/library/dd298059%28v=exchg.150%29.aspx
The following script does a eDiscovery of the Mailbox you enter as a commandline parameter for the KQL Kind:contacts And "added from Microsoft Lync". It then does a batch GetItem on the results and validate the Body of the contact to ensure its not False positive and produce a csv report like
I've put a download of this script here the script itself looks like
1 | ## Get the Mailbox to Access from the 1st commandline argument |