How to add Domain Users to Group in Active Directory through vbscript

In order to add domain user to domain group first get the group object then get the domain user from active directory, then add user's ADsPath to group as shown in below sample code.
 
Set objGroup = GetObject("LDAP://CN=TestGroup,OU=TestOU,DC=TEST,DC=com")
Set objUser = GetObject("LDAP://CN=TestUser,OU=TestOU,DC=TEST,DC=com")
objGroup.Add(objUser.ADsPath)
Wscript.echo "Successfully added user TestUser to TestGroup"

ADT or Eclipse with ADT plugin crashes with out of memory error

Android Developer Tools or Eclipse loading ADT plugin may crash with Out of memory exception. Sometimes ADT or Eclipse may also crash while loading any activity layout xml with the errors shown in below images.
PermGen Space errors


Out of memory error


This may happen because you might be having older version of Java SDK installed. Installing the latest version of JDK like 6 or 7 should resolve these errors.

Error: No resource found that matches the given name (at 'theme' with value '@style/Theme.Dialog').

The error occurs because the style element Theme.Dialog is declared under "android:style".

Your ApplicationManifest.xml may contain code as:
    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/Theme.Dialog">

Update the android:theme attribute as given below, the error will get resolved.
    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.Dialog">

Error: "Open quote is expected for attribute "{1}" associated with an element type ...

While developing android applications using eclipse you may get error "Open quote is expected for attribute "{1}" associated with an  element type ...".
This may happen sometimes because you might have by mistake typed closed quote (“) instead of open quote("). Change the quotes at start and end of attribute and you are done.
 

Error : "The end date you entered is before the start date..." Outlook 2010

You may get error "The end date you entered is before the start date" when you are trying to save the Outlook Options in Outlook 2010.



In order to resolve the error go to Options -> Calendar -> WorkTime and change Work Hours so that work stat time should be small than ( less than) End time.
Now try to save the Outlook Options.

How to set password for users in Active Directory through vbscript



Below is the sample vbscript to set password for Users in Active Directory

'First connect to container (OU) under which we will create user
TempUserName="TempUser"
Set objUser = GetObject("LDAP://cn=TempUserName,OU=TestOU,DC=TEST,DC=COM")

objUser.SetPassword "Testme123"
'Also set password never expires
objUser.Put "PasswordExpired", CLng(1)
objUser.SetInfo

Wscript.echo "Sucessfully Set password for user TempUser"


Code above connects to the active directory object with CN=TempUser, ( connects to user TempUser) under TestOU, domain Test.com. The SetPassword will set the provided password for user and additionally we can set Password Never expires flag for that user.  

How to enable user account in Active Directory through vbscript

Below is the sample vbscript to enable the user from Active Directory

Set objOU = GetObject("LDAP://TestDC/OU=TestUO,DC=Test,DC=com")
Set objUser = GetObject("LDAP://CN=TempUser,OU=TestOU,DC=Test,DC=com")
objUser.AccountDisabled = FALSE
objUser.SetInfo
Wscript.echo "Successfully enabled TempUser from Test.Com"

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

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")
username="TempUser"
Set objUser = objOU.Create("User", "cn="&username)
objUser.Put "sAMAccountName", username
objUser.Put "displayName", "Temp Name"
objUser.SetInfo
Wscript.echo "Created TempUser in Domain Test.com, 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 Test.com, 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)

How to install Active Directory Users and Computers for Windows 2008 and R2


Active Directory Users and Computers allows management of users, groups, organizational units, and all other AD DS objects of your domain. 
To install Active Directory users and computers you will have to launch the server manager. You can type in "ServerManager.msc" in Run prompt and hit enter(OK).
Under Server manager select Features. The click on Add Features. Add Feature will launch the Add Feature Wizard listing the features to add. 

On Windows Server 2008, under Add Feature Wizard expand 
  • Remote Server Administration Tools
    • Role Administration Tools
      • Active Directory Domain Services Tools 
and then select Active Directory Domain Controller Tools which include Active Directory Users and Computers, Active Directory Domains and Trusts etc...
On Windows Server 2008 R2, under Add Feature Wizard expand
    • Remote Server Administration Tools
      • Role Administration Tools
        • AD DS and AD LDS Tools
          • AD DS Tools
            • AD DS Snap-Ins and Command-Line Tools.
On selecting these features complete the Wizard to install the selected features.

Golang: Http POST Request with JSON Body example

Go standard library comes with "net/http" package which has excellent support for HTTP Client and Server.   In order to post JSON ...