exchange-server-2010

How to get the millisecond part of the DateTimeRecieved field of emailmessage using EWS managed APIs

眉间皱痕 提交于 2019-12-11 17:13:20
问题 I have a code which synchronizes with exchange and gets the emailmessage objects for the given itemids: List<EmailMessage> emails = new List<EmailMessage>(); ServiceResponseCollection<GetItemResponse> response = MyExchangeService.BindToItems(MyItemIds, PropertySet); foreach (GetItemResponse getItemResponse in response) { if (getItemResponse.Item != null) { emails.Add((EmailMessage)getItemResponse.Item); } } Now, the emailmessage object that I get as a result, contains the DateTimeReceived

C# List all email addresses in MS Exchange

蹲街弑〆低调 提交于 2019-12-11 16:36:16
问题 I need to get list of all emails from exchange/active directory. Whether emails like j.doe@domain.com or email groups like all-contacts or CEO which they includes couple of email addresses. this is my code so far: DirectoryEntry de = new DirectoryEntry(ad_path); DirectorySearcher ds = new DirectorySearcher(de); ds.Filter = "(&(objectClass=addressBookContainer)(CN=All Global Address Lists,CN=Address Lists Container,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC

Invoking exchange activesync cmdlet's from an ASP.NET application

ぃ、小莉子 提交于 2019-12-11 15:59:13
问题 I'm working on a solution where users can wipe mobile devices registered with Exchange 2010, through a webpage, using Outlook Web Access is not an option. I've installed Exchange Management Tools on my dev machine and the app pool is using an identity that has the necessary rights to perform the commands (assigned role group "Recipient Management"). I'm using the following code to perform the wipes string deviceId = "deviceid"; string username = "username"; RunspaceConfiguration rsConfig =

Powershell script to add users to A/D group from .csv using email address only?

泪湿孤枕 提交于 2019-12-11 12:59:20
问题 Import-CSV "C:\users\Balbahagw\desktop\test1.csv" | Foreach-Object { $aduser = Get-ADUser -Filter { EmailAddress -eq $_.'EmailAddress' } if( $aduser ) { Write-Output "Adding user $($aduser.SamAccountName) to groupname" Add-ADGroupMember -Identity tech-103 -Members $aduser } else { Write-Warning "Could not find user in AD with email address $($_.EmailAddress)" } } Script is working now, however it can't find the user in AD with the email address. 回答1: You need to first resolve the ADUser

Javamail event listener not getting any events

ε祈祈猫儿з 提交于 2019-12-11 12:37:45
问题 I coded an IMAP handler and an event listener as I understood it should be done, but I don't see any events firing, despite filling up the inbox with new emails. What could be my problem? I set up the store to idle until someone closes the mailbox: public void run() { boolean logged = false; synchronized (emailListener) { while (!isCancelled) { try { if (isListening) { throw new EtlSystemException( null, "Disallowed attempt to " + "start email listener - listening status already set", null,

How to send email via a Shared MailBox using Exchange Web Services (EWS) API

半腔热情 提交于 2019-12-11 08:58:02
问题 I'm sending emails via a shared mailbox using the MS Exchange Web Services API. Sending emails works but they are not saved in the sent items. As shown below doing it manually works, the items are saved in the Sent Items, but via my code doesn't save them: using Microsoft.Exchange.WebServices.Data; using System; //Ref to Microsoft.Exchange.WebServices v15 //Re to Microsoft.Exchange.WebServices.Auth v15 namespace Emailing { public class Email { private string _sharedOutlookMailAccount =

EWS : Unable to read data from the transport connection: The connection was closed

℡╲_俬逩灬. 提交于 2019-12-11 06:44:02
问题 var message = EmailMessage.Bind(exchangeService, itemid, new PropertySet( ItemSchema.Attachments)); exchangeService.TraceListener=new TraceListener(); exchangeService.TraceEnabled = true; message.Load(new PropertySet(ItemSchema.MimeContent)); // Getting exception here. // File.WriteAllBytes("email.eml", message.MimeContent.Content); I am getting the below exception when trying to load the mime content. Microsoft.Exchange.WebServices.Data.ServiceRequestException occurred HResult=-2146233088

TimeZone and Working Hours for Users through EWS

落花浮王杯 提交于 2019-12-11 04:13:12
问题 Is it possible to get TimeZone and working hours of the users through EWS? I am able to extract TZ and Working Hours for current user(Account with which the ExchangeService is initialized) UserConfiguration usrConfig = UserConfiguration.Bind(service, "WorkHours", WellKnownFolderName.Calendar, UserConfigurationProperties.All); XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(new MemoryStream(usrConfig.XmlData)); XmlNodeList nlList = xmlDoc.GetElementsByTagName("WorkHoursVersion1"); Console

How to export mail message to EML or MSG file with PowerShell and EWS

旧城冷巷雨未停 提交于 2019-12-11 04:11:50
问题 I'm currently working on a PowerShell script that need to extract all mail messages from a specific mailbox as .eml or .msg files and save them on a backup server. I'm using powershell version 5 with the Exchange 2010 management console module (EWS). Currently, my script is able to access all messages in the inbox folder with their properties such as Body, Subject, attachments and so on. However, I couldn't find an easy way or method to export the messages (with their attachment(s)). So my

EWS Message Tracking Report

前提是你 提交于 2019-12-11 03:02:18
问题 I've been doing a bunch of research on how to get a message tracking report from exchange using EWS and can't seem to pinpoint anything. I was going to build an application that scrapes the log files but if I can do it through EWS it be better for what I'm doing. Any ideas? 回答1: I was finally able to create a solution to my issue. I am using Powershell in C# to send commands to exchange and parse through the Message Tracking Log. In order to this you need to make sure the user you are using