Thursday, November 08, 2007

CreateProcessAsUser Function

Creates a new process and its primary thread. The new process runs in the security context of the user represented by the specified token.

BOOL WINAPI CreateProcessAsUser(
__in HANDLE hToken,
__in LPCTSTR lpApplicationName,
__in LPTSTR lpCommandLine,
__in LPSECURITY_ATTRIBUTES lpProcessAttributes,
__in LPSECURITY_ATTRIBUTES lpThreadAttributes,
__in BOOL bInheritHandles,
__in DWORD dwCreationFlags,
__in LPVOID lpEnvironment,
__in LPCTSTR lpCurrentDirectory,
__in LPSTARTUPINFO lpStartupInfo,
__out LPPROCESS_INFORMATION lpProcessInformation
);

Exchange 메모리 사용과 /3GB 스위치

기본적으로 Windows는 총 4GB의 가상 주소 공간을 주소 지정할 수 있습니다. 기본적으로 이 중 2GB는 커널(운영 체제)용으로 예약되고 나머지 2GB는 Exchange 같은 사용자 모드 프로그램용으로 예약됩니다.

운영 체제의 Boot.ini 파일에 /3GB 스위치를 추가하면 사용자 모드 프로그램에 3GB의 공간을 제공하고 커널을 1GB로 제한하도록 가상 주소 공간 분배가 다시 할당됩니다. /3GB 스위치는 사서함 저장소나 공용 폴더 저장소가 있는 컴퓨터에서만 필요합니다. 사서함 저장소나 공용 폴더 저장소가 없는 컴퓨터에서는 이 스위치를 사용하지 않는 것이 좋습니다.

중요 다음 운영 체제에서만 /3GB 스위치를 사용하십시오.
• Microsoft Windows Server 2003 Datacenter Edition
• Microsoft Windows Server 2003 Enterprise Edition
• Microsoft Windows 2000 Advanced Server
• Microsoft Windows 2000 Datacenter Server
• Microsoft Windows NT 4.0 Enterprise Server
주의 Microsoft는 Active Directory에서 사용할 수 있도록 제작 환경의 Microsoft Windows Server 2003 Standard Edition에서 /3GB 스위치 사용을 지원합니다. 제작 환경에서 이 기능을 사용할 때 Microsoft Exchange Server 2003이 지원됩니다. 그렇지 않은 경우 Windows Server 2003 Standard Edition에서 /3GB 스위치는 개발 및 테스트용으로만 사용됩니다.

다음 운영 체제에서는 /3GB 스위치를 사용하지 마십시오.
• Microsoft Windows 2000 Server
• Microsoft Windows NT 4.0 Server
Windows 2000 Server와 Windows NT 4.0 Server에서는 사용자 모드 프로그램에 최대 2GB만 할당할 수 있습니다. Windows 2000 Server나 Windows NT 4.0 Server에서 /3GB 스위치를 사용하면 커널용으로 1GB와 사용자 모드 프로그램용으로 2GB가 할당되어 1GB의 주소 공간이 손실됩니다.

이런 메모리 부족이 발생하면 가상 메모리 조각화가 발생하여 문제를 information store 서비스가 비정상 동작하게 된다.

관련 성능 카운터
(1) MSExchangeIS - VMLargest Block Size
가상 메모리의 가장 큰 free block 크기를 byte 크기로 알려 줍니다.
이 값이 32MB 이하가 되면 9582 이벤트가 경고로 발생하고
16MB 이하가 되면 에러로 이벤트가 남게 됩니다.
이 값은 32MB 이하로 내려가서는 안 됩니다.
(2) MSExchangeIS – VM Total 16mb Free Blocks
16MB 이상의 가상 메모리 블록의 개수를 나타내고 1 밑으로 값이 떨어져서는 안 됩니다.
(3) MSExchangeIS – VM Total Free Blocks
크기와 상관없이 가용한 가상 메모리 블록크리의 총 개수를 나타냅니다.
역시 1 밑으로 값이 떨어져서는 안 됩니다.
(4) MSExchangeIS – VM Total Largest Free Block Bytes
16MB 이상이ㅡ 크기를 가지는 가상 메모리들만의 총 바이트 입니다.
50MB 밑으로 떨어져서는 안 됩니다.

관련 성능 카운터의 임계치를 넘어서면
이벤트 9582를 발생시킨다. 해당 이벤트를 만나면 서비스를 재시작하여 큰 문제를 막아야 한다.

Tuesday, November 06, 2007

Microsoft Exchange Server 2003 복구 저장소 그룹 사용

Exchange Server 2003에서 복구 저장소 그룹 기능을 사용하면 원래 데이터베이스와 동일한 서버나 같은 Exchange 관리 그룹의 다른 Exchange 서버에 Exchange 사서함 데이터베이스의 추가 복사본을 탑재할 수 있습니다. 이 작업은 원래 데이터베이스가 실행되고 있고 클라이언트를 처리하고 있는 동안에도 수행할 수 있습니다. 복구 저장소 그룹은 재해 복구 시나리오에서도 유용하게 사용될 수 있습니다. 이 설명서에서는 복구 저장소 그룹이 배포 시 유용한지 여부를 확인하는 방법, 복구 저장소 그룹을 설정하는 방법 및 일반적인 문제를 해결하는 방법에 대한 정보를 제공합니다.

Monday, November 05, 2007

How to enable SMTP Authentication using System.Web.Mail

인증을 필요로 하는 SMTP서버를 사용하기 위해서는 코드 수정을 필요로 합니다.

SUMMARY
This article describes how to send e-mails from a .NET application through an SMTP server that requires authentication.
Back to the top

SYMPTOMS
Exchange Server requires, by default, authenticated users to send mail messages via SMTP. If you are developing a .NET application you will find that System.Web.Mail does not contain an API that allows you to provide credentials for connecting to an SMTP server. System.Web.Mail internally calls Microsoft® Collaboration Data Objects CDOSYS. SMTP Authentication is possible by defining configuration settings using the Configuration object associated to the Message CDO object.


Back to the top

MORE INFORMATION
The System.Web.Mail namespace provides an API that enables you to create and send messages using the CDOSYS (Collaboration Data Objects for Windows 2000) message component. The mail message is delivered through an SMTP server.
Most of the SMTP servers installations requires authentication. The main reasoning for this is due to people abusing SMTP servers for SPAMing (i.e., sending out unsolicited junk mail).
The System.Web.Mail namespace classes don't expose an API for providing credentials to an SMPT server. Anyway you can achieve this by defining configuration settings for the Configuration object associated to the Message CDO. Configuration settings are made up of a set of fields (properties) that are simply name/value pairs. Most configuration fields used for messaging are in the http://schemas.microsoft.com/cdo/configuration/ namespace.
You can set fields to the message by adding them to the System.Web.Mail.MailMesage.Fields collection.

CDO Fields for configuring SMTP Authentication
To configure Message objects, you modify fields in the associated Configuration object. Most of the field names reside in the http://schemas.microsoft.com/cdo/configuration/ namespace:
• smtpserver: SMTP server name.
• smtpserverport: SMTP server port (default: 25).
• sendusing: cdoSendUsingPort, value 2, for sending the message using the network.
• smtpauthenticate: Specifies the mechanism used when authenticating to an SMTP service over the network. Possible values are:
- cdoAnonymous, value 0. Do not authenticate.
- cdoBasic, value 1. Use basic clear-text authentication. When using this option you have to provide the user name and password through the sendusername and sendpassword fields.
- cdoNTLM, value 2. The current process security context is used to authenticate with the service.
• sendusername: User name
• sendpassword: Password

How to use the Rule.dll sample to create an inbox rule in Visual Basic

The rules that are added in this sample function review all incoming messages. If the message subject includes the word "test", a reply message is sent and the original message is deleted.

특정 메일 계정으로 오는 메일의 제목에 test 라는 단어가 포함되어 있으면 회신 메세지를 보내고 동시에 수신 메세지를 지워는 규칙을 프로그램을 통해 규칙으로 만들 수 있다.