Archive for 六月, 2009|Monthly archive page
InfoPath Contact Selector
InfoPath 2007 有個唔錯既 Contact Selector control可以經SharePoint web services 搵user, 勵害在publish去Web Form都掂!
Step-by-Step: http://blogs.msdn.com/infopath/archive/2007/02/28/using-the-contact-selector-control.aspx
MSDN: http://msdn.microsoft.com/en-us/library/ms558892.aspx
美中不足係Contact Selector冇得攞埋email address. 但係哩條友居然可以一句code都唔寫就做到經sharepoint web services lookup email!
http://alecpojidaev.wordpress.com/2008/12/16/infopath-codeless-programming-walkthrough/
重點:
- 用Eval function將一個set of fields concat 番做一條string
- 用Rules既Set Conditions同Stop processing rules when this rule finishes做成一個while loop
More:
InfoPath built-in functions – http://office.microsoft.com/en-us/infopath/HP011552811033.aspx
KB: Windows Mobile: How to disable password enforced by Exchange ActiveSync policy?
If the Windows Mobile device will not be sync with Exchange anymore, applying the following registry can re-enable the “Prompt if device unused for”option in the Lock settings.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\Security\Policies\Policies]
"00001023"=dword:00000001
KB: Enable Rich Text Editing in WSS3.0/MOSS for Non-IE users (e.g. FireFox, Safari)
Problem: By default WSS3.0/MOSS rich text editor supports IE only.
Solution: 3rd party rich text editor control, e.g. RadEditor Lite which is free for licensed WSS/MOSS
KB: Microsoft SQL Server mirroring database automatic failover for non-ADO.NET 2.0 clients
Problem: Automatic failover is supported in high-safety database mirroring mode but clients not utilizing SQL Native Client OLEDB Provider / ADO.NET 2.0 cannot connect to the new principal database automatically upon role mirroring role change.
Solution 1:
- Create new Alias in SQL Client configuration and use Alias name instead of server name in client’s connection settings
- Write a utility program to update the Alias’s upon mirroring role switch
- The Alias update can be done by modifying the corresponding string value under registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo
Solution 2:
- Create new DNS CNAME / A record pointing to active database server
- Use the “virtual” name in client’s connection settings
- Write a utility program to 1) update DNS record and 2) flush DNS cache on client machine, upon mirroring role switch
[Remarks: I only implemented Solution 1 to avoid all the security considerations and the potential need to have separated processes to update DNS on server and flush the cache on client. See DNS APIs at http://msdn.microsoft.com/en-us/library/ms682058(VS.85).aspx ]
To detect the mirroring role switch:
Method 1: By monitoring SQL Server WMI Events
- Create WMI event Alert in SQL Server Agent. See “Alerting on Database Mirroring Events” – http://msdn.microsoft.com/en-us/library/cc966392.aspx
- WMI Namespace: \\.\root\Microsoft\SqlServer\ServerEvents\MSSQLSERVER
- Query: SELECT * FROM DATABASE_MIRRORING_STATE_CHANGE WHERE State = 7 OR State = 8
- State 7 = Manual failover, 8 = Automatic failover
- Automatic failover event occurs on the mirror server instance (i.e. the loser)
- See “Database Mirroring State Change Event Class” in SQL Books Online – http://msdn.microsoft.com/en-us/library/ms191502(SQL.90).aspx
[Remarks: Things are a bit tricky as the “loser” has to register the SQL Alias / DNS for the new principal database. Also the SQL Agent Alerts is usually installed on the SQL Server, making it hard to do something on the client machine.]
Method 2: By polling the principal database
- SQL Native Client / ADO.NET 2.0 can utilize the “Failover Partner=” parameter in connection string.
- e.g. Server=SQL01; Failover Partner=SQL02; Initial Catalog=AdventureWorks;Integrated Security=True
- With .NET 2.0, the active principal database instance can be get in SqlConnection.DataSource property.
SqlConnection conn = new SqlConnection(connstr);
conn.Open();
string principalServer = conn.DataSource;
[Remarks: I developed a .NET 2.0 Console Application and scheduled to run periodically to poll for principal database instance, update SQL Alias if necessary. Certain applications might require restart to reinitiate database connections, which could be part of the actions done by the utility program.]
References:
KB: Anti-XSS 3.0 Security Runtime Engine causing blank TemplateField columns in ASP.NET GridView
Problem: When using Anti-XSS 3.0 Beta Security Runtime Engine (i.e. the http module), data binding <%#Eval(xxx)%> in TemplateField column of ASP.NET GridView becomes blank. However, BoundField column is not affected.
Example:
Resolution: Exclude the page / GridView from the Anti-XSS SRE, and use Anti-XSS Library encode methods in the data binding expression.
Example: <%#Microsoft.Security.Application.AntiXss.HtmlAttributeEncode((string)Eval(xxx))%>
NetScreen 5GT ScreenOS 6.2
我隻NetScreen 5GT需然經已discontinued但係居然仲有ScreenOS 6 update!
Juniper都真係有情有義:)
http://www.juniper.net/techpubs/software/screenos/
NetScreen 5GT Homepage: http://www.juniper.net/customers/support/products/netscreen5gt.jsp
起套Windows 2003 PKI – Plan
參考
- Best Practices for Implementing a Microsoft Windows Server 2003 Public Key Infrastructure
- Designing a Public Key Infrastructure
- Windows Server 2003 PKI Operations Guide
會試以下起套3-tier architecture
- Offline Root CA
- Offilne Policy CA
- Enterprise Issuing CA
- domain client auto enrollment
What’s Next:
- 夾我隻Netscreen 5GT行L2TP/IPSec VPN
- 802.1x
- Upgrade to Windows 2008 CA
- Windows 2008 R2 Direct Access… if possible with my HGC broadband…
玩物養志
唔覺唔覺舊年都買左唔少電腦野,最近買埋部電腦起Virtual Machines試下野,用黎keep住自己唔好咁out咁啦.
My Lab:
NetScreen 5GT
- Yahoo拍賣7舊水, 當broadband router用都抵
- 仲擋埋HGC broadband D不明IP spoofing attack
Synology DS-207
- 2 Bay NAS, RAID1, 650GB
- 平平地又保障下亞仔D相同video. 一諗到萬一要俾兩皮野去做disk recovery就覺得D錢係要洗既
- 本來諗住放佢個photo album出街,但係一見佢樣樣野都行root就hold住先(職業病!). 仲買左本O’Rielly Apache Security睇下諗住harden隻NAS, 最尾都梗係冇下文啦….
DELL OptiPlex 960 Small Form Factor
- Q9400, 8GB RAM, 500 GB harddisk
- 好處: 夠細夠靜, 有4條RAM Slot, 最重要行到Hyper-V, business grade三年保養,長開機都有信心
- 缺點: $$$ (不過我打電話上DELL做個quotation係可以唔跟OS, 慳左成1K, 不過都要$60xx)
What’s next? 起個AD同Cert Server先啦
呢個blog有D乜?
為免將來老人痴呆會失憶, 都係要記低D有趣同有用既野.
- 做咁多年Microsof products儲落既 tips and tricks
- Dogfood experience
- 有用既technical resource & reference
Leave a Comment