Scripting Blog [archived]

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

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 ...

How Can I Determine if a User is a Local Administrator?

(image) Hey, Scripting Guy! Some of the things we do in our logon scripts require the user to be a local administrator. How can the script tell if the user is a local admin or not?-- GM, Denver, CO Hey, GM. The best way to do that is to check the membership of the local Administrator’s group and see if the user is in there. To do that, ...