欢迎光临 Enjoy IT (ITECN.NET) 登录 | 注册 | 帮助

Thinking about Back Pressure

文:微软全球技术支持中心 / 技术支持工程师 / 李可嘉 / kejial@microsoft.com

在Exchange Server 2007当中,很多客户都会遇到一个问题,就是Back Pressure,中文叫做反压,由于这类问题会导致整个Site的HUB全部down掉,我想有必要跟大家从原理上分析,为什么这种情况会出现?以及我们如何解决。

大家都知道,在Exchange 2007当中,已经没有传统意义的路由概念,邮件在传输的过程当中,完全是根据AD Site来决定的,这是一个里程碑的改进,曾记否,在Exchange Server 2000以及2003时,当你遇到路由信息不准的时候,或者类似问题,你需要shutdown在一个路由组当中的所有Exchange服务器的Routing以及SMTP 服务,然后让Routing Master Re-publish一次,以便让这个路由组的成员获取到正确的信息,严重时,还需要重启一个路由组当中的所有Exchange服务器。

由于Exchange Server 2007已经抛弃了这种概念,所以在Exchange Server 2007很少需要Troubleshooting路由问题,你也很难去控制路由。

以上是题外话,为下文做铺垫,我们言归正传,什么是反压呢?

根据http://technet.microsoft.com/zh-cn/library/bb201658.aspx 的信息,反压是 Microsoft Exchange 传输服务的一种系统资源监视功能。在运行 Microsoft Exchange Server 2007 且安装了集线器传输服务器角色或边缘传输服务器角色的计算机上,通常会使用这一功能。它将对重要的系统资源(如可用硬盘驱动器空间和可用内存)进行监视。如果系统资源使用率超出了指定限制,Exchange 服务器会停止接受新的连接和邮件。这样,便可防止过多地使用系统资源,并使 Exchange 服务器可以传送现有邮件。当系统资源使用率恢复到正常级别后,Exchange 服务器就可以接受新的连接和邮件。

嗯,看起来是一个不错的功能,为什么我会发现我的Hub服务器莫名其妙就出现了反压,telnet 25端口也会出现Insufficient System Resource,新的连接也无法接受呢?

可以肯定一点,如果你的HUB服务器有反压行为,非常有可能的就是你的System Resource出现了问题,因此不外乎以下两点:

  • HUB服务器的System Resource一致处于不足的状态,由于在Exchange Server 2007当中,基本上所有的邮件都要去HUB做"记录",因此当有较大的邮件传递至HUB服务器,HUB服务器过载,反压就会出现。
  • 我的HUB服务器平时工作非常之正常,突然有一天Transport Service也没有办法启动,或者突然发生Insufficient System Resource,这是怎么回事呢?

    如果这时,你去使用Message Tracking工具去查,你会发现一些很奇怪的现象,如:

     

    #Fields: date-time     client-ip     client-hostname    server-ip    server-hostname    source-context    connector-id    source    event-id    internal-message-id    message-id    recipient-address    recipient-status    total-bytes    recipient-count    related-recipient-address

     

    2009-04-09T08:46:17.763Z    10.0.0.2    MailCCR@contoso.com    10.0.0.3    hub01    STOREDRIVER    RECEIVE    5260865    <29AA329169F9434985F650685C37212ED5BBB4A28B@MailCCR@contoso.com> testuser1@contoso.com 1076171268    1    

     

哦,这可是太奇怪了,怎么会有一个人(testuser1@contoso.com)在向HUB传递一个1GB的邮件?

接下来的事情更加匪夷所思:

MicrosoftExchange329e71ec88ae4615bbc36ab6ce41109e@contoso.com 在生成一个NDR给testuser1@contoso.com.

事情在这里很明确,Mailbox Server在试图传递一个1GB的大邮件给HUB,HUB当然吃不消了,于是反压出现了。

问题在这里似乎得到了判断,但是,为什么这个用户(testuser1@contoso.com)能给Mailbox Server传一个1Gb的邮件呢?

这时,如果你去看这个用户的Outlook版本,十有八九会是这样的:

  • 他在使用缓存模式
  • 他没有安装Outlook 2003 SP2

根据KB894795的描述:A message that exceeds the configured size limit is sent to a server that is running Exchange Server 2003

894795 A message that exceeds the configured size limit is sent to a server that is running Exchange Server 2003

http://support.microsoft.com/default.aspx?scid=kb;EN-US;894795

哦,明白了,原来这是一个Bug,在Exchange Server 2003 SP2就修复了。

不对吧,我们在讨论Exchange Server 2007,比2003不知道要好到哪里去(比如之前你提到的Routing),二者的关系在哪里呢?

如果你静下心来,细细看完,便恍然大悟了:

To resolve this issue, apply hotfix 894795 to the Exchange server. To enable the new behavior in Outlook 2003, install Microsoft Office 2003 Service Pack 2 (SP2) on the Outlook 2003 client computers.

说的很清楚,只有这个Hotfix或者只升级服务器端是不行的,客户端也要做一些动作,你至少要是Outlook 2003 SP2以上版本。

可能你还是将信将疑,觉得有些云山雾罩,好吧,让我们来揭开神秘面纱,这是因为在Outlook 2003 SP2之前的版本,如果你是缓存模式,Exchange服务器在没有全部收下来你的邮件stream之后,是没有办法知道这封邮件的真正大小。换言之,你超过limitation了,但是这个作出超过的判断,Exchange也只能在全部接收下来整个邮件stream之后才能做出(这个行为延续至Exchange Server 2007),一旦收到,超过大小,Mailbox的store将产生一个NDR告诉最终用户,你超标了,要节能减排,还会将你的证据(原始邮件)以附件的形式放在NDR当中,假设你的大邮件是1GB,这个NDR肯定是>=1GB的,你总要允许人家写几个字吧。

治标不如治本,解决方法就是让用户不要使用老版本的Outlook,Consider you are driving a car which is 10 years ago! JJJ当然,你也可以根据如下的KB禁止低于某一个版本的Outlook连接到Exchange服务器,强制他们升级。

288894 How to disable MAPI client access to a computer that is running Exchange Server

http://support.microsoft.com/default.aspx?scid=kb;EN-US;288894

这可是太难了,我们是一个跨国公司,用户在全球,我们怎么来管理那么多的客户端,让他们升级Outlook呢?

微软的产品在我看来是满体贴入微的,在最新的Exchange Rollup 8当中有一个功能,这个功能就是将附件从NDR中移除!毕竟,我们遵守惩前毖后,治病救人的方针,有一个NDR告诉用户就可以了,无需将其罪证也展示出来,谁也不好下台,对不对?JJJ

960775 You receive a "Message too large for this recipient" NDR that has the original message attached after you restrict the Maximum Message Send Size value in Exchange Server 2007

http://support.microsoft.com/default.aspx?scid=kb;EN-US;960775

 

Description of Update Rollup 8 for Exchange Server 2007 Service Pack 1

http://support.microsoft.com/kb/968012

还等什么,赶紧下载安装吧!保证所有的服务器最新的Rollup版本永远不是什么坏事情!

如果你还有更深一步的问题,欢迎探讨,您可以在文章开头找到我的联系方式!

(原创,非翻译JJJ

发表于 作者 kejiali | 260 评论
归档在:

什么是正确有效的排错思路

最近遇到一个问题,从拿到问题到解决问题,都给了我很多的启发和感触,在此,share出来以期抛砖引玉之效。

 

问题描述:

用户在自己的Outlook -->日历中建立一个约会,不论选择哪一天,都会自动显示在当天(以当前系统时间为准)。可以参考下图:

 

这个问题的确比较奇怪,为了能够尽快解决问题,我们缩小了问题的范围,通过跟最终用户的交谈,我们了解到:

-          快取模式和在线模式问题相同。

-          Outlook Safe模式也可以重现。

-          Windows Safe模式依然可以重现。

-          用户的邮箱40Mb左右。

-          只有一个用户的邮箱有这个问题。

-          创建一个测试帐号,在这台机器上对这个测试帐号配置Outlook配置文件,并没有发现这个问题

-          创建新的Outlook用户配置文件,无效。

-          换一台机器无效。

-          这个用户,如果使用Outlook Web Access访问自己的邮箱,执行同样的动作,问题却又无法重现。

-          这个用户没有任何的代理人以及行动设备与自己的邮箱关联。

-          卸载杀毒软体,无效。

-          删除所有插件,无效。

 

问题到这里似乎陷入了一个逻辑的循环当中:如果说这台机器有问题,那为什么其他帐号在这台机器上并没有类似的问题呢?如果说用户的邮箱在Exchange服务器上有问题,那为什么这个用户使用Outlook Web Access执行同样的操作又没有这个问题呢?

我们经过了仔细的分析,调整了排错思路,首先可以基本确定这个用户的邮箱有一定的问题,导致了显示日历的不正常,而导致这个问题的原因往往很多种,比如邮箱上一些逻辑显示的错误等等。既然是显示上的问题,我们又通过如下的方式进一步对问题进行了缩小。

在这个邮箱中,新建一个日历的文件夹,如下图:

在这个新建的日历文件夹当中,我们再去创建约会,发现问题消失。

至此,问题明朗化了,显示问题,Outlook是专门有一个参数来修正显示的,那就是Outlook.exe /cleanviews!

当执行这条命令再次启动Outlook之后,问题得以解决。

启示:

1.       其实,这个问题看起来并不是很复杂,但是一开始的确给人以丈二和尚摸不着头脑的感觉,尤其在这种情况下,缩小问题(Narrow Down)就是非常关键的一个环节,缩小问题妥当,可以及早向解决问题靠近,从而为尽快解决问题打下基础。

2.       在做技术支持工作近一年的时间中,当每次我跟“大拿“级别的工程师讨论问题时,他们经常会问我,你为什么要做这一步测试?你做的这一步测试是要说明什么问题?真的可以说明问题吗?如果用户告诉你说1,你下一步应当怎么做?如果是2,那你下一步又当怎么做?我感觉,这是一个非常好的逻辑思维思考方式,很多人说“这位工程师很专业”,这里的专业很多情况下并不是说工程师告诉用户的技术有多么的高深,而是工程师每做的一步测试,每次收集的数据,都可以准确无误的表达一个含义。即使问题最终可能是无解的,但是每一次测试都在向发现问题靠拢,让用户的信心大增,从而赢得客户的认可和理解。相反,如果你的很多测试无法说明任何问题,久而久之,用户也会厌倦,从而对你丧失信心。

3.       那么,究竟什么是正确有效的排错思路呢?我在这里总结了一下:

- Double Check issue, then confirm it, please do not put double effort.

- Try to show your clear logic, find solid evidence.

- Told the end user what you have done, what you gonna do and why.

- Set the right expectation for users if you cannot find root cause. This is very important under such scenario: Issue happened only once or randomly.

- Show best experience and guide users.

- Please do not make any conclusion which you are not sure.

 

最后,所有的这些都是建立在扎实的技术功底至上的,如果技术不扎实,用户同样也会丧失信心,举一个最简单的例子,总不能任何时候当客户问你问题的时候你都说:I am not sure about that. J

发表于 作者 kejiali | 7 评论
归档在:

GTSC Premier Team Job Opportunity

最近受我们老大的委托,在这里发布一则招聘信息,工作职位是微软全球技术支持中心企业信息支持部门Exchange Server技术支持工程师(GTSC Premier Team Exchange Support Engineer)。Enterprise Messaging Service Team是一个充满活力,可以让你释放自己的潜力,实现自我价值的团队,如果你想成为Exchange服务器端的"大拿",成为令人瞩目的微软技术专家,可以关注此招聘信息。

招聘职位:

技术支持工程师(Support Engineer)

Job Summary

The position will be reporting to EMS Team Manager in Bizapps Group. The Support Engineer will provide high quality technical support of Microsoft Exchange Server and Messaging products to the Premier and Professional customers in Asia Pacific and Greater China regions. The Support Engineer need to manage both customer relationships and the technical resolution of customer's requests, deliver high quality CPE through timely response, resolution, interpersonal collaboration and execution.

Main Responsibilities

  • Provide the quick and accurate solutions to the customers' problems. Meet all follow up commitments made with customers
  • Represent Microsoft and communicate with customers via telephone, written correspondence, electronic service in a timely manner according to the service level agreement.
  • Manage the healthy progress of service requests. Ensure escalating to senior and escalation resources at the right time with the right information.
  • Collaborate on cross-team and cross-product technical issues by working with resources from other groups as needed to resolve customer issues.
  • Effectively manage relationships with customers, Technical Account Managers and other internal MS resources, while ensuring high customer satisfaction of the overall service experiences.
  • Compliance with the service operation processes for execution excellence.
  • May work a rotational on-call schedule for 24x7 critical support.

 

Qualifications

  • Bachelor or Master Degree in Engineering or Science, Computer Science or Electrical Engineering preferred.
  • 2+ years working experience in the related industry such as IT, technical support, consulting, experience of Microsoft Exchange server or other messaging system preferred.
  • Strong analytical logic and problem troubleshooting skills.
  • Knowledge of Microsoft server products, OS and application architecture, networking, TCP/IP family protocols. MCSE Preferred.
  • Good communication skills in both Chinese and English.
  • Passion for new technology and quick learning skills.
  • Self-motivate and must be a strong team player with a "can-do" attitude.

     

    Either of the following knowledge or skills is a strong plus:

  • C++ / .NET programming and debugging.
  • Experience of customer service and technical support.

 

Competence/Job Skill Attribute

  • Analytical Problem Solving - High
  • Building Customer Relationships - High
  • Cross-Boundary Collaboration - Medium
  • Product Expertise – Medium
  • Customer Advocacy - Medium
  • Impact and Influence - Medium
  • Interpersonal Awareness - Medium
  • Team Leadership - N/A

 

资深技术支持工程师(Senior Support Engineer)

资深技术支持工程师需要有一定的技术背景以及IT业界经历,因为资深技术支持工程师是Escalation Engineer的"后备军",需要有一定的编程基础,并且可以使用微软产品的源代码解决技术问题。

Job Summary

The Sr. Support Engineer will provide high quality technical support of Microsoft Exchange Server and Messaging products to the Premier and Professional customers in Asia Pacific and Greater China regions, especially for the key enterprise customer accounts and the problems in complex environment. The Sr. Support Engineer need to manage both customer relationships and the technical resolution of customer's requests, leverage advanced troubleshooting skills to handle the escalation of hot or difficult customer problems from support engineers, deliver high quality CPE through timely response, resolution, interpersonal collaboration and execution.

Main Responsibilities

  • Provide the quick and accurate solutions to the problems from the customer
  • Represent Microsoft and communicate with customers via telephone, written correspondence, electronic service in a timely manner according to the service level agreement.
  • Take the escalation of support engineers for political hot or technical difficult problems, manage the healthy progress of service requests, and further escalate the most complex technical problems or product issue to escalation engineers at the right time with the right information.
  • Collaborate on cross-team and cross-product technical issues by working with resources from other groups as needed to resolve customer issues.
  • Learn advanced technologies and deliver high-level training internally and externally. Maintain strong working knowledge of new products.
  • Effectively manage relationships with customers, Technical Account Managers and other internal MS resources, while ensuring high customer satisfaction of the overall service experiences.
  • Compliance with the service operation processes for execution excellence.
  • May work a rotational on-call schedule for 24x7 critical support.
  • Provide coaching and consulting for internal colleagues

Team responsibilities:

  • Lead the support team readiness in certain specialties.
  • Assist team manager to recruit new people, coaching junior support engineers/vendors to provide excellent service to customers.
  • Conduct regular case review of the mentees to ensure case wellness, and provide technical or non-technical advice to accelerate problem resolution.
  • Assist team members to identify risky case and conduct customer recovery when required.
  • Communicate with stakeholders, including peer, managers, TAM, and customer executives appropriately to escalate problem in time. Can manage stakeholder expectation effectively.
  • Propose new initiatives and necessary process changes to meet internal/external business change and performance improvement requirement.

 

Qualifications

  • Bachelor or Master Degree in Engineering or Science, Computer Science or Electrical Engineering preferred.
  • 4+ years working experience in the related industry such as IT, technical support, consulting, experience of Microsoft Exchange server or other messaging system required.
  • Expertise in analytical logic and problem troubleshooting skills.
  • Strong knowledge of Microsoft server products, OS and application architecture, networking, TCP/IP family protocols. MCSE required.
  • Good communication skills in both Chinese and English.
  • Passion for new technology and quick learning skills.
  • Self-motivate and must be a strong team player with a "can-do" attitude.
  • C++ / .NET programming and debugging.
  • Experience of customer service and technical support.

     

Competence/Job Skill Attribute

  • Analytical Problem Solving - High
  • Building Customer Relationships - High
  • Cross-Boundary Collaboration - High
  • Product Expertise – High
  • Customer Advocacy - High
  • Impact and Influence - High
  • Interpersonal Awareness - Medium
  • Team Leadership - Medium

 

 

如果有朋友对上述职位有兴趣,可以直接发邮件到jwang@microsoft.com,并附上你的中英文简历;如果有任何疑问,可以发邮件至lkj5210@hotmail.com询问。

发表于 作者 kejiali | 4 评论

Thanks for giving

本周四是西方传统节日,感恩节,从6月28日算起,我来微软全球技术支持中心工作已经是第五个月了,即将接近半年的时间,在近半年的工作时间内,我颇有感触,在感恩节里,我想感谢GTSC-BizApp EMS组所有成员。

首先感谢我的经理,Jason,感谢Jason给我这样的一个工作机会和渠道,让我真正能够从原理上了解掌握Exchange Server 和Outlook,进入GTSC,我才发现Exchange Server的博大精深,才真正懂了如何学习技术以及正确的学习方法,我记得有一次跟Jason One-One,Jason share给我他当时学习技术的一些感悟和经验,真的很感激Jason对我的帮助。借用别人的一句话说,能够遇到Jason,是运气,是福气。

感谢我的Mentor, Jessie,Jessie 是一位非常严格和Nice的Mentor,很多时候Jessie陪着我一起做case,一起做checkpoint, Jessie曾经为一个技术原理或者细节不止一次的为我耐心讲解,我很感激Jessie,也庆幸自己能够遇到如此nice的mentor.

感谢Kun,Kun是我们的Tech Lead,我记得我第一次跟客户做Live Meeting就是Kun陪着我一起做的,Kun严谨的做事态度和过硬的技术功底,让我深感钦佩,更重要的是,Kun的逻辑思维非常清晰,一个很复杂的问题在他的排错思路下变得简单清晰明了,我记得有一次我问他RPC over HTTP如何Troubleshooting,我当时说抓包,Kun反问道,SSL加密你抓包怎么处理呢?我当时想想,哦?的确是这样啊,Kun告诉我说,先确定在防火墙内是好的还是不好的,这样很快就可以把复杂的问题narrow down下来。

感谢Ryan,Ryan跟我在一个cubic,工作时少不了经常麻烦他,他总是不厌其烦的为我指名思路,避免了我走很多弯路,节省了很多时间。

感谢Team内的Escalation Engineer,他们的确为我们整个Team做出了很大的贡献,我想,虽然他们清晰的排错思路和过硬的技术实力虽然我短期内无法企及,然而他们对技术的专注和热情的确值得我很好的学习。

感谢Team中所有的成员,我非常高兴能够在这样的一个团队中学习和工作。

感谢ITECN中的每一位成员,关心支持我的朋友,Eddie, Asuka, ahpeng,还有很多热心的朋友,谢谢大家对我的帮助和支持!

Thanks for giving! Smile

ThanksGiving day History:

On Thanksgiving day, people in the USA get together with family and friends, the first Thanks Giving was in 1621, Thanks giving was about pilgrims, the first settlers in America, they shared the first harvest with the Indians and gave thanks.

Thanksgiving is a day with many traditions, people eat traditional foods like turkey and turkey dressing. And fruit pies, like apple pie and pumpkin pie. Families enjoyed modern traditions too, like watching the Thanksgiving day parade on television.

And people watch the afternoon football game. And Thanksgiving is a day for giving thanks.

It's a special holiday.

A day to be with people you love.Smile

发表于 作者 kejiali | 350 评论
归档在:

活动目录管理系列之---自定义搜索object的属性

 

最近被问到一个很有意思的问题:

User1发信给某一个组(Domain Local, DL),启用了“收条”,但是发现有些用户并不在这个DL内也收到了这封邮件,因为有收条为证,看有哪些可能。

经过分析,初步断定有以下几种可能:

1.       这个人就在DL内,只是你没有发现而已;

2.       某一个用户在这个DL内,不幸的是,这个用户在AD内启用了Forward

3.       某一个用户客户端有Outlook Rule在作怪。

后来经过一些日志发现极有可能是第二种原因,问题来了,这个组有200300个用户,手工一个一个去查看Forward选项不太可行,有没有一些简单的方法呢?

本地测试了一下,当你为某一个用户在ADUC内配置了Forward之后,会有一个属性,是alrecipient=distingishname,那么我们来搜索一下这个值不为空的用户就OK了,方法如下:

1.       打开ADUC

2.       domain级别,右键点击,选择Find

3.       选择Customer Search.

4.       点击Advanced选项卡,手工写一条LADP语句。

4.       alrecipient=*,这样就会把该属性不为空的用户搜索出来,如下图。

问题又来了,这个还是只能是在图形界面上看出来,如果用户量很大的话,一个一个去检查Forward还是不现实,有没有办法dump出来呢?

大名鼎鼎的LDIFDE出场了,LDIFDE是一个非常强大的命令行工具,我们可以看看有哪些参数,实现哪些功能:

General Parameters

-i              Turn on Import Mode (The default is Export)

-f filename     Input or Output filename

-s servername   The server to bind to

-c FromDN ToDN  Replace occurrences of FromDN to ToDN

-v              Turn on Verbose Mode

-j              Log File Location

-t              Port Number (default = 389)

-?              Help

Export Specific Parameters

-d RootDN       The root of the LDAP search (Default to Naming Context)

-r Filter       LDAP search filter (Default to "(objectClass=*)")

-p SearchScope  Search Scope (Base/OneLevel/Subtree)

-l list         List of attributes (comma separated) to look for in an LDAP

                search.

-o list         List of attributes (comma separated) to omit from input

-g              Disable Paged Search

-m              Enable the SAM logic on export

-n              Do not export binary values

Import Specific Parameter

-k      The import will go on ignoring 'Constraint Violation' and 'Object

        Already Exists' errors

Credentials Parameters

-a      Sets the command to run using the supplied user distinguished name

        and password. For example: "cn=yourname,dc=yourcompany,dc-com

        password" 

-b      Sets the command to run as username domain password. The default is

        to run using the credentials of the currently logged on user.               

这里我们要用到的是:

-r过滤alrecipient不为空的值

-l只列出有用的属性

连起来这个命令就是:

ldifde -f test2.ldf -s <servername>  -r "altRecipient=*" -d "CN=Users,DC=NWTRADERS,DC=MSFT" -l "dn,displayName,altRecipient"

有兴趣的朋友可以自己测试一下,打开test2.ldf文件看看其中的内容吧。

任何问题可以发邮件至lkj5210@hotmail.com讨论。

欢迎批评指正。 J

关于LDIFDE的详细信息,可以参考:

237677  Using LDIFDE to import and export directory objects to Active Directory

http://support.microsoft.com/default.aspx?scid=kb;EN-US;237677

发表于 作者 kejiali | 1 评论
归档在:

GTSC工作手记之八—快快丢掉Exmerge, How to import emails to new mailbox from original mailbox in Exchange Server 2007

Exmerge tool is very useful and important in daily administrative task for every Exchange Server administrator. You won’t believe that, one told me he once pulled a sensitive message from every user’s mailboxes via Exmerge successfully! His manager was very satisfactory to that, however, in Exchange Server 2007, when I tried to, I failed. My god, what is happening to this?

To make that happen, I do some research and local test these days, try to find another way to achieve this. At last, I succeed; Now I would like to share my findings with all of you.

In Exchange Server 2007, a command line named import-mailbox and export-mailbox is very useful. Let’s separate it case by case.

Export-mailbox:

You can export mailbox data from a mailbox to a .pst file. To export to a .pst file, you must use the PSTFolderPath parameter to specify the path to the .pst file to which data will be exported.

You can use the Export-Mailbox cmdlet to export data to either a folder or a .pst file. The source and target mailboxes must exist on a server that is running one of the following versions of Microsoft Exchange:

  • Exchange Server 2007
  • Exchange Server 2003 SP2 or a later version
  • Exchange 2000 Server SP3 or a later version

Note, you cannot export data to a .pst file from a mailbox that is in a recovery storage group (RSG).

You can merge the data that you export into an existing target folder by using the AllowMerge parameter. Also, you can use the Export-Mailbox command to delete associated messages or to include associated messages in the export process. Associated messages contain hidden data with information about rules, views, and forms.

If you use the DeleteContent parameter and do not specify the TargetMailbox parameter, you can delete content from the source mailbox without exporting it to another mailbox.

You can filter the messages that are exported based on recipients and senders. To filter on recipients, use the RecipientKeywords parameter. To filter on the sender, use the SenderKeywords parameter.

By default, the Export-Mailbox command exports all empty folders, special folders, and subfolders to the target location. Such as Inbox, Deleted Items, Drafts and so on.

You must specify a destination mailbox by using the TargetMailbox parameter. You must also specify a folder on the destination mailbox where you want to export data by using the TargetFolder parameter. The TargetFolder parameter specifies the top-level mailbox folder that will be created on the destination mailbox. This folder will contain a subfolder called Recovered Data - <source mailbox alias> - <date time stamp>. The subfolder contains the exported folders and messages within those folders.

If the target folder that you specify already exists on the target mailbox, the exported data will be added to the existing folder. If the target folder does not exist, it will be created.

OK, I guess you are excited based on above analyzing, hmm, let’s begin:

Before we begin, please remember: to perform this, the account you use must be delegated the following:

  • Exchange Server Administrators role and local Administrators group for the source server and the target server
  • Full access to the source and target mailboxes

To grant full access to a mailbox, use the Add-MailboxPermission command.

Begin:

1, Create a new mailbox for special user

2, Open Exchange Management Shell, type:

Export-Mailbox –Identity <old mailbox name> -TargetMailbox <the new mailbox you just created > TargetFolder Myfolder

 

And then, type A to confirm this.

Wait for a while.

Done, please go to the new mailbox to see what happened. J

 

Wonderful power shell, wonderful Exchange Server, I believe you will like it.

Please let me know if anything unclear or anything else, send emails to lkj5210@hotmail.com to do further discussion with me.

That’s all, have a nice day. J

Thanks.Smile

发表于 作者 kejiali | 3 评论
归档在:

推荐大家登录微软中国官方论坛

微软中国官方的论坛已经上线有一段时间了,收到了大家的一致好评,这里有

  • 微软 .NET 俱乐部(INETA)
  • TechNet 解决方案应用论坛
  • TechNet 动手实验室
  • IT Pro City相聚同城赞助计划
  • Windows Vista
  • Windows XP
  • Microsoft office system
  • Office Business Application
  • Visual Studio 相关讨论
  • Visual Basic
  • Exchange Server
  • Office Live Meeting

等一系列板块,有很多资深的Support Engineer,MVP,MCT等专家在其中,为大家解答问题,分享最新的技术,把握技术前沿,畅享技术新体验,让更多的用户了解微软技术,喜欢微软的产品。

推荐大家上去看看,一定会有不错的收获。

兄弟我在Exchange Server板块为大家服务,也希望通过这个板块能够结识更多的朋友。

附站点链接:

主页:http://forums.microsoft.com/china/default.aspx?ForumGroupID=455&SiteID=15

Exchange Server 板块:http://forums.microsoft.com/china/ShowForum.aspx?ForumID=1710&SiteID=15

 

发表于 作者 kejiali | 390 评论

今天收到了MVP大礼包

今天收到了MVP大礼包,贴在这里跟大家一起分享咯。

礼包内除了MVP证书和卡片之外,还有一个蓝牙耳机,呵呵,还真是不错,下面是图片。

不好意思,由于是手机拍照的,而且光线很差,效果不是很好,抱歉,大家凑合着看吧。

             蓝牙耳机

              标识我身份的卡片,MVP Card

          Certificate

再次感谢Microsoft MVP Program! 同时恭喜其他获奖的MVP们,也祝愿能够有原来越多的“技术雷锋”加入到我们这个大家庭!:)

祝大家周末快乐!

 

 

发表于 作者 kejiali | 733 评论
归档在:

GTSC工作手记之七--深入理解Exchange Server 2007 MESSAGING RECORDS MANAGEMENT (MRM)

Exchange Server 2007中的Messaging Records Managemant是新一版Exchange 中引入的一项重要的功能,这个功能允许你对用户的邮箱中的邮件等条目进行管理,例如关于某一个项目的邮件会自动移动至一个Customize Folder中,超过60天的邮件会自动删除至Deleted Items folder中,在Exchange Server 2003中,虽然有类似的功能,例如删除邮件的功能,但是如果真正上升至管理邮件策略的高度,Exchange Server 2003在这一方面明显是心有余而力不足,让我们来看看在Exchange Server 2007中都能够实现哪些MESSAGING RECORDS MANAGEMENT的 功能以及如何实现吧。

1. 为什么MESSAGING RECORDS MANAGEMENT很重要。

当今,法律、法规或公司政策要求许多组织应用邮件策略,以便限制组织内部和外部的收件人和发件人之间的交互。除了对个人、组织内部的部门小组以及组织外部的实体之间的交互进行限制以外,某些组织还要满足下列邮件策略要求:

  • 防止不适当的内容进入或离开组织
  • 筛选机密组织信息
  • 对特定个人发送或接收的邮件进行跟踪或存档
  • 在传递之前重定向入站和出站邮件以便进行检查
  • 对通过组织的邮件应用免责声明

MGM可以帮助管理员使组织内的邮件更好的遵循法律规范,可以对邮件进行分类管理,并且可以提供一定的日志供我们查询或者供一些机构查询

2. 如何来创建自定义的文件夹。

关于这一点,首先可以打开Exchange Server 2007的Console,定位至:Organization Configuration -->Mailbox,然后新建一个New Managed Custom Folder.我们还可以为这个文件夹起一个好听的名称,以及在Display the following comment when the folder is viewed in Office Outlook输入一些描述性的文字,如果你希望这个策略强制执行,还可以选中:Do not allow users to minimize this comment in Outlook。

 

在我们创建好New Managed Custom Folder之后,我们还需要创建Messaging Records Management content settings给这个Managed Custom Folder,比如我可以选择这个文件夹内的邮件要保持731天而不被删除,Length of retention period (days)=731, 到达731天之后要完全删除:Action to take at the end of the retention period drop-down list --> Permanently Delete.

 

完成以上两步之后,还要将这个policy link至用户的邮箱,这样才可以生效,我们可以打开Exchange Server 2007的Console,定位至:Recipient Configuration,选择一个用户,给他link我们的policy.

 

 

成功完成如上步骤之后,你可以使用Start-ManagedFolderAssistant –mailbox mailboxname 来查看指定用户的邮箱有哪些policy。

如上步骤完成之后,我们还需要给这个policy设置一个运行时间,可以在Command Shell中输入如下命令:

set-mailboxserver -id <mailboxserver> -ManagedFolderAssistantSchedule "Sun.12:00-Sun.11:00"

然后我们手工重启mailboxassistants服务:

net stop msexchangemailboxassistants

net start msexchangemailboxassistants

如果想立刻运行可以使用这个命令:

Start-ManagedFolderAssistant –mailbox mailboxname

如果设置,运行正常,登录这个用户的邮箱,在Outlook中会看到如下的画面:

 

总结一下,这几个步骤可以用下图来表示:

 

 

这样最终用户的邮箱与Content Settings, Managed Folders, Mailbox Policies就关联起来了。

 

3. 为什么在Message Type中没有email type? Message Type究竟定义了哪些?

这个问题是一个细心的朋友发现的,如下图:

 

那么我们分别来看看Message Type中的这些定义具体含义是什么?

需要说明的是,Managed content settings可以应用于Managed Folder,也可以应用于Default Folder,比如Inbox等,我们也可以为不同的Messages类型应用不同的content settings,如果有多个content settings,特殊的设置总是会取代全局设置,比如,All Mailbox Content有一个全局设置,此外还有一个Content Settings是应用于Voice mail,那么Voicemail policy应用voice mail, 全局设置应用于其他除Voicemail policy的messages.

那么,这里为什么没有email呢?

这位热心和细心的朋友发来邮件告诉了我他的测试结果,他发现SP1 Beta 版有这个设置了,并且截图给我看。

 

但是他同时指出,虽然他选择了E-mail这个类型,但是在实际测试的时候,发现Meeting Request还是会被进行操作。

看到这里,可能不少朋友都有一点疑惑了,到底Managed Content Settings中的Message type是怎么运作的呢?

这里需要指出几点:

1, SP1尚属于测试阶段,我无法保证真正release的时候还会有哪些具体的变化。

2, 未接受的Meeting Request本质上就是一种message,选择emails实际上就是要对所有的messages进行动作,Meeting Request也在其中。

3, 请教了一些资深的工程师后,得知在设计的时候,这里你选择emails,就会对Meeting Request进行操作的,这是设计导致。

问题到这里似乎并没有结束,很多人问,对于企业真正要部署MESSAGING RECORDS MANAGEMENT (MRM)的时候,有没有一些Best Practise?

根据我们的经验,大家可以参考以下的一些建议:

1, 遵循法律,组织要求

2, 对于不同的Message Type(如voice emails)生成不同的Content Settings

3, 如果试图对Inbox内的邮件进行动作,在选择Length of retention period (days)时,个人建议设置为60天以上。

4, 建立多个Managed folders,将各类邮件设置不同的过期时间以及保存时间,分门别类的隔离。

5, 根据组织内的要求以及客观条件,设置不同的运行时间,保持系统的稳定和运转正常。

由于对Exchange Server 2007学习的时间和深度有限,关于MESSAGING RECORDS MANAGEMENT (MRM)只能谈到这些,希望能对大家部署Exchange Server 2007有所帮助。

欢迎大家发电子邮件至lkj5210@hotmail.com讨论,也欢迎在这里回帖提问,谢谢!

发表于 作者 kejiali | 1141 评论
归档在:

大话组策略与注册表

本文仅在ITECN上发表,谢绝转载! 欢迎大家批评指正!

组策略想必每一位IT专业人士都是耳熟能详的名词,我们知道,组策略可以自定义一些你需要的设置,其根本是会去修改注册表相关的键值来实现最终的功能。

可是,如果我们若想实现一个功能,通过组策略间接修改注册表和直接修改注册表的位置是否相同?如果不相同,二者发生冲突,哪一个有更高的优先权呢?本文围绕这两个问题来阐述,希望能够解开大家心中的疑惑。

这里我们以一个模拟场景为例。

当我们在Outlook当中新建一个约会的时候,我们可以选择“重复周期”,如下图。

注意:这里有一个“重复范围”,默认是“无结束日期”,我们可以通过修改组策略将此更改为默认几天后结束,比如你修改为3,那么默认这里会设置为“3天之后结束”。

这时当你再打开Outlook,新建一个约会-->全天事件的时候会发现,默认的“重复周期”被修改为了N天之后,N值为你在组策略中修改的值。

如果你有兴趣的话,可以用ProcessMon去监测当你在修改组策略的时候,具体是操作的哪一个注册表键值,如下图所示。

其实仔细观察这个注册表的位置,你会发现有这样的特点(注意标红的部分):

“HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Group Policy Objects\{BAD2D0C2-6AD0-4628-B32C-465EC6DC1244}User\Software\Policies\Microsoft\Office\11.0\Outlook\Options\Calendar”

那么,若想实现同样的功能,我是否可以直接修改注册表呢?答案是肯定的,但是根据官方KB给出的说法,并不是修改这个位置,而是去修改:

HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Options\Calendar

经过测试,发现的确修改这里也是有效的。

那么,究竟哪一个键值会有更高的优先权呢?让我们来测试一次:

修改HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Options\Calendar为2天,“HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Group Policy Objects\{BAD2D0C2-6AD0-4628-B32C-465EC6DC1244}User\Software\Policies\Microsoft\Office\11.0\Outlook\Options\Calendar”为5天:

结果:结束日期:5天

原来策略部分拥有更高的优先权,当发生冲突时,组策略所操作的键值会最终生效。

这其实也给我们排错提供了一个非常好的思路,当你发现某些设置不生效的时候,可以去检查注册表中组策略所操作的键值,看看是否发生了冲突。这一点,KB中曾经有明确的提示。

有兴趣的朋友可以自己测试一次,我想,印象会更加深刻,测试时要使用一个干净的环境,避免其他因素的干扰带来的测试失败。

欢迎大家提问,指正!

参考资源:

828538  More Than One Local Policy Is in Effect After You Edit Several Local Policies

http://support.microsoft.com/default.aspx?scid=kb;EN-US;828538

 

222283  How to set the default number of meeting recurrences

http://support.microsoft.com/default.aspx?scid=kb;EN-US;222283

发表于 作者 kejiali | 4 评论
归档在:

GTSC工作手记之五---深入邮局协议第三版(POP3)

题记:本文仅在ITECN上发表,谢绝转载! 欢迎大家批评指正...

写在开始:这个系列已经有五篇文章了,承蒙大家的厚爱,这个系列文章得到了大家的支持和持续的关注,我向所有支持和关心我的人表示谢意;同时,我也收到了很多邮件,大部分是关于技术细节的疑问,还有一些朋友对我提出了一些很中肯的意见和建议,这里,我向这些朋友表示由衷的感谢,由于我现在的工作比较忙碌,可能没有做到一一回复,这是我深表歉意的地方,今后我还会尽量回复每一封邮件,并且挑选一些比较精彩的问题贴在ITECN中,与大家一起分享。

我们知道,最简单的邮件系统也需要有两大环节,收信与发信。我们先来简单回顾发信的过程,

而用户可以通过多种方式向Exchange服务器提交邮件,例如使用Office Outlook MAPI的方式将邮件提交至Information Store中,也可以使用Outlook Express的方式向SMTP服务器直接传送需要发送的邮件,这就表明Exchange的SMTP模块在不同情况下承担的角色是不一样的。此外,一次合法的SMTP报文有信封和正文来组成,在传递过程中,邮件每经过一次SMTP服务器就会在这封邮件上留下痕迹,类似一个Stamp,这里需要注意的是同为发件人和收件人,在信封和信头(信头是正文的一部分,正文由信头和信体组成)处都可以存在,并且可以不同。我们可以以SMTP发送邮件的过程来模拟:

Telnet <smtp server ip> 25

mail from:

Rcpt to:

‘以上的mail from和Rcpt to是信封的发件人收件人地址

data

from:

subject:

'以上的from和subject是Outlook用来显示发件人和主题所使用的

一般我们把这两种不同的发件人和收件人称之为p1和p2,BCC(密送)也正是利用了这个原理。

官方给出的p1和p2的定义是:p1 is the 821 address information and p2 is the 822 address infomation,actaully they are both SMTP address, but for different purpose,p1 is used for delivery, p2 used for display.

上文我们简单回顾了发送邮件的过程和基本概念,如果大家对这个位置不是理解很深入的话,推荐去technet library中看看Transport Architecture部分,相信会有更加深入的理解。

收邮件的过程,如果你使用的是Outlook Cache Mode或者Online Mode的话,那么这个过程更像是一个"Synchronize"的过程,这个我会在今后的文章中跟大家详细讨论,还有两种协议,也是我们经常使用的,一个就是POP3收邮件,还有一个就是IMAP4收邮件,很多初学者会将这两种协议混淆,认为POP3是收邮件使用的协议,IMAP4是发邮件的协议,其实并不是这样的,这里,我选取一段微软官方的教材来简单描述POP3和SMTP的定义。

  • SMTP was designed originally for transmitting messages between continuously accessible multi-user hosts on a network. SMTP is a push mail protocol, in which the sender initiates the communication at their discretion and expects the receiving host to be continuously available. Host based systems are generally always on-line and SMTP was developed in that environment.
  • In today’s network environment, most users have computers instead of terminals, and expect their emails to be delivered to their PCs. Thus, Post Office Protocol (POP) was developed. POP is a pull mail protocol. in which the receiving host requests the emails at their own discretion.
  • The POP3 protocol does not include any commands to send or push a message to the server. As such it can only be used to download messages from a server. It is sometimes referred to as a read only protocol. For a POP3 client to send a message it must use the SMTP protocol, which does contain commands to send messages. In this case the software is acting as an SMTP client, not POP3.

从上述的描述中我们可以看出,POP3主要是download邮件的,发邮件还是要有SMTP协议的。

还有一点需要注意,POP3同样也是一种服务器/客户端协议,C/S模型,也就是说,一个完整的POP3模型其实是由POP3 server和POP3 client构成的。注意,默认情况下,Exchange Server上的POP3服务是disable的,需要手工启用并启动。

很多人会发邮件询问,呵呵,其实准确的说是抱怨,说POP3收邮件或者说是下载邮件经常出问题,典型的问题就是邮件被下载多次,害得用户需要手工再删除,这究竟是为什么呢?不要走开,广告之后继续。^_^

<广告>很多读者对网络抓包和分析分析很感兴趣,发邮件询问,有什么可以推荐的工具,我认为,不同的工具有不同的优势,而且跟每一个人的习惯也是不同的,我经常使用的有以下三种:

1. Microsoft NetMon,这是老牌的抓包工具了,使用群体也很多,而且是免费的,微软网站最新版本是3.1,大家可以到以下位置去下载:

Microsoft Network Monitor 3.1 

http://www.microsoft.com/downloads/details.aspx?FamilyID=18b1d59d-f4d8-4213-8d17-2f6dde7d7aac&DisplayLang=en

2. ethereal 这是一个更加强大的网络包抓取和分析器,拥有所有抓包分析工具的优势和特性,最酷的是可以follow TCP,可以更加清晰的去分析TCP的流程,发现问题所在

3. wireshark 这是我最喜欢使用的,我个人感觉是ethereal的改良版,据说作者就是原ethereal的作者,也拥有follow TCP的功能,而且内置Wincap.大家可以去免费下载体验一把。

<从广告中回来>

一个正常的POP3会话过程,如果你用网络抓包或者嗅探工具去分析的话,你会看到这样的log:

 

2007.08.11 01:59:53 <<<< Logging Started (level is LTF_TRACE) >>>>
2007.08.11 01:59:53 10.0.0.1: Synch operation started (flags = 00000001)
2007.08.11 01:59:53 10.0.0.1: UploadItems: 0 messages to send
2007.08.11 01:59:53 10.0.0.1: Synch operation completed
2007.08.11 01:59:53 10.0.0.1: Synch operation started (flags = 00000030)
2007.08.11 01:59:53 10.0.0.1: DoPOPDownload(flags = 00000030, max msg = ffffffff): full items
2007.08.11 01:59:53 POP3 (10.0.0.1): Begin execution
2007.08.11 01:59:53 POP3 (10.0.0.1): =========  Initial blob   =========
2007.08.11 01:59:53 POP3 (10.0.0.1):     &BAAgWHBAAAAAUvhmkoK8puOk5w1YAKAXl
2007.08.11 01:59:53 POP3 (10.0.0.1):     &BAAwWHBAAAAAUvhmkoK8puOk5w1YAKAXl
2007.08.11 01:59:53 POP3 (10.0.0.1): ===================================
2007.08.11 01:59:53 POP3 (10.0.0.1): Port: 110, Secure: no, SPA: no
2007.08.11 01:59:53 POP3 (10.0.0.1): Finding host
2007.08.11 01:59:54 POP3 (10.0.0.1): Connected to host
2007.08.11 01:59:54 POP3 (10.0.0.1): <rx> +OK Microsoft Exchange Server 2003 POP3 server version 6.5.7638.1 (PrimaryDC1.contoso.msft) ready.
2007.08.11 01:59:54 POP3 (10.0.0.1): Authorizing to server
2007.08.11 01:59:54 POP3 (10.0.0.1): [tx] USER administrator
2007.08.11 01:59:54 POP3 (10.0.0.1): <rx> +OK
2007.08.11 01:59:54 POP3 (10.0.0.1): [tx] PASS *****
2007.08.11 01:59:54 POP3 (10.0.0.1): <rx> +OK User successfully logged on.
2007.08.11 01:59:54 POP3 (10.0.0.1): Authorized to host
2007.08.11 01:59:54 POP3 (10.0.0.1): Connected to host
2007.08.11 01:59:54 POP3 (10.0.0.1): [tx] STAT
2007.08.11 01:59:54 POP3 (10.0.0.1): <rx> +OK 1 792
2007.08.11 01:59:54 POP3 (10.0.0.1): [tx] UIDL
2007.08.11 01:59:54 POP3 (10.0.0.1): <rx> +OK
2007.08.11 01:59:54 POP3 (10.0.0.1): <rx> 1 AAAXHBAAAAAUvhmkoK8puOk5w1YAKAXl
2007.08.11 01:59:54 POP3 (10.0.0.1): <rx> .
2007.08.11 01:59:54 POP3 (10.0.0.1): [tx] LIST
2007.08.11 01:59:54 POP3 (10.0.0.1): <rx> +OK 1 792
2007.08.11 01:59:54 POP3 (10.0.0.1): <rx> 1 792
2007.08.11 01:59:54 POP3 (10.0.0.1): <rx> .
2007.08.11 01:59:54 POP3 (10.0.0.1): ==== Comparing server and local blobs ====
2007.08.11 01:59:54 POP3 (10.0.0.1):     AAAXHBAAAAAUvhmkoK8puOk5w1YAKAXl : new
2007.08.11 01:59:54 POP3 (10.0.0.1):     AAgWHBAAAAAUvhmkoK8puOk5w1YAKAXl : gone
2007.08.11 01:59:54 POP3 (10.0.0.1):     AAwWHBAAAAAUvhmkoK8puOk5w1YAKAXl : gone
2007.08.11 01:59:54 POP3 (10.0.0.1): ==========================================
2007.08.11 01:59:54 POP3 (10.0.0.1): [tx] RETR 1
2007.08.11 01:59:54 POP3 (10.0.0.1): <rx> +OK
2007.08.11 01:59:54 POP3 (10.0.0.1): Do deletions: LoS: no
2007.08.11 01:59:54 POP3 (10.0.0.1): [tx] DELE 1
2007.08.11 01:59:54 POP3 (10.0.0.1): <rx> +OK
2007.08.11 01:59:54 POP3 (10.0.0.1): Disconnecting from host
2007.08.11 01:59:54 POP3 (10.0.0.1): [tx] QUIT
2007.08.11 01:59:54 POP3 (10.0.0.1): <rx> +OK Microsoft Exchange Server 2003 POP3 server version 6.5.7638.1 signing off.
2007.08.11 01:59:54 POP3 (10.0.0.1): Disconnected from host
2007.08.11 01:59:54 POP3 (10.0.0.1): ========= Updates to blob =========
2007.08.11 01:59:54 POP3 (10.0.0.1):     -BAAgWHBAAAAAUvhmkoK8puOk5w1YAKAXl
2007.08.11 01:59:54 POP3 (10.0.0.1):     -BAAwWHBAAAAAUvhmkoK8puOk5w1YAKAXl
2007.08.11 01:59:54 POP3 (10.0.0.1):     &BAAAXHBAAAAAUvhmkoK8puOk5w1YAKAXl
2007.08.11 01:59:54 POP3 (10.0.0.1): =========   Final blob    =========
2007.08.11 01:59:54 POP3 (10.0.0.1):     &BAAAXHBAAAAAUvhmkoK8puOk5w1YAKAXl
2007.08.11 01:59:54 POP3 (10.0.0.1): ===================================
2007.08.11 01:59:54 POP3 (10.0.0.1): End execution
2007.08.11 01:59:54 10.0.0.1: ReportStatus: RSF_COMPLETED, hr = 0x00000000
2007.08.11 01:59:54 10.0.0.1: Synch operation completed

一次正常的POP3 Session会有以下几个阶段:

  • Authorisation
  • Transaction
  • Update

Authorisation阶段:这个阶段常用到的command有:USER, PASS, AUTH 和QUIT。 这一点我们可以从包中清楚的看到。

Transaction阶段:当Auth阶段成功结束之后,POP3进入了Transaction阶段。这个阶段主要用到的command有:RETR(下载邮件)DELE(删除邮件),注意这一个阶段结束有一个很明显的命令,那就是quit command,如果客户端没有向服务器发出quit命令,这个阶段是无法结束的。

Update阶段:当客户端成功发出quit的命令之后,POP3进入了这个过程,在这一个过程服务器端会释放掉所有在Transaction阶段的Resource,并且提交删除指令,删除服务器上成功已下载的邮件,最后TCP 会话结束。

这里需要注意的一点是:在Update阶段之前的任何delete操作是不生效的,换言之,一次成功的POP3过程三个阶段缺一不可,否则我们不能说POP3过程成功结束。我们来看这样一种场景,在Transaction阶段客户端触发了delete的命令,但是,还没有来得及发出quit命令(前文所述,这个命令很重要)的时候,网络断掉了,那么邮件还是在服务器上,没有成功删除,但这时候邮件已经下载到了本机了,服务器上的邮件还存在,当你再次下载的时候,你就会收到双重邮件。

我在附件中为大家放置了一个Typical POP3 Conversation, 大家可以下载doc文档去参考。

原理性的部分暂时告一段落,下面我们来模拟一些场景:

1. 有时你可能遇到某一封邮件通过OWA查看和MAPI方式去查看都是可以看到的,但就是POP3 download出问题,一直无法下载,直至超时报错退出。这是怎么回事呢?遇到这种问题,我们如何去判断问题发生在哪里呢?这里,我们再来简单看看一封邮件的结构。我们知道,在DATA之后,我们可以传送由ASCII字符组成的邮件流,但是日常的邮件中,我们可能还要用到非ASCII字符,以及附件等等,为了能通过email发送非ASCII数据,IETF定义了多用途Internet 邮件扩充MIME(Multipurpose Internet Mail Extention),如果一封邮件中包含MIME编码的数据,一般会在信头指定MIME版本和分隔符,通过此分隔符来分割不同的MIME内容,不同MIME编码起始之处都会指明这段编码所代表的数据类型和使用的编码算法,方便客户端解码。注意:邮件的生成可能是由一些Microsoft的邮件客户端程序生成,如Outlook,也可能是由第三方的application生成的,如果生成的邮件图文混排,本身application有一定缺陷的话,经常会出现一个问题就是邮件中有不正确的POP3Tail,或者termination sequence(标准的termination sequence应当是CRLF.CRLF,RFC8139定义的),但是客户端如果通过POP3接收邮件又无法去检测termination sequence是corrupted,就会出现邮件无法下载的情况。

遇到这种问题,我们可以在Exchange Server上去启用POP3Tail注册表键值,让Exchange帮我们来检测corrupted的这种邮件,然后修复,这样客户端就可以成功下载了。

大家可以参考下面这篇KB:

816896   POP3 client stops responding (hangs) or times out when you try to download messages in Exchange 2000 Server and in Exchange Server 2003

http://support.microsoft.com/default.aspx?scid=kb;EN-US;816896

 

2. 最后我们再来回到本文开始的那个问题,为什么POP3下载总是无法完成(针对所有邮件)?或者我经常遇到一封邮件收到多次,每次接收明明邮箱中有了,但是还是会下载下来,遇到这种问题我如何界定是网络问题还是其他问题?我怎样去界定呢?

针对如上问题,最好的方法就是通过工具抓网络包然后分析,我们知道,当客户端成功发出quit的命令之后,POP3才能进入Update阶段,之前发出的delete命令才能生效,如果我们在包中发现没有quit这个命令的发出,会话就结束,那么这一次POP3的过程其实是非正常结束的,已经下载的邮件还在服务器上躺着,在这种情况下,你需要来判断是否为网络问题还是其他问题,判断网络问题的方法最直接的就是看,在整个下载过程中,是否出现了Reset,也就是网络重传。

 

如上图所示,我们在网络包中很明显的发现了RST,ACK的字样,这就是最明显的网络重传,而且当时我们也没有在这个包中发现quit的命令,因此可以断定,没有发出quit的命令,所以delete没有生效,邮件还在服务器上,以后下载还会再次下载,而为什么没有发出quit的命令,最直观的就是网络内有TCP包的重传。

问题到这里似乎还是没有结束,为什么会有网络重传呢?当我发现了网络重传,我如何继续排错呢?请看:

“GTSC工作手记”系列之“网络重传(RST)大揭秘”!

 

欢迎大家批评指正!

发表于 作者 kejiali | 69 评论
归档在:

GTSC工作手记之四--深入理解Outlook Protocol

本文仅在ITECN上发表,谢绝转载! 欢迎大家批评指正...

最近做了一个算是比较tough的case,感觉还是蛮有价值的,贴在ITECN中,期与跟大家一起分享。

客户报告说,在IE中打开页面发生了失败,并附加了截图:

 

 

 

 

 

 

 

 

 

 

 

 

请注意地址栏,开始是outlook:\\,这里代表一种outlook的协议,各位可以在开始-->运行菜单中输入outlook:\\,如果你是outlook 2003,这时会自动调用outlook.exe这个application.

但是如果你是outlook 2007,就没有那么幸运了,会弹出如下的对话框:

 

这是为什么呢?KB中给出了很好的解释。

929590          Known issues when you develop custom solutions for Office Outlook 2007

http://support.microsoft.com/default.aspx?scid=kb;EN-US;929590

原因很简单,The Outlook protocol no longer works outside Outlook,

This protocol will only work when you use it in Outlook.You can use this protocol on a folder home page, on the Web toolbar, or in the body of an Outlook item.

简言之,在安装过程中,outlook不会试图去注册这个outlook的协议。

为什么Office Team要取消这个协议的注册呢?还是安全问题,我这里引用了微软官方的一段文字来解释:

There are various attacks which are aided by the outlook:// protocol. This protocol allows attacks to occur by someone browsing to a web site which contains a link (A HREF, IMG SRC, document. location redirect, etc) to the outlook:// protocol. The protocol acts as a big stepping stone to allow for easily exploiting other bugs.

问题到这里似乎是解决了,但是客户还是需要使用这个协议,经过我们的分析,确定了可以增加注册表中HKEY_CLASSES_ROOT的一些items来解决这个问题,当我们跟客户discuss这个action plan的时候,客户首先对我们的research表示感谢,但是还是有一些concern,那就是客户端也许很多,且安装的路径可能有所不同,因此依靠手工导入注册表的方式似乎有一点困难,经我们与CPR商讨,决定使用开机脚本来解决客户的concern:

GTSC的工作氛围就是这样,一切为客户着想,一切以客户满意为准绳,任何一个action plan都要严谨,保证可行性,在测试环境中将出问题的概率降至最低,经过商讨,我们认为有以下一些事情需要注意:

  1. 开机脚本针对计算机生效,也就是startup的script,而客户端是Windows Vista,并且启用了UAC,那么在登陆之前,也就是停留在安全桌面时,UAC的特性会不会block掉这个动作?
  2. 脚本需要加入判断语句,如果客户端运行过一次,这个脚本就不再运行了,直接退出。
  3. 由于客户端安装office的路径可能不同,因此还要让脚本去get HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\Outlook\InstallRoot下install的位置,然后将这个变量传递给下面的脚本,进行修改注册表的动作。

这三个问题我也是请教了很多人,包括国内著名的系统专家,资深desktop方面的专家,彭爱华,盆盆,盆盆认为:注册表内的权限有所区分,并不是说所有修改的动作都需要admin 的权限,如果是修改HKCU的键值,不需要admin,可以通过查询键值的ACL来确定这一点,例如:HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts,这下面有很多键值,就是禁止Current User访问的,可以在试验环境中测试一把;此外,在登陆之前,系统的startup的script是以system的credential来运行的,理论上是可以work的。

经过反复的测试,和研究,脚本终于写成了,贴在这里,供大家参考,也希望大家能多多提出宝贵意见:

免责声明:该代码仅用于技术交流和分享,请勿部署在生产环境中,由于该脚本给您带来的损失,笔者不承担任何责任。任何由于使用或无法使用脚本而带来的损失(包括但不局限于商业利润、业务中断、业务信息或其他财产上的损失),本站及其笔者或涉及内容创建的任何其他人等对任何上述的损失概不负责。

=======================================================

'这里做const的动作,表明是在HKEY_LOCAL_MACHINE下进操作,注意其后的&H80000002在不同位置是有所不同的,变化规律如下:

'const HKCR = &H80000000 ' HKEY_CLASSES_ROOT
'const HKCU = &H80000001 ' HKEY_CURRENT_USER
'const HKLM = &H80000002 ' HKEY_LOCAL_MACHINE
'const HKU = &H80000003 ' HKEY_USERS
'const HKCC = &H80000005 ' HKEY_CURRENT_CONFIG

Const HKEY_LOCAL_MACHINE = &H80000002

'这段代码用于取出office outlook的安装路径,设为strValue1,并传递至下面的脚本

strComputer = "."
Set objRegistry = GetObject("winmgmts:\\" & _
    strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Office\12.0\Outlook\InstallRoot"
strValueName = "Path"
dim strValue1
strValue1 = "C:\Program Files\Microsoft Office\Office12\"
objRegistry.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue1

const HKEY_CLASSES_ROOT = &H80000000
strComputer = "."
Set objRegistry = GetObject("winmgmts:\\" & _
    strComputer & "\root\default:StdRegProv")
strKeyPath = "outlook"
strValueName = "URL Protocol"
objRegistry.GetStringValue HKEY_CLASSES_ROOT,strKeyPath,strValueName,strValue

'这里开始进行判断,也就是说没有运行过就运行,运行过之后退出

If IsNull(strValue) Then

strComputer = "."

'开始修改HKEY_CLASSES_ROOT中的值
Set StdOut = WScript.StdOut
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
strKeyPath = "outlook"
strvalueName = "URL Protocol"
strvalue = ""
oReg.CreateKey &H80000000,strKeyPath
oreg.setstringvalue &H80000000, strKeyPath, strValuename, strValue

strKeyPath = "outlook"
strvalueName = ""
strvalue = "URL:Outlook Folders"
oreg.setstringvalue &H80000000, strKeyPath, strValuename, strValue

strKeyPath = "outlook\DefaultIcon"
oReg.CreateKey &H80000000,strKeyPath
strvalueName = ""
dim strValue2
strValue2 = strValue1 & ",-9403"
oreg.setstringvalue &H80000000, strKeyPath, strValuename, strValue2

'Create "[HKEY_CLASSES_ROOT\outlook\shell]  and @="open""
strKeyPath = "outlook\shell"
oReg.CreateKey &H80000000,strKeyPath
strvaluename = ""
strvalue = "open"
oreg.setstringvalue &H80000000, strKeyPath, strValuename, strValue

'Create [HKEY_CLASSES_ROOT\outlook\shell\open] and @=""
strKeyPath = "outlook\shell\open"
oReg.CreateKey &H80000000,strKeyPath
strvaluename = ""
strvalue = ""
oreg.setstringvalue &H80000000, strKeyPath, strValuename, strValue

'Create [HKEY_CLASSES_ROOT\outlook\shell\open\command] and @="\"c:\\Program Files\\Microsoft Office\\Office12\\OUTLOOK.EXE\" /select \"%1\""
strKeyPath = "outlook\shell\open\command"
oReg.CreateKey &H80000000,strKeyPath
strvaluename = ""
dim strValue3

'这里需要注意几个地方,第一,value data需要带引号,但是我们不能在vbs中直接添加引号,因为这样会被vbs认为是一个常量,我们可以使用转换函数chr将ASCI编码中的引号0x34转换,让vbs识别,从而添加至valuedata中;还有,从installroot中取出的只有:X:\Program Files\Microsoft Office\Office12\这一部分,没有outlook.exe,这一部分,这里需要使用&符号,将变量与常量结合起来,填充至valuedata中
strValue3 = strValue1 & "outlook.exe" & chr(34) & " /select " & "%1"
strvalues = chr(34)& strValue3 & chr(34)
oreg.setstringvalue &H80000000, strKeyPath, strValuename, strValues

wscript.echo "Finished!"

Else
    Wscript.Echo "The registry key exists."
End If

=========================================================

我在测试环境中的vista测试通过,已经交给team中的其他members,让大家黑箱白箱测试,如果没有什么问题的话,可以solution deliverd了,hope everything goes well. ^_^

感兴趣的朋友可以发邮件至lkj5210@hotmail.com索取源码进行调试,也希望诸位高手多提宝贵意见,谢谢大家!

发表于 作者 kejiali | 4 评论
归档在:

GTSC工作手记之三---当你打开ESM遭遇了hang...

本文仅在ITECN上发表,谢绝转载! 欢迎大家批评指正...

关于这个问题,有很多人问过我Root Cause,而且网上流传着各种各样的说法,比如改变DNS会引起这一现象等等,借用ITECN的一席之地总结一下:

首先要说明的是,这个问题90%与你Exhange Server服务器的Performance有关,当打开ESM(Exchange System Management), 尤其是点击server, 数据库等位置的时候,ESM会发送RPC Request到store.exe,注意,有很多人误解了这一点,认为当在其他的member server上去安装Exchaneg Admin Console,打开ESM,才会发送RPC Request到store.exe,事实上并不是这样的。当ESM发送RPC Request到store.exe去query store的status时,store.exe会返回一个status code,表明store可用还是不可用,(mount还是dismount),如果这一过程出了问题,就会导致hang,典型的就是blank cycle。

默认情况下, store.exe在一个thread pool中会有100个RPC worker threads,来handle incoming request,当ESM去query store.exe的时候,store.exe中的某一个threads 会handle这个request. 成功结束之后,worker thread被释放回thread pool。注意:这一个过程是很快的,也必须要求很快,这样才能保证我们的thread pool能够成功handle每一个incoming request。

然而,如果RPC worker threads被block掉,比如,long disk I/O operation, AD query, 或者AV scan,导致没有可用的worker thread来handle incoming request,这时,store.exe会返回RPC TOO BUSY” ,直观现象就是blank cycle。

还有一点需要注意,Exchange Information Store这个服务对disk的性能依赖很大,比如当很多用户send/receive时,有很多的MAPI线程连过来,读取数据提交数据,如果disk的性能不是非常OK的话,最终用户也会遭遇hang,或者是blank cycle,因此disk性能很重要,还有disk的drivers也是值得注意的。

如果您对进程,线程(thread)不是非常明白,推荐访问盆盆的blog,那里有很多的technical details.


欢迎大家跟帖,批评指正! ^_^

发表于 作者 kejiali | 3 评论

重温:活动目录复制 VS 防火墙

题记:这是一个老生常谈的话题,这是一个经常会遇到的话题,这是一个经常被误解的话题,这是一个需要澄清的话题...

AD主要借助RPC(远程过程调用)实现DC之间的数据复制和同步,复杂的RPC不用配置就能良好的工作,但是当一个AD森林跨越内部网络,DMZ和Perimeter这样的环境中时,由于Firewall无法实现得知RPC服务将使用哪些端口,因此简单的事情变得复杂。

注:关于RPC原理,大家可以参考这里:究竟什么是RPC

说到这里,想起来前两天有一位朋友问我,想在Internet上使用公司的Exchange(OWA,POP3,VPN除外),我的回答配置ROH,他答曰,客户端不满足RPC需求,是Windows 2000的,我答曰,基本没有办法实现你的需求了。

1、完全动态的RPC复制:优点:无需配置;缺点:网络安全性是大问题(需要防火墙打开所有高于1023的端口)

2、手工指定RPC通讯的端口:优点:安全;缺点:需要修改注册表进行配置

snap094

注册表键值:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NTDS\Parameters\

新建一个DWORD值,将此设为所需要的端口号(注意:>1024)

配置你的Firewall,打开下面的端口:

snap095

3、使用IPSEC封装进行复制:

优点:安全,简化RPC的传输,具有相互的验证性;通过使用Kerberos或者机器证书,DC可以在交换信息之前做彼此的身份验证。

缺点:两边都需要进行配置

进行配置之前要确定是通过证书进行彼此的身份验证还是使用系统内置的Kerberos进行验证。如果决定是使用系统内置的Kerberos进行验证,要求双方两个DC在一个域内。

注:如果有NAT设备,则无法使用IPSEC,因为NAT设备会修改IP地址,而IPSEC接收端发现源地址被NAT修改则会抛弃发来的数据包。

Firewall需要打开的端口:

snap096

创建IPSEC策略要点:

1.先进行“Manage IP filter lists and filter actions”的设置,添加一个IP Filter List(“我的IP地址”到“特定的IP地址” ; 协议类型:所有)

image

image

此外,还要对Filter Action进行一定的设置.

筛选器操作:协商安全,并且选中“不与不支持IPSEC的计算机通讯”;清除“接受不安全通讯,但总是用IPSEC响应”

image

2.创建IPSEC策略:

(1)命名为“Domain controller replication”.
(2)清除“Activate the default response rule”复选框.
(3)确保“Edit properties” 复选框选中。

(4)使用向导添加IP安全策略,IP Filter List和Filter Action选择刚才我们创建的DC Replication,然后我们可以选择授权的类型(Kerberos 5, CA, 还是域共享密钥)。

3.应用IPSEC

 

为了保证建立成功,可以在创建好我们的IPSEC之后,使用ping来test一下.   :)

Referrence:

Active Directory Replication over Firewalls   http://www.microsoft.com/technet/prodtechnol/windows2000serv/technologies/activedirectory/deploy/confeat/adrepfir.mspx

发表于 作者 kejiali | 4 评论
归档在:

GTSC工作手记三---再谈Process Monitor的妙用

最近听说了一个比较特殊的case,贴在这里,期与大家分享。

客户新购进了一批品牌机,安装好操作系统之后,Microsoft Outlook总是会自己弹出来一个新建邮件的对话框,当时我想到了以下几点:

  1. 病毒。
  2. OEM版设计时导致,有启动脚本要求Outlook弹出来。
  3. 第三方软件导致。

后来换普通非OEM操作系统测试安装,再安装Outlook,不接入互联网都无济于事。

后来用Process Monitor抓log,发现在弹出一个新建邮件的对话框之前,有按键盘F5的动作,这就很奇怪了,为什么没有人为的按F5键盘的动作但是在log中会发现呢(已经排除第三方软件的干扰)?后来想办法禁止了键盘的F5键,还是无效。我们又重新抓了一次Process Monitor的log,仔细分析,发现按下F5键的时候实际上是系统触发了一个"mailto"的动作,哦,问题到这里就不难解释了,"mailto"这个动作肯定会调默认的email程序出来。

问题到这里似乎还是没有根本性的搞清楚,究竟是谁,哪一个进程触发的F5的动作呢?经我们资深的工程师分析,原来是主板的BIOS程序设计时存在缺陷,换了一批机器,重写了BIOS,该问题解决。

虽然是一个比较另类的问题,但是却足以说明Process Monitor的伟大功效!国内资深的系统专家,ITECN站长盆盆也多次对Process Monitor是交口称赞,推荐大家多去使用Process Monitor这个强大的工具!

这里,列出一些参考资源:

(1)最新版本介绍和下载地址:

Process Monitor v1.12
By Mark Russinovich and Bryce Cogswell

Process Monitor is an advanced monitoring tool for Windows that shows real-time file system, Registry and process/thread activity. It combines the features of two legacy Sysinternals utilities, Filemon and Regmon, and adds an extensive list of enhancements including rich and non-destructive filtering, comprehensive event properties such session IDs and user names, reliable process information, full thread stacks with integrated symbol support for each operation, simultaneous logging to a file, and much more. Its uniquely powerful features will make Process Monitor a core utility in your system troubleshooting and malware hunting toolkit.

Process Monitor runs on Windows 2000 SP4 with Update Rollup 1, Windows XP SP2, Windows Server 2003 SP1, and Windows Vista as well as x64 versions of Windows XP, Windows Server 2003 SP1 and Windows Vista.

download:http://www.microsoft.com/technet/sysinternals/utilities/processmonitor.mspx

(2)盆盆老大webcast主讲的Sysinternal课程:

深入研究Windows内部原理系列之五:Windows Sysinternals工具集介绍 
活动 ID: 1032328800
http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032328800&EventCategory=3&culture=zh-CN&CountryCode=CN

(3)Windows Sysinternal Forum:

http://forum.sysinternals.com/forum_topics.asp?FID=19

发表于 作者 kejiali | 129 评论
归档在:
更多内容 下一页 »