Tag: exchange server 2010

以编程方式添加/编辑exchange2010帐户

你必须知道这是我第一次与交流合作。 我必须创建一个程序来在Exchange 2010上添加/编辑帐户。我知道在互联网上有很多关于这个主题的答案,但我没有找到任何最近的完整教程解释如何从头开始(所有完整的)步)。 我想使用此function创建ac#OR vb(.NET)程序(窗口的客户端,或Web,或其他): 添加新的Exchange 2010电子邮件帐户 列出现有帐户 修改现有帐户 我知道很多人看起来很简单,我知道那里有很多很好的教程。 但就像我说的那样,我是一个全新的交流,所有这些教程对我来说都很复杂。 我问你的建议,教程,提示,可以帮助我理解的东西。 我希望这个问题可以帮助像我这样的很多新手。

使用C#在Exchange 2010上创建邮箱

我试图通过我的C#windows应用程序在Exchange 2010上创建用户邮箱。 这是我的代码 PSCredential creds = new PSCredential(“user id”, StringToSecureString(“password”)); System.Uri uri = new Uri(“http://servername/powershell?serializationLevel=Full”); Runspace runspace = RunspaceFactory.CreateRunspace(); PowerShell powershell = PowerShell.Create(); PSCommand command = new PSCommand(); command.AddCommand(“New-PSSession”); command.AddParameter(“ConfigurationName”, “Microsoft.Exchange”); command.AddParameter(“ConnectionUri”, uri); command.AddParameter(“Credential”, creds); command.AddParameter(“Authentication”, “Default”); powershell.Commands = command; runspace.Open(); powershell.Runspace = runspace; Collection result = powershell.Invoke(); powershell = PowerShell.Create(); command = new PSCommand(); […]

如何使用c#中的“format-list”和“out-file”管道调用powershell命令?

嗨,我正在开发一个C#程序来调用远程运行空间中的Exchange 2010 powershell cmdlet。 ps命令是: “Get-MailboxDatabase -Server EX2010SVR1 -Status | Format-List Identity,Guid,mounted,CircularLoggingEnabled,Recovery | Out-File’C:\ db.txt’-Encoding UTF8 -Width 8192”。 我的代码类似于: static int Main(string[] args) { const string SHELL_URI = “http://schemas.microsoft.com/powershell/Microsoft.Exchange”; const string COMMAND = “Get-MailboxDatabase -Server EX2010SVR1 -Status | Format-List Identity,Guid,mounted,CircularLoggingEnabled,Recovery | Out-File ‘C:\db.txt’ -Encoding UTF8 -Width 8192”; System.Uri serverUri = new Uri(“http://EX2010SVR1/powershell?serializationLevel=Full”); PSCredential creds = […]

使用C#确定系统上的Exchange服务器版本

有没有办法通过c#检测哪个版本的Exchange Server正在运行(2007或2010)?

如何在Exchange 2010中获取邮件项的项ID

我在c#中使用Exchaneg Web Services来检索Exchange 2010上邮箱的所有电子邮件。 我将每封电子邮件的所有信息都放在一个返回给调用函数的数据表中。 我还需要每封电子邮件的唯一商品ID,以便在完成后我可以将电子邮件标记为“在Exchange上读取”框。 我试过这个: // As a best practice, limit the properties returned to only those that are required. PropertySet propSet = new PropertySet(BasePropertySet.IdOnly, ItemSchema.Subject); // Bind to the existing item by using the ItemId. // This method call results in a GetItem call to EWS. ItemId itemID = Item.Bind(service, itemId, propSet); […]

远程检查交换凭据并检查用户是否已登录

我尝试过这个并没有太大的成功。 基本上我需要远程使用EWS登录Exchange。 问题是我不知道用户是否已登录确定,或者凭据是否错误,因为我什么都没有回来! 如果我提供了错误的凭据,软件就会继续! 有没有我缺少的东西,我已经检查了有关EWS的MSDN内容,它向您展示如何连接到交换,但没有关于validation凭据的内容! 下面是我目前要连接的代码。 public void connect(string Email, string Password) { try { _useremail = Email; _userpass = Password; // Define the credentials to use. var credentials = new WebCredentials(_useremail, _userpass); _ExchangeServer = new ExchangeService(ExchangeVersion.Exchange2010_SP1); _ExchangeServer.Credentials = credentials; _ExchangeServer.Url = new Uri(_ExchangeEWSURL); _ExchangeServer.Timeout = 60; _ExchangeServer.KeepAlive = true; _ExchangeConnected = true; } catch […]

Exchange Web服务 – 将电子邮件附件从Base64字符串转换为字节提供错误

我正在尝试使用EWS读取电子邮件附件,并将其作为文本文件保存到磁盘,以便以后使用。 我收到一个错误: “The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or a non-white space character among the padding characters. ” 这是我的代码: Directory.CreateDirectory(emailAttachmentsPath); // Put attachment contents into a stream. C:\Dev\EWSHelloWorld emailAttachmentsPath = emailAttachmentsPath + “\\” + sEmailSubject+”.txt”; //save to disk using (Stream FileToDisk […]

该帐户无权模拟所请求的用户

我尝试访问资源邮箱时收到此错误。 请任何人帮助我。 我是EWS的新手。 我可以通过OWA(Outlook Web应用程序)访问资源邮箱。 但我不是这个邮箱的所有者,因为它是共享邮箱。 我的代码: ServicePointManager.ServerCertificateValidationCallback = CertificateValidationCallBack; ExchangeService newExchangeService = new ExchangeService (ExchangeVersion.Exchange2007_SP1); newExchangeService.Credentials = new NetworkCredential(username, password, domain); newExchangeService.AutodiscoverUrl(email-id, RedirectionUrlValidationCallback); newExchangeService.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, email_which_i_want_to_access); Folder visitorsFolder = Folder.Bind(newExchangeService, WellKnownFolderName.Inbox); foreach (Folder childfolder in visitorsFolder.FindFolders(new FolderView(10))) { Console.WriteLine(childfolder.DisplayName); }