Hi
I want to read all mailbox user send message body using power shell query ,if anybody know about that pls help me ....
thanks
manidurai
Technology Tips and News
Hi
I want to read all mailbox user send message body using power shell query ,if anybody know about that pls help me ....
thanks
manidurai
The best place to start with is read the forum guide https://social.technet.microsoft.com/Forums/office/en-US/77c07b69-eea6-43ab-9225-4b384cecfc9d/exchange-development-forum-guide-read-before-posting?forum=exchangesvrdevelopment
And then try to give some context to what your trying to do in your question and what code your trying to use eg post the code your using. Eg if you just want to search for text within a Message body for legal discovery the I would suggest you use Search-Mailbox https://technet.microsoft.com/en-us/library/ff459253(v=exchg.150).aspx .
Cheers
Glen
The best place to start with is read the forum guide https://social.technet.microsoft.com/Forums/office/en-US/77c07b69-eea6-43ab-9225-4b384cecfc9d/exchange-development-forum-guide-read-before-posting?forum=exchangesvrdevelopment
And then try to give some context to what your trying to do in your question and what code your trying to use eg post the code your using. Eg if you just want to search for text within a Message body for legal discovery the I would suggest you use Search-Mailbox https://technet.microsoft.com/en-us/library/ff459253(v=exchg.150).aspx .
Cheers
Glen
Hi Glen
i saw your blogs for unread message count(http://gsexdev.blogspot.com.au/2012/10/reporting-on-item-age-count-and-size-in.html) ,then it's working perfectly but it's need full access permission to get unread message count , my need is get unread count without full access privilege then my account have Enterprise administrator and organization management but no luck it's required only full access privilege for all mailbox users. pls help me..
Thanks
Manidurai
There are two options for authentication the first is having Full Access granted to the Mailbox via Add-MailboxPermissions . Note your Administrative rights don't mater when in comes to Mailbox access they only rights they give you is the ability to add and remove rights to a mailbox.
The other option you can use to access a Mailbox is grant impersonation rights to the account your using to connect see https://technet.microsoft.com/en-AU/library/dd776119(v=exchg.150).aspx
If you use the impersonation option you'll need to modify the script to use impersonation the lines are already in the script but commented out eg enable this line by removing the # in front
$service.ImpersonatedUserId = new-object Microsoft.Exchange.WebServices.Data.ImpersonatedUserId([Microsoft.Exchange.WebServices.Data.ConnectingIdType]::SmtpAddress, $MailboxName)Cheers
There are two options for authentication the first is having Full Access granted to the Mailbox via Add-MailboxPermissions . Note your Administrative rights don't mater when in comes to Mailbox access they only rights they give you is the ability to add and remove rights to a mailbox.
The other option you can use to access a Mailbox is grant impersonation rights to the account your using to connect see https://technet.microsoft.com/en-AU/library/dd776119(v=exchg.150).aspx
If you use the impersonation option you'll need to modify the script to use impersonation the lines are already in the script but commented out eg enable this line by removing the # in front
$service.ImpersonatedUserId = new-object Microsoft.Exchange.WebServices.Data.ImpersonatedUserId([Microsoft.Exchange.WebServices.Data.ConnectingIdType]::SmtpAddress, $MailboxName)Cheers
Hi Glen
Thanks a lot glen, unread message count with impersonation option is working perfectly ,then i actually assigned impersonation role via following command
New-ManagementRoleAssignment Name:impersonationAssignment Role:ApplicationImpersonation User:<username>
do you have any Powershell scricpt for read all users message body using EWS, Pls help me
Thanks
Manidurai
Hi Glen
Thanks a lot glen, unread message count with impersonation option is working perfectly ,then i actually assigned impersonation role via following command
New-ManagementRoleAssignment Name:impersonationAssignment Role:ApplicationImpersonation User:<username>
do you have any Powershell scricpt for read all users message body using EWS, Pls help me
Thanks
Manidurai
You need to enumerate the Items in the folder you want to read them from and then load the body property eg for the Inbox
# Bind to the Inbox Folder $folderid= new-object Microsoft.Exchange.WebServices.Data.FolderId([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::Inbox,$MailboxName) $Inbox = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($service,$folderid) $psPropset= new-object Microsoft.Exchange.WebServices.Data.PropertySet([Microsoft.Exchange.WebServices.Data.BasePropertySet]::FirstClassProperties) #Define ItemView to retrive just 1000 Items $ivItemView = New-Object Microsoft.Exchange.WebServices.Data.ItemView(1000) $fiItems = $null do{ $fiItems = $service.FindItems($Inbox.Id,$ivItemView) [Void]$service.LoadPropertiesForItems($fiItems,$psPropset) foreach($Item in $fiItems.Items){ Write-Host ($Item.Body.Text) } $ivItemView.Offset += $fiItems.Items.Count }while($fiItems.MoreAvailable -eq $true)Cheers
You need to enumerate the Items in the folder you want to read them from and then load the body property eg for the Inbox
# Bind to the Inbox Folder $folderid= new-object Microsoft.Exchange.WebServices.Data.FolderId([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::Inbox,$MailboxName) $Inbox = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($service,$folderid) $psPropset= new-object Microsoft.Exchange.WebServices.Data.PropertySet([Microsoft.Exchange.WebServices.Data.BasePropertySet]::FirstClassProperties) #Define ItemView to retrive just 1000 Items $ivItemView = New-Object Microsoft.Exchange.WebServices.Data.ItemView(1000) $fiItems = $null do{ $fiItems = $service.FindItems($Inbox.Id,$ivItemView) [Void]$service.LoadPropertiesForItems($fiItems,$psPropset) foreach($Item in $fiItems.Items){ Write-Host ($Item.Body.Text) } $ivItemView.Offset += $fiItems.Items.Count }while($fiItems.MoreAvailable -eq $true)Cheers
Hi Glen
Thanks a lot ,your Message body script is working Perfectly ...
Thanks
Manidurai