Scripting Blog [archived]

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

How Can I Determine When a User Last Changed His or Her Password?

(image) Hey, Scripting Guy! How can I determine when a user last changed his or her password?-- MG(image) (image) (image) Hey, MG. A long time ago one of the Scripting Guys worked at a local university. In one of the departments there it was easy to determine when a user last changed his or her password: that’s because the administrative...

How Can I Purge All the Print Jobs on a Windows 2000 Print Server?

(image) Hey, Scripting Guy! How can I purge all the print jobs on a Windows 2000 print server?-- KC(image) (image) (image) Hey, KC. This is one of those questions we hate, not because we don’t have an answer for it - we do - but because we have to temporarily abandon one of the core tenets of the Scripting Guy Way of Life. That tenet - ...

How Can I Disable the Guest Account on a Computer?

(image) Hey, Scripting Guy! How can I determine whether or not the Guest account is enabled on a computer and, if it is, disable it?-- PR(image) (image) (image) Hey, PR. At last: a question for which there is a very simple, very straightforward answer. This isn’t to minimize the importance of the task: in general, it’s highly ...

How Can I Determine Whether or Not a Group Has Any Members?

(image) Hey, Scripting Guy! How can I check a computer and find out whether the Remote Desktop Users group has any members?-- ET(image) (image) (image) Hey, ET. Somewhat surprisingly, ADSI doesn’t have any sort of NumberOfMembers property, a property that could tell you - at a glance - how many members are in a group. But that’s all ...

How Can I Prevent a Local User From Changing His or Her Password?

(image) Hey, Scripting Guy! How can I configure a local user account so that the user can’t change his or her password?-- DC(image) (image) (image) Hey, DC. The secret here lies in the mysterious userFlags attribute. We’ll show you how to set a user account so that the user can’t change his or her password, then we’ll fill you in ...