Skip to main content

How to create User, Computer or Group in Active Directory through vbscript

Below is the sample vbscript to create the Users in Active Directory

'First connect to container (OU) under which we will create user
Set objOU = GetObject("LDAP://TESTDC/OU=TestOU,DC=TEST,DC=COM")
Set objUser = objOU.Create("User", "cn="&username)
objUser.Put "sAMAccountName", username
objUser.Put "displayName", "Temp Name"
Wscript.echo "Created TempUser in Domain, having domain controller TESTDC"

Above code first connects to the container under which we are going to create user. Then we create the user with CN=TempUser, this will create user object under TestOU, domain, having domain controller TestDC. Once object is created, we have set some of the user properties such as samAccountName, displayName. SetInfo will save the modified properties of the created object.

Note: Before executing above script please make sure that the user with samaccount name TempUser does not exist in the domain and OU with name TestOU exists under Test.Com root container.

To create Computer or Group objects follow the same script except change the type of object to be created such as for computer use:
Set objComp = objOU.Create("Computer", "cn="&computername)
And for Group:
Set objGrp = objOU.Create("Group", "cn="&groupname)


Popular posts from this blog

How to boot Samsung Galaxy SL( GT-I9003) in recovery mode

** I Will Not responsible for any damage done with use of below mentioned methods. ** Power off your Samsung Galaxy SL (GT- I9003) to start in recovery mode. Once you have power off the phone, press and Hold Volume UP and Home button. Make sure you have hold volume up, don't press in  the middle of the volume buttons.  Now keep pressing these two buttons(VOL UP + HOME) and presspower button for 2-3 seconds. Release only power button, but keep pressing Volume Up + Home Button, until you see the screen shown below. Once you see recovery screen release the Home button else your phone will restart as first selected option will be restart and pressing home will make that happen.

In the recovery mode, volume up & down act as a up scroll and down scroll buttons, by pressing Home button you will be able to click the selected option.

How to flash CWM Recovery to Samsung Galaxy SL( GT-I9003) using Odin

** I Will Not responsible for any damage done with use of below mentioned methods. ** To flash the CWM recovery to your Samsung Galaxy SL you will require to following things in place: Odin  : you can download it from here.CWM Recovery image : you can download it from here. Thanks to XDA-developers. USB driver to connect your phone with computer. Install Samsung Kias so it will install the USB driver. Once you have downloaded above required items and installed the USB driver, reboot you phone to download mode. You can read how to reboot phone in download mode from here. Now connect the phone with USB cable to computer. 
Extract the Odin from the zip file that you have downloaded at some location on your computer and launch the Odin executable by double clicking it. Wait for Odin to detect your phone.You will be able to see it in yellow once detected on odin screen as shown below.
Click the PDA button to select the CWM recovery image. Once you have selected the recovery image, check the od…

How to Factory Reset or Hard Reset Samsung Galaxy SII ( GT-i9100)

Note: Performing these steps you will loose all your contacts, messages, all application settings and all installed applications.
If you have trouble with phone software and you want to reset the phone to factory state, you can try factory reset using below steps:
1. Go to System Settings and then select Privacy.
5. If the password is required,enter it. Then confirm by selecting ERASE EVERYTHING. 

If you’re unable to access the settings menu of your Galaxy S II, to Hard Reset the try this method:

1. Turn phone POWER OFF, or pull the battery out and put it back again.
2. Press the Volume UP + Home Button.
3. Keep pressing these 2 buttons + press POWER button for 2-3 seconds.
4. Release only power button but keep pressing Volume Up, Home button.
5. A Boot Menu will then show, Use the volume up/down to choose and home to select.
6. Select Wipe data/factory reset option and press Power button.
7. Now select Yes - delete all user data and Press Power…