Oh no!

You are using a old browser, many things won't work properly in it. Plase save developers the pain to support old-crappy-browsers, please upgrade.

Get new Firefox, Internet Explorer or any other modern browser.

...other websites you've been visiting will look better too :)

Get beginning of the day datetime -aka today's midnight - in T-SQL

By default I avoid putting any business logic into SQL. IMO it's a good rule-of-thumb, but people often argue about it. I forget why it's good rule, because I use it, but then every once for a while I need to put some little logic into SQL because it's convenient, then I get remanded why oh why I don't like it...

Read more...

Group policy "Only allow local user profiles" - does not apply

My test environment has multiple virtual machines. Some of those machines are in a test sub-domain - it's convenient to use my normal domain credentials to authenticate in test environment. I am also using roaming profile, and it's inconvenient to have it all over test environment.

There is nice GPO: "Only allow local user profiles", which prevents roaming profile creation. I'm using this GPO in server environment on primary domain and it never gave me any trouble.

From beginning of time (a least in test environment timeline) this GPO wasn't working on test machines, roaming profiles where created... I have cursed it, but never have the time to diagnose and correct this and learned to live with the inconvenience.

Today I have finally found time to do this, and the underlying cause, as it happens, turned out to be silly. Test environment domain controller machine and application server machines where created from the same VHD template with pre-installed OS, thus having the same SID. It turned out that computer GPO defined on test environment domain controller wasn't applied, because of the same SID.

I you happen to have similar problem use NewSID to change machine SID.

How to log EventID using log4net logger

To append an EventID to event log entry in windows event log, using log4net EventLogAppender, you need to:

  1. create a LoggingEvent by yourself;
  2. set the EventLogEventID property on your your LoggingEvent,
  3. obtain a logger ILog.Logger property;
  4. log your LoggingEvent using Log method .