Browsed by
Year: 2009

Query AD using T-SQL

Query AD using T-SQL

So I’m working on a small interface that needs to check certain computers in our enterprise for file changes, and fortunately these specific computers are kept in a group nested inside our AD structure. My thought was, if I can use a SQL query to go get that list of machines, put the results in a table, then have the interface read from that table it would always have a current list of these machines, with no maintenance required for…

Read More Read More

No-Cost training on Channel 9

No-Cost training on Channel 9

MSDN’s Channel 9 is offering no cost training from their learning center. Learn at your own pace with these on-demand videos. Here are a few links to some of their content: Microsoft Office 2010 WorkshopWindows Server 2008 R2 Developer TrainingSharePoint 2010 DeveloperVisual Studio 2010 and .Net Framework 4 Training CourseWindows 7 Developer Training Also, here are a few links to some no-cost Exchange Server 2010 E-Learning courses:Clinic 6899: Exploring Features of Exchange Server 2010 (2 hours)Clinic 6900: Introduction to Exchange…

Read More Read More

Excellent article on getting AD info using C#

Excellent article on getting AD info using C#

I’m always getting, updating, and validating against AD info at my company, and today I needed to pull several different schema attributes in one method, and kept running into more and more trouble. Code got bigger and bigger, and I thought there had to be a way to simplify this. I then ran across a CodeProject article definitely worth mentioning. The author, Rajasekhara Sambangi does an excellent job of demonstrating a simplified way of pulling just about anything from AD…

Read More Read More

Returning the Nth weekday in SQL…and in InfoPath

Returning the Nth weekday in SQL…and in InfoPath

Ok, after much research I found a forum that had a posting that demonstrated how to get the Nth chosen weekday of a month using T-SQL. Here’s the code: DECLARE @date datetimeDECLARE @weekday intDECLARE @day datetimeDECLARE @number intDECLARE @WhichOne int SELECT @WhichOne = 2 — Set this to the week you want to grabSELECT @number = 1SELECT @weekday = 0SELECT @date = getDate() — Change to dateadd(month, 1, getDate()) for next month, etc. WHILE @weekday 4 — Change this value…

Read More Read More

Calculating Nth weekday of next month in Excel

Calculating Nth weekday of next month in Excel

I won’t normally post Excel stuff on here, but while researching an XSLT/Javascript function I was determined to get it right in Excel first, so I understood it better, and definitely wanted to document it so I could pull it back up later! In this example, I need to know the second Wednesday of next month, because that’s when server maintenance is every month. But what day is it? Here’s the Excel formula: =DATE(YEAR(TODAY()),MONTH(TODAY())+1,1+7*2)-WEEKDAY(DATE(YEAR(TODAY(),MONTH(TODAY())+1,8-4)) Notice the DAY argument of the…

Read More Read More