|
Guy recommends :
Find out which of your VMs are a waste of space and which VMs need more resources.
|
WSH - Creating New UsersIntroduction - Creating New Users with WSHIn Active Directory, when you need to create one or two users, Active Directory User's and Computers is the classic tool. However, there may be times when you prefer to use WSH (Windows Scripting Host) to generate new user accounts. WSH Topics
♦ Creating a New OUBefore we consider the user, first we need to build an OU (organizational unit) to house the users. An advantage of having a special OU for learning about scripting is that the accounts you produce' do not get mixed up with existing accounts in the Users container. So we will call upon WSH to generate a new OU. In my example I have called the OU GuyDemo, change that name if you wish. In WSH, the following line takes care of creating the OU: Set oOU=oDomain.Create("organizationalUnit", "ou=GuyDemo") Creating a New UserIn my example the user will be called Guy Thomas, feel free to alter the oUser if you prefer a different name. These two lines take care of the user: Set oUser = oOU.Create("User", "cn=Guy Thomas") See more on Creating Users here Setting the passwordA benefit of using WSH with VBScripts is that you can set a password. This is a big advantage over CSVDE which can only create users with blank passwords. This line takes care of the password: oUser.SetPassword "dem0Gu1do" Disabling the accountIf you see a red X next to the user, that means the account is disabled. Change this statement from True to FALSE if you want the accounts enabled and ready to logon. oUser.AccountDisabled = True Instructions
'Script to Create a new user account in the GuyDemo OU See more on Creating Users here
Guy Recommends: Solarwinds' Free Bulk Import Tool
|
||||
Custom Search
|
Guy Recommends: WMI Monitor and It's Free!
|
|
Home Copyright © 1999-2012 Computer Performance LTD All rights reserved Please report a broken link, or an error. | |