Tuesday, September 30, 2008

Automatically send out emails, 50 mails per cycle


<script type="text/javascript">
/**
*@description pause( iMilliseconds ) Cause the single Javascript thread to hald/pause/sleep/wait for a specified period of time, by opening in modalDialog window (IE only) that modally locks the browser until it returns. This modal dialog is not opened to any page, but uses the Javascript: protocol to execute a javascript setTimeout. In this modal context the setTimeout, has the desired affect of preventing any other script execution. The sole purpose of the timeout execution script is to close the modal dialog which will return control/unluck the browser. The intention was to find a way to allow the UI to be updated and rendered in the middle of function/method without the need to split the method up, remove nested calls, or use closures. Used in this fashion to update the UI, a 0 (zero) is usually passed (or optionally omitted altogether) so that the only delay is for the UI to render.
*@version Note Please be aware that the user interface WILL update its rendering (if you've made and DOM/CSS/Text changes they will appear) and this may significantly slow down program execution if looping.
*@keywords pause sleep wait halt javascript show modal dialog set timeout multi-threaded single thread
*@version 1.2
* @param {Object} iMilliseconds [optional] the number of milliseconds the code will pause before returning - If no value is passed the code will returned immediately (as if a 0 were passed)
* @return undefined there is no return value from this function
*/
function pause( iMilliseconds )
{
var sDialogScript = 'window.setTimeout( function () { window.close(); }, ' + iMilliseconds + ');';
window.showModalDialog('javascript:document.writeln ("<script>' + sDialogScript + '<' + '/script>")');
}
</script>

<%
sender = "asdf@asdf.com"

recipients = "abc@hotmail.com;def@hotmail.com;fff@hotmail.com"

subject = "testing"

strBody = "it's testing time"

endMail = 50 ' We send 50 mails each time
startMail = Request("page") * endMail

recipientsArr = Split( recipients, ";" )
recipientsCount = UBound(recipientsArr)

recipientsPage = Int(recipientsCount / endMail) ' Pages in total

For i = 0 To recipientsPage Step 1
startMailTmp = i * endMail
Response.Write "<a href='send.asp?page=" & i & "' id='link" & i & "'>" & startMailTmp & "</a>  "
If i Mod 10 = 9 Then
Response.Write "<br>"
End if
Next

Response.Write "<P>"

If Request("page") <> "" Then
If Int(startMail/endMail) = recipientsPage Then ' this is for dealing with last page problem.
endMail = recipientsCount Mod endMail +1
End If

endMail = (startMail + endMail) - 1

For i=startMail To endMail Step 1
Response.Write "#" & i & " " & recipientsArr(i) & ";"
Next
End if

%>

<%
If request("page") <> "" then
%>
<script type="text/javascript">
currentPage = <%= request("page") %>;
totalPage = <%= recipientsPage %>;
//alert( currentPage );
if( currentPage < totalPage ) {
document.write( "<p><span style='color:blue;'>We are going to page " + (currentPage+1) + "</span>");
pause(5000); // pause / sleep 5 seconds
document.getElementById("link" + (currentPage + 1)).click();
} else {
document.write( "<p><span style='color:red;font-size:100pt'>DONE!!!!!!!!!</span>" );
}
</script>
<%
End If

Function sendMail( sender, mailList, subject, strBody)
bodyformat = 0 ' 0:HTML, 1:text
mailformat = 0 ' 0:MIME, 1:text

set objmail = Server.CreateObject("CDONTS.Newmail")
objmail.From = sender
objmail.BodyFormat = bodyformat
objmail.MailFormat = mailformat
objmail.Subject = subject
'objmail.To = ""
objmail.Bcc = mailList
'objmail.Cc = ""
objmail.Body = strBody
objmail.Send()

set objmail=Nothing

Response.Write "done!"
End Function
%>

Automatically send out emails, 50 mails per cycle


<script type="text/javascript">
/**
*@description pause( iMilliseconds ) Cause the single Javascript thread to hald/pause/sleep/wait for a specified period of time, by opening in modalDialog window (IE only) that modally locks the browser until it returns. This modal dialog is not opened to any page, but uses the Javascript: protocol to execute a javascript setTimeout. In this modal context the setTimeout, has the desired affect of preventing any other script execution. The sole purpose of the timeout execution script is to close the modal dialog which will return control/unluck the browser. The intention was to find a way to allow the UI to be updated and rendered in the middle of function/method without the need to split the method up, remove nested calls, or use closures. Used in this fashion to update the UI, a 0 (zero) is usually passed (or optionally omitted altogether) so that the only delay is for the UI to render.
*@version Note Please be aware that the user interface WILL update its rendering (if you've made and DOM/CSS/Text changes they will appear) and this may significantly slow down program execution if looping.
*@keywords pause sleep wait halt javascript show modal dialog set timeout multi-threaded single thread
*@version 1.2
* @param {Object} iMilliseconds [optional] the number of milliseconds the code will pause before returning - If no value is passed the code will returned immediately (as if a 0 were passed)
* @return undefined there is no return value from this function
*/
function pause( iMilliseconds )
{
var sDialogScript = 'window.setTimeout( function () { window.close(); }, ' + iMilliseconds + ');';
window.showModalDialog('javascript:document.writeln ("<script>' + sDialogScript + '<' + '/script>")');
}
</script>

<%
sender = "asdf@asdf.com"

recipients = "abc@hotmail.com;def@hotmail.com;fff@hotmail.com"

subject = "testing"

strBody = "it's testing time"

endMail = 50 ' We send 50 mails each time
startMail = Request("page") * endMail

recipientsArr = Split( recipients, ";" )
recipientsCount = UBound(recipientsArr)

recipientsPage = Int(recipientsCount / endMail) ' Pages in total

For i = 0 To recipientsPage Step 1
startMailTmp = i * endMail
Response.Write "<a href='send.asp?page=" & i & "' id='link" & i & "'>" & startMailTmp & "</a> "
If i Mod 10 = 9 Then
Response.Write "<br>"
End if
Next

Response.Write "<P>"

If Request("page") <> "" Then
If Int(startMail/endMail) = recipientsPage Then ' this is for dealing with last page problem.
endMail = recipientsCount Mod endMail +1
End If

endMail = (startMail + endMail) - 1

For i=startMail To endMail Step 1
Response.Write "#" & i & " " & recipientsArr(i) & ";"
Next
End if

%>

<%
If request("page") <> "" then
%>
<script type="text/javascript">
currentPage = <%= request("page") %>;
totalPage = <%= recipientsPage %>;
//alert( currentPage );
if( currentPage < totalPage ) {
document.write( "<p><span style='color:blue;'>We are going to page " + (currentPage+1) + "</span>");
pause(5000);
document.getElementById("link" + (currentPage + 1)).click();
} else {
document.write( "<p><span style='color:red;font-size:100pt'>DONE!!!!!!!!!</span>" );
}
</script>
<%
End If

Function sendMail( sender, mailList, subject, strBody)
bodyformat = 0 ' 0:HTML, 1:text
mailformat = 0 ' 0:MIME, 1:text

set objmail = Server.CreateObject("CDONTS.Newmail")
objmail.From = sender
objmail.BodyFormat = bodyformat
objmail.MailFormat = mailformat
objmail.Subject = subject
'objmail.To = ""
objmail.Bcc = mailList
'objmail.Cc = ""
objmail.Body = strBody
objmail.Send()

set objmail=Nothing

Response.Write "done!"
End Function
%>

Monday, September 29, 2008

為什麼老闆不愛我的專案?

Posted on August 24, 2008 in IT Talk by pest

前幾天在某板發文結果被酸打高空跟嘴炮,所以還是來自己的 blog 說的好。

很多研發人員和上司最大的衝突往往是專案的優先順序,研發人員認為 A 比較重要,上司或是老闆認為 B 比較重要。因為認知不一樣,所以雙方的磨擦和衝突就越來越多。一個很容易讓研發人員抓狂的老闆語錄如下:

老闆:「那個 A 專案隨便做一下,可以交差(驗收)就好了。」

研發這時候往往會覺得老闆是豬頭,如果可以隨便做,客戶為什麼不自己隨便做就好?幹麻花這麼多錢包給我們?如果可以隨便做,那當初估出來的時程難道是估心酸的?

之所以雙方會有這麼不同的看法,主因還是思考邏輯的不同;想要說服老闆愛你的專案、或是事先知道老闆會不會愛你的專案,就要知道老闆是怎麼想的。

老闆心中的現金流

學過基本會計的人都知道,一家公司能不能存活,看的不是賺不賺錢,而是現金流。現金流,用最簡單的方式解釋,就是現在手上有多少現金、銀行有多少可以動用的存款,如果一家公司的現金流已經是負的,不管它帳面上是不是賺錢,就要馬上倒閉;相對的,有很多公司並不賺錢,但只要能夠一直維持正向的現金流,一樣可以撐上好幾年。

所以對老闆來說,現金流是最直接的指標,如果一個專案會用掉大量的現金,但要很久以後才能夠回收,它就會帶給公司很大的風險,讓公司週轉不靈。從下圖我們可以看出來,如果一個案子研發需要半年以上,付款又要等到結案三個月以後,那麼即使它的利潤看起來還不錯,但是對公司來說卻很危險。圖中的綠柱就是現金流,即使十月時公司淨值是正的,但八、九兩月就已經倒了

所以遇到這樣的大案子,老闆往往心中都很掙扎,因為吃也是死、不吃又實在太可惜了。如果你想要讓老闆愛你的專案,最好的辦法就是把專案切成可以分開驗收付款的兩部份。假如原本做六個月、總價 330 萬的案子,可以切成第一階段第四個月驗收,驗收完後 90 天付款 150 萬,第二階段六個月後驗收、同樣是驗收後 90 天付尾款,現金流就變成如下:


這樣老闆的資金壓力就不會那麼大了,相對的當然也會支持你把案子好好做。

這種看似嘴炮的分析沒什麼技術可言,夠聰明的老闆或業務也都知道應該要這麼做,但是技術上到底要怎麼把一個大專案切成兩個可以分部驗收的小專案,就是研發人員的課題了。切分的時候往往有 overhead,研發人員如果為了避免 overhead 而堅持大專案而不切成小的元件,就很容易和在乎現金流的老闆起衝突。相反的,如果在分析一個大的專案時,就主動向老闆分析這個專案有哪些部份可以分開驗收,就容易贏得老闆的支持。

錢的時間價值

任何一個專案都是投資,公司投入資源以期賺取利潤。我們都希望專案賺錢,但有趣的就是,不是每一個專案都會賺錢,甚至於很多專案在接的時候,就已經注定 「不賺錢」 了。

為什麼我用 「不賺錢」 而不是 「賠錢」 呢?因為帳面上,公司可能收入大於支出,但是 「時間」 會讓錢貶值。如果一個專案的成本是一百萬,一年後完成可以賺五萬,而銀行的利率有 5%,那這個專案根本等於白做。當初老闆如果不做這個專案,把錢都存在銀行,也可以有一樣的成果。為什麼要辛辛苦苦的弄了半天,結果比定存還要差?

如果只是股東的錢也就罷了,如果公司的錢是向銀行貸款而來,那麼利率還更高,如果一個專案不能比貸款利息高,例如 10%,那麼也是沒有做的價值的。

除去一些非做不可的投資以外,研發人員要怎麼讓老闆支持一個不賺錢的專案呢?當然就是要把它變成賺錢。我們剛剛知道早點收到錢對公司現金流有幫助,現在則是利用晚付錢來把專案成本降低。例如說,提升頻寬和增加業績之間是有關連的,但如果現在想要把頻寬一下拉到 10mbps,初期的投資金額很大而且有一段時間會用不滿,儘管我們一年後會需要 10mbps,而且一次施工也比較便宜,但是分成兩階段升級反而可以讓我們的成本降低,利潤拉高,原因就在有一半的投資只付了半年的利息、也省了半年的連線費。

當然,不是每一件事都有辦法拆解,所以我們才需要研發的專才來分析,而不是財務長一個人就可以完成。瞭解你的專案的現金流和時間成本,才能夠從老闆的觀點來瞭解自己所做的事情對公司的貢獻。

所以,當老闆說,某個案子能不能隨便做一下就好,他想說的其實是,有沒有比較快收到現金的方式、或是有沒有可以降低資金成本的方式。給了對的答案,才有辦法對得起自己的良心,又獲得上級的支持。

資訊和管理的交界 - 資管的心得分享

進入 CMU 唸資管也差不多八個月了,由於課程設計的關係,兩個學期下來就已經修了十八門課了,回想起來也是蠻恐怖的。有些朋友問我為什麼要花時間再唸一個碩士,資工背景的人(?) 唸資管的意義又有多大呢?我想正好可以利用這篇文章整理一下想法。

台灣的資管系畢業生最大的出路,往往是公司的網管或系統管理者。網管或系統管理者所隸屬的資訊部門,一般來說都是直接隸屬在總經理的管轄下,跟會計部門一樣屬於掌握公司神經的部門。但實際上,資訊部門往往是各部門的小奴才,吃力不討好;員工,(特別是 IT 業)認為他們技術能力不足,或虎假虎威擋東擋西;老闆則認為這個職位平常養著好像也沒什麼價值,運氣不好就被外包了,真的能夠為公司創造價值的機會不多。

在美國的普遍狀況我並不瞭解,但是在我所唸的學程中所強調的價值,則和台灣的養成教育有所不同。我試著把這些價值用一些話表達出來:

“溝通是最重要的技能,專業其次”
“一個研發計劃如果不能回收投資,就不值得做”
“在管理階層的等級,交談的語言是財務,不是程式”
“老闆很忙,沒空看超過兩頁的報告,所以不要浪費時間交超過兩頁以上的分析報告 (給教授)….”
“….看看這家公司的財報,我想你們就會瞭解政策對一家 IT 公司的影響有大….”
“你們從小到大都會說話,但沒有人教你們怎麼說商業語言”
“你們一定都以為自己會寫 email…但請看看這家公司的 CEO 如何用一封 email 蒸發掉公司 1/3 的市值….”
“這個工具我現在教各位使用,將來 A 公司高薪請各位工作時就可以用了…”
這樣看起來,似乎課程不強調技術,但我覺得不是這樣的。在資管有兩個 “技術”,一個是 IT 的能力,另一個是財務的觀念。系上的畢業生一般來說有三大出路:資訊業(Google)、顧問業(Deloitte Consulting)或是銀行的 IT 部門(Morgan Stanley)。在這三個工作中,如果可以精通兩個技術之一,找工作都會比別人順利一些。當然,這是個跨領域的學門,所以如何結合兩者也是很重要的。銀行花高薪找 IT 人員,是希望他們可以利用所學的技術套用在商業流程上,或是把商業流程轉成技術語言,從這個角度來看,兩者都具備之後,溝通就成了核心價值。

作為一個 Computer Science 碩士畢業生,我覺得 Information System Management 課程對我最大的幫助,反而是在於瞭解商業的運作。過去,一個東西很酷,我們理想當然的認為應該要去開發,但現在我會問這個專案的回報率(Return on Investment, ROI) 是不是比加權資金成本還好?以前我學過好多種 Data Mining、Machine Learning 的技術,現在發現原來用 Excel 卻可以快速的模擬出信心指數是 95% 的顧客購買行為;以前透過 Bayesian 演算法做了好多個作業,但現在套用在網路廣告上才發現可以超級精確的透過使用者看的網站推算出個人資料。當了好幾年 proxy 管理者,現在則會推算要把這工作外包的最高可接受價格為何;以前開網站直接想到的就是免費模式,現在則知道如何差異定價….

我覺得這就是熟悉技術之後最美好的事;你可以專注於商業應用和思維,而不像其他同學還需要去重溫機率或是演算法。當個案討論 P2P、blog 行銷、skype 電話客服時,你思考的是手邊還有什麼技術可以再應用上去。

資管的畢業生對企業價值不會只是完成一段程式碼而已。商管學生學的 “SMART 目標管理” 講求的是:

Specific: 明確的
Measurable: 可衡量的
Attainable: 可達到的
Realistic: 實際的
Timely: 及時的
但一個好的資管畢業生可以進一步回答這些問題:

Specific Message: 用 IT 來溝通明確需求
Measurable by IT: 用 IT 來統計目標
Attainable by IT: 用什麼系統/軟體/工具可以完成
Realistic Support Info: 透過分析 / 模擬來讓目標更實際
Timely Support: 用 IT 來減少完成目標所需的時間
在這邊上一些課經常是讓人很興奮的,例如學到怎麼計算長尾理論的參數,怎麼計算電話客服要設幾條等等。資訊界變化得很快,而有趣的就是真正商管的也許沒辦法掌握到底層的變化,而資訊出身的又太專注於技術的世界裡,作為中間的橋樑,資管應該要是一門令人興奮的學問才是吧!

資管人才要怎麼教?

資管人才要怎麼教?from Pesty's Articles by pest
優秀的資管人形形色色,但通常都有的特質是:

邏輯好, 頭腦清楚;
至少有一個專長;
溝通能力強;
興趣廣泛
如果以武將來說,大約是姜維的水準;拿他跟呂布 PK 一定死,找他跟司馬懿下棋當然也被電好玩的,問題就是姜維既不會跟魏延鬧脾氣、遇到雜魚也可拿刀跟他對幹。所以爭論誰程式寫得好是沒意義的,但是,絕對要能寫水準以上的程式。

問題就是,姜維真的是學校教得出來的嗎?這就是資管教育最根本的問題了。水鏡可以開班授課教出八奇,反正孫子兵法照念,前八名的再趁就業博覽會時介紹給大公司就好了;武將反正就是練兵跟打仗,打了幾年下來還沒死的人自然就是個將軍了。但又要唸兵書又要打仗的學校,到底是拉單槓重要還是唸陣法重要?

可是回過頭來說,一個軍隊也不能只有諸葛亮和關羽吧,不然八陣圖要建的時候會這樣:

孔明: “姜維, 這個八陣圖在這, 照圖施工就對了。”
姜維: “丞相, 請問石頭跟工人要怎麼調配?”
孔明: “有沒有這麼菜啊? 問我咧~”

<跑去找魏將軍>

姜維: “魏大將軍, 這個八陣圖麻煩您支援弟兄幫忙蓋一下…”
魏延: “賽你丞相, 關我屁事, 我們要去健身房鍛鍊啦~”

資管教育是可以教你技術和商業遇在一起時可能會產生什麼問題,教得比較好的老師也可以教學生怎麼解決問題,但實際上,大部份學生都太年輕而沒辦法真的吸收進去。考試當然更沒辦法考出什麼東西來,因為商業的東西終舊要在商業的環境中實戰才能驗證,而不是靠考試或報告。這也是大多數資管教育失敗的主因。

有板友說,美國資管系教育正在減少;我的看法是,美國人因為相信媒體宣傳的 “IT 已死”,認為這類技術工作終究會被外包到國外,所以唸這類科系的美國人大減,這是我和 CMU 資管的系主任 (管理學院副院長) 聊天時他說的。也因為這樣,系上會每年檢討開課跟業界的需求是否符合,儘可能以學生能找到好工作的方向推動。反之,台灣大部份的資管系所和業界的合作卻很少,對基礎能力的要求也不夠,畢業生出去時當然就比較吃虧了。

回到資工資管的問題,既然我都唸過,應該有一點點資格說話吧。人的時間是有限的,你花時間鑽研一項知識,就可能會漏掉或輕視另一個知識。你可以設計出世界上最好的新無線網路協定,但是如果你搞不定電信頻譜執照就是白搭;你可以寫出最棒的網站,但你應該不會有時間天天和金主吃飯開法人說明會。你的擋垃圾信演算法很棒,但是得有人去做無聊的市場調查才知道用戶到底在不在乎。

資管不是管理資工的人,而是管理資訊相關的議題,以及被資訊影響的人。總有一些事情是資工沒有教,但在現實社會中也和技術同樣重要的。資工沒有教是因為這些時間得省下來鑽研更深的技術來維持競爭力,並假設有人會去處理這些事。運氣好,處理的人對技術有概念就很好;運氣不好,整個團隊的競爭力瓶頸就會出現了。

即使我現在還是以寫程式為生,但我很高興有人幫我把市調做好、把事情優先順序整理好、把客戶需求搞清楚、把測試者的時程接好,這樣我可以專注在我做得最好的事情上。不管我做的事有多麼不可取代,沒有其他資源,我仍然是英雄無用武之地。我可以自己幹出一個網站,但要認真跟檯面上的大公司拼,個人是沒有用的。

雖然平心而論我覺得台灣的資管系設太多,但如果已經踏上這條路並打算走下去,我建議還是:

要有一項專長, 不管是寫程式還是財務;
溝通能力要強;
學習力要強, 你會一直需要學新東西的.
《原發表於 PTT 八卦板》

Friday, September 26, 2008

Using a shell script to replace text in multiple files on Windows

Using a shell script to replace text in multiple files

January 22nd, 2005 | Published in FrameMaker, Shell scripts | Posted by Alistair Christie

The problem I usually work at the office, but occasionally work from home. At the office I can browse to any networked server in Windows (e.g. in Windows Explorer) by entering an address like \\networkedserver. When I'm working from home, I log on to my work network via an SSH session. This works fine, but one drawback is that, because it's not a VPN session my home PC is not part of the work network, so although I can access machines from a command line, using SSH, or upload/download files using WinSCP, addresses like \\networkedserver don't work because (unless "networkedserver" happens to be one of my own machines on my own home network). How this affects my work The only hassle this causes is when I work on structured FrameMaker files from home. I need to copy the source XML files from the server at work to my own machine (using WinSCP) and then modify them the path to the DTD, using a text editor. Once I've finished working on them in FrameMaker and I want to copy them back to the work server, I need to change the DTD reference back to one that works on my work network. For example, at work the FrameMaker XML files I work with reference a DTD called mxDocBook.dtd. Let's say the path to this is //networkserver/mxDocBook/mxDocBook-DTD/mxDocBook.dtd. So the start of each XML file looks like this: The solution: the changedtd shell script I wrote a shell script that you can use to automate this process. The script (called changedtd) contains variables called FINDTHIS, CHANGETOTHIS and FNAMEPATTERN. It looks for files in the current working directory that match the FNAMEPATTERN (typically *.xml) and performs a search/replace, searching for FINDTHIS and replacing it will CHANGETOTHIS. If you want to use the script, copy it and edit the FINDTHIS and CHANGETHIS values to appropriate paths. To run the shell script you obviously need a shell. I'd recommend installing Windows Services for UNIX 3.5 as the easiest way of getting a UNIX-like shell on a Windows machine. You can download SFU 3.5 free of charge from: www.microsoft.com/windows/sfu Once you've got a shell, all you need to do is put the changedtd file in a directory that's in your PATH, and then, in a UNIX/SFU shell, browse to the directory containing the files you want to change and run the command: changedtd View/download the script Notes: You might think it's a very long-winded script to do such a simple operation, but most of the verbosity of it comes from: a) The parsing of the command line arguments. This allows you to run the script on a directory other than the current working directory and to recurse into child directories (if you dare). b) The usage instructions, which you can read by running changedtd -h. c) You could of course very easily change this script to do a search/replace with any text you like on any type of file, just by changing the values of FINDTHIS, CHANGETOTHIS and FNAMEPATTERN.

Thursday, September 25, 2008

How to enable the Security tab for the organization object in Exchange 2000 and in Exchange 2003

How to enable the Security tab for the organization object in Exchange 2000 and in Exchange 2003

Article ID:264733
Last Review:February 21, 2007
Revision:1.6
This article was previously published under Q264733

SUMMARY

By default, the Exchange System Manager does not display the Security tab when you view the properties of the Organizational object. To view the Security tab, you must enable it by editing the registry.

MORE INFORMATION

To enable the Security tab, you must change the registry:

Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:
322756 (http://support.microsoft.com/kb/322756/) How to back up and restore the registry in Windows
1.Start Registry Editor (Regedt32.exe).
2.Locate the following key in the registry:
HKEY_CURRENT_USER\Software\Microsoft\Exchange\EXAdmin
3.On the Edit menu, click Add Value, and then add the following registry value:
Value Name: ShowSecurityPage
Data Type: REG_DWORD
Radix: Binary
Value: 1
4.Quit Registry Editor.

APPLIES TO
Microsoft Exchange Server 2003 Standard Edition
Microsoft Exchange 2000 Server Standard Edition

SystemPages set too high

SystemPages set too high
This topic is intended to address a specific issue called out by the Exchange Server Analyzer Tool. You should apply it only to systems that have had the Exchange Server Analyzer Tool run against them and are experiencing that specific issue. The Exchange Server Analyzer Tool, available as a free download, remotely collects configuration data from each server in the topology and automatically analyzes the data. The resulting report details important configuration issues, potential problems, and nondefault product settings. By following these recommendations, you can achieve better performance, scalability, reliability, and uptime. For more information about the tool or to download the latest versions, see "Microsoft Exchange Analyzers" at http://go.microsoft.com/fwlink/?linkid=34707.

Topic Last Modified: 2006-03-13

The Microsoft® Exchange Server Analyzer Tool reads the following registry entry to determine the value for SystemPages:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Memory Management\SystemPages

If the Exchange Server Analyzer finds the value for SystemPages to be larger than 50000, the Exchange Server Analyzer displays a warning.

Microsoft Windows Server™ 2003 and Microsoft Windows® 2000 Server can directly address up to 4 gigabytes (GB) of memory address space, regardless of how much physical RAM is installed. From the process perspective, each element of virtual address conceptually refers to a byte of physical memory. It is the responsibility of the Virtual Memory Manager (VMM) in conjunction with processor memory manager unit (MMU) to translate or map each virtual address into a corresponding physical address. The VMM performs the mapping by dividing the RAM into fixed-size page frames, creating system page table entries (PTEs) to store information about these page frames, and mapping them. System PTEs are small kernel-mode buffers of memory that are used to communicate with the disk I/O subsystem and the network. Each PTE represents a page frame and contains information necessary for the VMM to locate a page.

On an x86-based system that uses a 4 KB page size, the maximum number of PTEs required to map 2 GB of address space is 524,288 (2 GB/4 KB). On a similar system using the /3GB switch, the number of PTEs requires to map 3 GB of address space is 786,432 (3 GB/4 KB). On a typical system, this space is used as follows:

  • A maximum of 50,000 PTEs (approximately 195 MB address space) are reserved for general use.
  • The rest is used in mapping system cache, hyperspace, paged pool, non-paged pool, crash dump area, and so on.

This PTE pool size is automatically determined at system startup based on the amount of physical memory in the system. This pool is squeezed in between paged pool and non-paged pool, which also grows with the amount of physical memory in the system.

The system PTE pool can become heavily used and heavily fragmented. This could lead to situations where a driver may not load, and so on. Also, if the system PTE pool is depleted entirely, other parts of the system will degrade, even resulting in threads not being created, system stalls, and potential system crashes.

To prevent the system PTE pool from becoming heavily fragmented, you should always configure the SystemPages registry value appropriately for your Exchange Server computer's operating system. When you are running Exchange Server on Windows Server 2003, it is recommended that you set the SystemPages registry key to 0. This recommendation contrasts with the recommendation for Windows 2000 Server, which is to set SystemPages to a value between 24000 and 31000.

After performing the procedure described below, you should monitor the number of free system PTEs. You can do this by monitoring the Memory | Free System Page Table Entries performance counter with the Windows Performance Monitor (also known as System Monitor). If, after making the registry change described below, the number of free system PTEs remains low, you should check the following to ensure your Exchange Server computer is optimally configured:

  • Drivers A malfunctioning driver is one of the most common causes of low system PTEs. In addition, certain versions of the S3 Savage 4 video card drivers are known to set SystemPages to 208896. This driver is often found on IBM E-Series servers. Check with your hardware manufacturer to ensure you are using the latest drivers for all of your hardware. There may be opportunities to downgrade to a more basic driver, as well. For example, computers that run server-based applications such as Exchange Server generally do not need the most advanced video drivers with all of the features. Instead, a more basic driver is often sufficient. Switching from an advanced video driver to a basic video driver should increase the number of free system PTEs.
  • System configuration If your Windows Server 2003 system has 1 GB or more of physical memory installed, you should check to ensure that its Boot.ini file is correctly configured with the /3GB and /USERVA=3030 switches as described in the following Microsoft Knowledge Base articles:
  • Event Logs Check the application event log on the Exchange Server for errors and warnings, especially MSExchangeIS events 9582 (errors and warnings), 9665 (warning) and 12880 (error). The presence of event 9665 could also indicate that SystemPages is not configured for optimal performance. For more information about these events, see the Knowledge Base article 325044, "HOW TO: Troubleshoot Virtual Memory Fragmentation in Exchange 2003 and Exchange 2000" (http://go.microsoft.com/fwlink/?linkid=3052&kbid=325044).
Important:
This article contains information about editing the registry. Before you edit the registry, make sure you understand how to restore the registry if a problem occurs. For information about how to restore the registry, view the "Restore the Registry" Help topic in Regedit.exe or Regedt32.exe.
  1. Open a registry editor, such as Regedit.exe or Regedt32.exe.

  2. Navigate to: HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management

  3. In the right pane, double-click SystemPages.

  4. In the Value data field, type a value between 24000 and 31000 (decimal), and then click OK. If you are unsure what value to use, we recommend using 31000 (decimal).

  5. Close the registry editor and restart the computer for the change to take effect.

  1. Open a registry editor, such as Regedit.exe or Regedt32.exe.

  2. Navigate to: HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management

  3. In the right pane, double-click SystemPages.

  4. In the Value data field, type 0, and then click OK.

  5. Close the registry editor and restart the computer for the change to take effect.

  • Do one of the following:

    • Contact your hardware manufacturer to obtain an updated video driver that does not configure the SystemPages setting.
    • Downgrade the video driver to a standard VGA driver, and correct the SystemPages value as described above.

Before you edit the registry, and for information about how to edit the registry, see the Microsoft Knowledge Base article 256986, "Description of the Microsoft Windows Registry" (http://go.microsoft.com/fwlink/?linkid=3052&kbid=256986).

For more information about optimizing memory for Exchange Server, see the following Knowledge Base articles:

This server has 1 GB or more of physical memory

This server has 1 GB or more of physical memory and HeapDeCommitFreeBlockThreshold has not been set to 262144
This topic is intended to address a specific issue called out by the Exchange Server Analyzer Tool. You should apply it only to systems that have had the Exchange Server Analyzer Tool run against them and are experiencing that specific issue. The Exchange Server Analyzer Tool, available as a free download, remotely collects configuration data from each server in the topology and automatically analyzes the data. The resulting report details important configuration issues, potential problems, and nondefault product settings. By following these recommendations, you can achieve better performance, scalability, reliability, and uptime. For more information about the tool or to download the latest versions, see "Microsoft Exchange Analyzers" at http://go.microsoft.com/fwlink/?linkid=34707.

Topic Last Modified: 2007-11-14

The Microsoft® Exchange Server Analyzer Tool reads the following registry entry to determine if Exchange has been optimally tuned based on the amount of physical memory in the system:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\HeapDeCommitFreeBlockThreshold

If the Exchange Server Analyzer finds the value for HeapDeCommitFreeBlockThreshold has not been set on an Exchange Server computer with 1 gigabyte (GB) or more of physical memory installed, a warning is displayed.

When memory is freed at a given address, the operating system heap manager checks how many contiguous bytes are free around that address. After that check is complete, the heap manager can do one of two things:

  • Keep the contiguous memory block committed.
  • De-commit the contiguous memory block and mark it as reserved only.

The HeapDeCommitFreeBlockThreshold registry key specifies the number of contiguous bytes above which the memory is de-committed. By default, the heap manager does not necessarily combine all free blocks or make new allocations; therefore, blocks may be de-committed and become useless holes in the virtual address space. This can lead to virtual memory fragmentation, poor performance, and ultimately system instability.

On systems with 1 GB or more of physical memory installed, performance is optimized by controlling the size of the chunks of de-committed memory. The HeapDeCommitFreeBlockThreshold registry key provides control of how the memory is handled as it is freed. When adding this value to the registry, you must configure it with a hexadecimal value of 0x00040000 (262144 in decimal).

Microsoft does not support any other value for the HeapDeCommitFreeBlockThreshold registry key than a hexadecimal value of 0x00040000 (262144 in decimal).

Important:
This article contains information about editing the registry. Before you edit the registry, make sure you understand how to restore the registry if a problem occurs. For information about how to restore the registry, view the "Restore the Registry" Help topic in Regedit.exe or Regedt32.exe.
  1. Open a registry editor, such as Regedit.exe or Regedt32.exe.

  2. Navigate to: HKLM\System\CurrentControlSet\Control\Session Manager

  3. Create a DWORD value called HeapDeCommitFreeBlockThreshold.

  4. Double-click the HeapDeCommitFreeBlockThreshold value and enter a hexadecimal value of 0x00040000 (262144 in decimal).

  5. Close the registry editor and restart the Exchange Server computer for the change to take effect.

Before you edit the registry, and for information about how to edit the registry, see the Microsoft Knowledge Base article 256986, "Description of the Microsoft Windows Registry" (http://go.microsoft.com/fwlink/?linkid=3052&kbid=256986).

For more information about the HeapDeCommitFreeBlockThreshold registry key, see the following Knowledge Base articles:

PageFile Size Larger Than Total Physical Memory

PageFile Size Larger Than Total Physical Memory
This topic is intended to address a specific issue called out by the Exchange Server Analyzer Tool. You should apply it only to systems that have had the Exchange Server Analyzer Tool run against them and are experiencing that specific issue. The Exchange Server Analyzer Tool, available as a free download, remotely collects configuration data from each server in the topology and automatically analyzes the data. The resulting report details important configuration issues, potential problems, and nondefault product settings. By following these recommendations, you can achieve better performance, scalability, reliability, and uptime. For more information about the tool or to download the latest versions, see "Microsoft Exchange Analyzers" at http://go.microsoft.com/fwlink/?linkid=34707.

Topic Last Modified: 2008-01-03

The Microsoft Exchange Analyzer Tool queries the Win32_PageFile Windows® Management Instrumentation (WMI) class to determine the value for the MaximumSize key. This key represents the current configured maximum page file size.

The Exchange Analyzer also queries the Win32_ComputerSystem WMI class to determine the value set for the TotalPhysicalMemory key. This value represents the amount of RAM installed on the computer.

If the Exchange Analyzer determines that the value for the Win32_PageFile MaximumSize key is larger than 1.05 times the value of the Win32_ComputerSystem TotalPhysicalMemory key, an error is displayed.

The page file (pagefile.sys) is a hidden file on the hard disk that is used by Windows to retain temporary data when the system is running low on RAM. The page file is also known as paging file or swap file. Virtual memory consists of page file and RAM.

The recommended page file size is equivalent to 1.05 times the RAM up to a maximum of 4,095 MB. This means that the largest paging file size per volume that you can set is 4,095 MB.

Note:
To prevent page file fragmentation, we recommend that you set the paging file size initial and maximum values to be the same value. If you reduce the size of either the initial or maximum page file settings, you must restart your computer to see the effects of those changes. Increases typically do not require a restart.
To change the page file settings
  1. Click Start, Control Panel, and then click System.

  2. On the Advanced tab, under Performance, click Settings.

  3. In the Performance Options dialog box, on the Advanced tab, under Virtual Memory, click Change.

  4. Under Drive [Volume Label], click the drive that contains the paging file that you want to change.

  5. Under Paging file size for selected drive, click Custom size, and enter the recommended page file size in megabytes in the Initial size (MB) and Maximum size (MB) fields, and then click Set.

For more information about page files, see the following Microsoft Knowledge Base articles:

Mailbox store has not had a full backup in more than 60 days

Mailbox store has not had a full backup in more than 60 days
This topic is intended to address a specific issue called out by the Exchange Server Analyzer Tool. You should apply it only to systems that have had the Exchange Server Analyzer Tool run against them and are experiencing that specific issue. The Exchange Server Analyzer Tool, available as a free download, remotely collects configuration data from each server in the topology and automatically analyzes the data. The resulting report details important configuration issues, potential problems, and nondefault product settings. By following these recommendations, you can achieve better performance, scalability, reliability, and uptime. For more information about the tool or to download the latest versions, see "Microsoft Exchange Analyzers" at http://go.microsoft.com/fwlink/?linkid=34707.

Topic Last Modified: 2007-01-08

The Microsoft® Exchange Server Analyzer Tool queries each mailbox store to determine the date and time of the last full backup. The Exchange Server Analyzer also queries the Active Directory® directory service to determine the number of users with mailboxes in each mailbox store. The Exchange Server Analyzer displays an error if both of the following conditions exist:

  • The number of days since the last full backup for a mailbox store is greater than 60 days.
  • More than 10 mailboxes exist in the mailbox store.

The mailbox store is a database for storing mailboxes in Microsoft Exchange Server 2003 and Microsoft Exchange Server 2007. A mailbox store is made up of a rich-text (.edb) file and a streaming native Internet content (.stm) file. Although there are two files, the .edb and .stm files, they represent two halves of a single database, instead of two distinct databases.

The mailbox store and public folder store data in your Exchange Server databases and transaction log files are the most important data to back up in your Exchange Server organization. You can use an Exchange Server database backup to restore a damaged mailbox to a functioning server that is running Exchange Server. You can also use Exchange Server database backups to restore your Exchange Server databases to a different server.

As a best practice, you should perform a full backup of your database files and transaction logs every day. After you complete a full backup of a storage group, the committed transaction log files on the Exchange Server databases are deleted from the server. A full backup provides the advantage of speed in a recovery scenario, because you need only one tape set to restore all data.

Note:
It is a best practice to keep transaction log files on a dedicated disk separate from the database files. This provides fault tolerance in case the database disk is destroyed, and in some cases, improves database performance.
Important:
You must have the required permissions or rights assigned to the user account that you are logged into when you try to back up or restore files and folders. To create Exchange Server backups, you must have domain level backup operator rights. To create backups of your Microsoft Windows Server™ 2003 operating system, you must have at least local backup operator rights.

The backup strategy that you choose for your Exchange Server data depends on the size of the stores, the speed of backup software and hardware, hardware capacity, and time requirements.

For more information about backup strategies and disaster recovery operations, see:

Tool: AdminPak for domain controller, active directory

Tool: AdminPak

Exchange Event ID 8026 Tools: dcdiag, netdiag, and exbpa


Tools: dcdiag, netdiag, and exbpa (

Exchange Best Practices Analyzer v2.8 (exbpa)


Exchange Troubleshooting Assistant v1.1 (ExTRA)

)


Event ID 8026
Page: [1]
Login
Message <<> Newer Topic >>
Event ID 8026 - 10.May2006 7:42:21 PM
No New Messages
gstassoc
New Member



Posts: 10
Joined: 10.May2006
Status: offline
>> --> I looked in my Event View and saw this error Event ID 8026. I have tried to research it on the internet, but there seems to be many reasons that this happens. I am pretty new with exchange 2003. Can someone help me with this error?
The message was as follows:
LDAP Bind was unsuccessful on directory S3a.gstassoc.com for distinguished name "Directory returned error [0x51] server down.
I have two Domain Controllers and neither one is down. I have Exchange running on a standalone server.
Post #: 1
RE: Event ID 8026 - 10.May2006 8:04:07 PM
No New Messages
tiallen
Super Member



Posts: 257
Joined: 26.Jan.2006
From: Minneapolis MN
Status: offline
>> --> Is this a random one-off error?? Are you seeing 8026's sporadically? all the time?

If I were you, I would begin troubleshooting from the networks perspective... any reason exchange cannot get LDAP queries to the DCs? Are the three servers @ the same physical datacenter? on the same subnet?


_____________________________

M3 PostMasters
M3PostMasters@nospam.m3tg.com
M3 Technology Group
www.m3postmasters.com

(in reply to gstassoc)
Post #: 2
RE: Event ID 8026 - 10.May2006 8:20:28 PM
No New Messages
gstassoc
New Member



Posts: 10
Joined: 10.May2006
Status: offline
>> --> No. There are a stream of them. They apply to both of my domain controllers.
Is LDAP automatically setup, because I never set this up. All three servers are setup on the same subnet and are located in same office.

(in reply to tiallen)
Post #: 3
RE: Event ID 8026 - 10.May2006 8:44:38 PM
No New Messages
tiallen
Super Member



Posts: 257
Joined: 26.Jan.2006
From: Minneapolis MN
Status: offline
>> --> LDAP is controlled by AD.. by default it should be working without issue... any kind of firewall on or between these systems that might be adversly affecting connectivity?

_____________________________

M3 PostMasters
M3PostMasters@nospam.m3tg.com
M3 Technology Group
www.m3postmasters.com

(in reply to gstassoc)
Post #: 4
RE: Event ID 8026 - 10.May2006 9:06:30 PM
No New Messages
gstassoc
New Member



Posts: 10
Joined: 10.May2006
Status: offline
>> --> There is a firewall, but everything sits behind it. Besides this configuration was working yesterday.

(in reply to tiallen)
Post #: 5
RE: Event ID 8026 - 10.May2006 10:03:02 PM
No New Messages
tiallen
Super Member



Posts: 257
Joined: 26.Jan.2006
From: Minneapolis MN
Status: offline
>> --> Run a quick tracert and nslookup on the exchange server to verify that nothing is traversing the firewall... then verify that the domain controllers are healthy...

_____________________________

M3 PostMasters
M3PostMasters@nospam.m3tg.com
M3 Technology Group
www.m3postmasters.com

(in reply to gstassoc)
Post #: 6
RE: Event ID 8026 - 10.May2006 11:26:08 PM
No New Messages
gstassoc
New Member



Posts: 10
Joined: 10.May2006
Status: offline
>> --> Tim

Ran a quick tracert and nslookup with no problem. I then ran dcdiag and netdiag on both domain controllers with everything passing.

(in reply to tiallen)
Post #: 7
RE: Event ID 8026 - 10.May2006 11:49:47 PM
No New Messages
tiallen
Super Member



Posts: 257
Joined: 26.Jan.2006
From: Minneapolis MN
Status: offline
>> --> What if you run dcdiag & exbpa from the exchange server?

How about the event logs on the domain controllers? anything out of the ordinary around the same time exchange is issuing 8026's?

In server properties, why don't you cruise over to diagnostic logging and under exchange address list max the ldap logging?

-Tim


_____________________________

M3 PostMasters
M3PostMasters@nospam.m3tg.com
M3 Technology Group
www.m3postmasters.com

(in reply to gstassoc)
Post #: 8
RE: Event ID 8026 - 11.May2006 3:24:37 AM
No New Messages
gstassoc
New Member



Posts: 10
Joined: 10.May2006
Status: offline
>> --> Tried to run dcdiag from Exchange, but exchange could not find the app. I am not familiar with exbpa. I will google it. My domain controllers have no errors. I am not sure about your last sentence about the location of the log files. Excuse my lack of knowledge, but I am just getting familiar with Exchange.

(in reply to tiallen)
Post #: 9
RE: Event ID 8026 - 11.May2006 3:40:17 AM
No New Messages
tiallen
Super Member



Posts: 257
Joined: 26.Jan.2006
From: Minneapolis MN
Status: offline
>> --> no problem, its a fun product to learn and this site is a very friendly resource for admins who are just getting used to exchange...

exbpa is the exchange best practices analyzer... its a free download from microsoft and it will point out configuration errors on the exch side...

For the logging, in exchange system manager, drill down to your exchang server, right click on it and select 'properties' you'll see a tab for diagnostic logging, select it, and I belive under the exchangeAL you'll see an option for LDAP queries... turn its logging level to maximum... Now exchange will log info mssgs / warnings /errors to the application log to help you diagnose this issue from the exchange side as your DCs seem to be fine...

-Tim

_____________________________

M3 PostMasters
M3PostMasters@nospam.m3tg.com
M3 Technology Group
www.m3postmasters.com

(in reply to gstassoc)
Post #: 10
RE: Event ID 8026 - 11.May2006 7:29:35 AM
No New Messages
gstassoc
New Member



Posts: 10
Joined: 10.May2006
Status: offline
>> --> I already had exbpa. I just didn't know it by that name. I have run it with no problems.

(in reply to gstassoc)
Post #: 11
RE: Event ID 8026 - 11.May2006 7:47:24 AM
No New Messages
gstassoc
New Member



Posts: 10
Joined: 10.May2006
Status: offline
>> --> Thanks Tim. I hav e just set up logging. I'll keep you posted. Thanks again.

(in reply to tiallen)
Post #: 12
RE: Event ID 8026 - 14.May2006 2:30:32 PM
No New Messages
gstassoc
New Member



Posts: 10
Joined: 10.May2006
Status: offline
>> --> Hey Tim

Sorry I did not get back to you to let you know what happen with my 8026 error issue. Well, when you told me to start logging exchangeAL something changed. I stopped getting the error message. I started out maximum logging and later switched to minimum. I can't figure out why that would stopped the error 8026, but I'll live with it. Thanks again.

(in reply to tiallen)
Post #: 13
RE: Event ID 8026 - 15.May2006 12:36:38 AM
No New Messages
de.blackman
Moderator



Posts: 1404
Joined: 4.Apr.2005
From: Toronto, Canada
Status: offline
>> --> Are you domain controllers and esp. the exchange server pointing to internal DNS servers??

_____________________________

De BlackMan
List Moderator
"Did you backup your Information Store Today?!"

(in reply to gstassoc)
Post #: 14