Scripting Blog [archived]

Formerly known as the "Hey, Scripting Guy!" blog

How Can I Tell Whether a Logon Script is Running on a Workstation or on a Server?

(image) Hey, Scripting Guy! How can I tell whether a logon script is running on a workstation or on a server? If the script is running on a server, I want to skip a portion of the script.-- RT(image) (image) (image) Hey, RT. You know, a few years ago one of the Scripting Guys helped a fellow Microsoft employee set up a computer lab that ...

How Can I Get Total Size and Number of Items in an Office Outlook Folder?

(image) Hey, Scripting Guy! How can I get the total number of items - and the total size - of all the items in my Inbox and Sent Items folders?-- CS(image) (image) (image) Hey, CS. You know, one of the Scripting Guys has a foolproof method for determining this information. What does he do? Nothing; instead, he just sits around and waits ...

How Can I List All the Sub-OUs in an OU?

(image) Hey, Scripting Guy! How can I list all the sub-OUs in an OU? That includes any OUs that might be in those sub-OUs.-- JE(image) (image) (image) Hey, JE. If you’re the least bit familiar with this column then you know that we Scripting Guys love to answer questions that involve searching Active Directory. That’s because we never ...

How Can I Determine Which Day of the Year a Date Falls On?

(image) Hey, Scripting Guy! How can I determine which day of the year a date falls on? For example, March 2, 2006 is the 61st day of the year.-- TW(image) (image) (image) Hey, TW. You know, we almost feel guilty about answering this question. Why? Well, after all, we can answer it by writing just one line of code:Wscript.Echo DatePart("y...