O'Reilly logo

Microsoft® Windows® Scripting Self-Paced Learning Guide by Ed Wilson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating Users and Logging Results

As your scripts become more powerful, they have a tendency to become longer and longer. The next script, CreateUsersLogAction.vbs, is nearly 80 lines long. The reason for this length is that you perform three distinct actions. First, you read a text file and parse the data into an array. Then you use this array to create new users and add the users into an existing group in Active Directory. As you create users and add them to groups, you want to create a log file and write the names of the created users. All the code to perform these actions begins to add up and can make a long VBScript hard to read and understand. This is a situation in which the subroutine becomes rather useful. In fact, the subroutine used ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required