Friday, January 19, 2007

[Windows Vista] COM Surrogate has Stopped Working

노트북에 Windows Vista Ultimate를 11월에 설치 했다...
노트북 사양(센트리노 1.1, 1GB 램, 5400RPM 하드)이 떨어져서 포기할까도 싶은데 일단은 그냥 쓰기로 했다. 현재 별도의 작업을 하고 있지 않아 큰 문제는 만나지 못했는 데... 가끔 탐색기를 쓸 때 제목과 같은 문제를 많이 만나게 된다... 별도로 하는 것도 없는 데....^^;

고민을 해 보니 동영상 전용 머신정도이기 때문에...코덱의 문제로 보게 되었다.
Windows Vista의 경우 Shell(?) 에서 미리 해당 동영상을 보여주는 미리보기 기능이 있기 때문에 영화 보려고 해당 파일을 탐색기에서 볼때 문제를 발생시키는 것 같아...

"K-Lite-Codec"을 설치하니 다시는 이런 문제가 보이지 않는 다.

Thursday, January 18, 2007

HTTP 연결을 Outlook Web Access 클라이언트용 HTTPS로 리디렉션하는 방법

How to redirect an HTTP connection to HTTPS for Outlook Web Access clients

OWA 로 접속시 꼭 HTTPS로 사용하게 하고 싶을 때 리다이렉션 페이지를 만들어 구성하는 것이 좋은 방법으로 보인다.

Microsoft의 문서를 보면 HTTP로 오는 경우 403.4 오류 : SSL Require를 발생 시켜 리다이렉션 페이지가 호출되게 하는 것을 소개한다.

OwaHttps.asp 를 작성한다.
<%
If Request.ServerVariables("HTTPS") = "off" Then
Response.Redirect "https://" & Request.ServerVariables("HTTP_HOST") & "/Exchange"
End If
%>

해당 파일 인증및 액세스 제어에서 익명 액세스가 가능하게 한다.


가상 디렉터리 Exchange의 등록정보의 사용자 지정 오류 탭을 눌러 403.4를 새로 추가한 OwaHttps.asp 를 지정한다.(URL) 그리고 보안탭의 보안통신 채널 필요로 하여 SSL을 선택한다.



확인을 누르고
http://owa.abc.com/exchange 하면 SSL Require가 발생하면서 https://owa.abc.com/exchange 로 리다이렉션 된다.

마지막으로 간혹 리다이렉션 페이지를 찾지 못하는 오류가 생길 수 있다.
해당 페이지의 등록 정보를 보면 exprox.dll 이 등록되어 있다. 순수하게 리다이렉션 만을 목적으로 한다면 지워야 이 문제가 해결된다.

How to enable SMTP Authentication using System.Web.Mail

Active Directory에서 그룹 소속원에게 메일을 보낼 수 있다.
하지만 외부에 메일 주소가 노출되면 스팸에 시달리는 것은 시간문제다.

그래서 메일 서버의 그룹 정보에 "인증필요"로 해서 외부의 메일은 거부하게 한다.

여러 시스템이 존재하는 경우 다른 서버에서 메일을 보내오는 경우가 있는 데
이 경우면 기존 설정에 위배되기 때문에 문제가 발생한다.

해서 인증을 넣어 메일을 보내야 한다.(여기서 인증은 아웃룩 쓸때 암호를 넣는 것과 같다.)

C#의 경우
using System;using System.Web.Mail;namespace SMTPAuthentication{ public class SMTPAuthenticationExample {
public static void SendMail()
{
string smtpServer = "smtp.domain.com";
string userName = "johnDoe";
string password = "pass";
int cdoBasic = 1;
int cdoSendUsingPort = 2;
MailMessage msg = new MailMessage();
if (userName.Length > 0) {
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", smtpServer);
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", 25) ;
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", cdoSendUsingPort) ;
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", cdoBasic);
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", userName);
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", password);
}
msg.To = "someone@domain.com";
msg.From = "me@domain.com";
msg.Subject = "Subject";
msg.Body = "Message";
SmtpMail.SmtpServer = smtpServer;
SmtpMail.Send(msg); } }}

Telnet의 경우
꼭 아이디와 비번은 Base64로 인코딩해야 한다.
220 ALAN.CP.com Microsoft ESMTP MAIL Service
ehlo
250 ALAN.CP.com Hello [10.10.1.1]
more... verbs
250 OK
auth login
334 VXNlcm5hbWU6
Z3V5dA==
334 UGFzc3dvcmQ6
UGaF1bGluZTEz
235 2.7.0 Authentication successful.

mail from: guyt@exchguy.com
250 2.1.0 guyt@exchguy.com....Sender OK
rcpt to: administrator@cp.com
250 2.1.5 administrator@cp.com
data
354 Start mail input; end with .
Please send cheque soonest
.
250 2.6.0 Queued mail for delivery

PL/SQL의 경우 구글 검색 결과
utl_smtp.helo(l_connection, 'ALAN.CP.com');

-- SMTP AUTH Login
utl_smtp.command ( l_connection, 'ehlo' );
utl_smtp.command ( l_connection, 'auth login' );
utl_smtp.command ( l_connection, utl_raw.cast_to_varchar2 (utl_encode.base64_encode@hddrts (utl_raw.cast_to_raw ( v_username ))));
utl_smtp.command ( l_connection,utl_raw.cast_to_varchar2 (utl_encode.base64_encode@hddrts (utl_raw.cast_to_raw ( v_password ))));

utl_smtp.mail(l_connection, p_from);
utl_smtp.rcpt(l_connection, p_to);

그 외는 검색하면 나올 것이다.

Friday, January 12, 2007

Download Virtual Server 2005 R2 for Free

Virtual Server 2005 R2 가 무료로 공개되고 있다니...VMWARE가 무료로 바뀌었다고 하는 데 무섭구나...

The full software for 32-bit and 64-bit versions is available as a free download. Register to pre-order a CD (available May 2006) or to download the full software.

Related Resources

Virtual Server Downloads

Register for Virtual Server 2005 R2 Enterprise Edition Redistribution Rights

Download or Order Virtual Server 2005 R2 Enterprise Edition for Free

Virtual Server 2005 R2 - Enterprise Edition

Active Directory User 최근 암호 변경일 가져 오기

메일 서버를 관리하다 보니 이상한 요구 사항을 많이 받게 된다. 물론 최근 암호 변경일 확인은 이상한 요구는 아니지만 해 보면서 왜 이렇게 저장을 했을 까 하는 의문이 생긴다.
AD에 사용자의 정보를 보기 위해 ADSIEDIT를 사용하게 되는 데 글을 안올린 동안 많이 쓸 기회가 생겼다. Microsoft SQL 2000에 쿼리분석기(SQL Query Analyzer)가 있다면 Active Directory에는 ADSIEDIT….?
ADSIEDIT는 Windows 설치 CD의 SUPPORT\TOOLS 폴더에 있는 SUPTOOLS.MSI를 실행하여 Windows Support Tools을 설치 하면 된다.

SQL> SELECT * FROM USER_TABLE WHERE PwdLastSet > ‘2007-01-12’
LDAP> (&(objectCategory=user)(pwdLastSet<=128126880000000000))

위와 같이 LDAP쿼리를 던지면 조건에 맞는 마지막 비밀번호 변경일을 확인 할 수 있다.
여기서 AD의 사용자 Attribute에 들어가는 pwdLastSet은 Windows 파일 시간이 들어가며 MSDN에는 아래와 같이 설명하고 있다.

Windows 파일 시간은 UTC(지역 표준시) 서기 1601년 1월 1일 자정(12:00) 이후로 경과한 100나노초 간격 수를 나타내는 64비트 값입니다. Windows는 파일 시간을 사용하여 응용 프로그램에서 파일을 만들고, 액세스하고, 쓴 시간을 기록합니다.

마지막으로 코드상에서 비교를 원하는 시간은 아래 코드와 같이 해서 가져올 수 있다.

Dim CompareDate As DateTime
CompareDate = CType(args(0), DateTime)

Dim fTime As Long
fTime = CompareDate.ToFileTimeUtc

Console.WriteLine("DateTime : " & CompareDate.ToShortDateString())
Console.WriteLine("FileTimeUTC : " & fTime.ToString())