Geeks With Blogs
Neil Thompson BizTalk | .NET | SQL |

BREAKING NEWS! THIS SCRIPT WAS UPDATED ON JUNE 26 2006 TO CORRECT PASSWORD ASSIGNMENT BUG. NEW SCRIPT IS NOW INCLUDED IN THE GREY BOX BELOW

I have installed BizTalk Server 2006 so many times now and every time I get to the domain account creation and group assignment my eyes glaze over and I give a little groan.  You know my motto - Why not automate? - so here is a vbs script to create the users, groups, and assign the users to the groups according to the (at the time of writing) current BizTalk 2006 documentation.

Automatically creating the BizTalk 2006 user accounts and groups seems like the only reasonable way to avoid all this manual work

Warnings:

  1. This is not rigirously tested so use it at your own risk. Better yet, use it in an expendable LAB domain first
  2. This is very basic script and will not replay successfully unless you manually delete the account
  3. I'm not taking any heat if you mess something up using this script
  4. You need to have permissions to create users, groups, and assign users to groups in the OU that you decide to target

Instructions

  1. Just create a text file on your computer with a .vbs extension. Copy and paste the text below into it.
  2. You will have to change some of the contstants to get it to work in your domain
  3. I would suggest a totally distinct OU for the BizTalk user accounts and groups

That being said, I have used this script successfully many times in my own environment.  This one took a lot of work so if you use it, please drop a simple “thanks” comment at the bottom of the article.

If you have improved the script, or have suggestions for doing so, please let me know so I can benefit from it as well. (two way street y'know)

 

REM ============================================

REM =CREATES ALL USER ACCOUNTS FOR BIZTALK 2006=

REM ============================================

REM = Neil Thompson

REM = June 2006

REM = n.thompson@cgi.com

REM ============================================

REM = THIS SCRIPT IS SUPPLIED "AS-IS" WITHOUT WARRANTY

REM = OF ANY KIND.

REM = USE THIS FILE AT YOUR OWN RISK. NEITHER CGI

REM = NOR NEIL THOMPSON ENSURE THAT THIS SCRIPT WILL

REM = WORK AS DESCRIBED NOR THAT IT IS SAFE TO RUN

REM = IN YOUR ENVIRONMENT. BY RUNNING THIS SCRIPT

REM = YOU AND YOU ALONE ASSUME RESPONSIBILITY FOR

REM = ANY AND ALL OUTCOMES

REM ============================================

 

 

REM == GLOBAL VARIABLES/CONSTANTS==

 

REM == CHANGE THESE VALUES TO REFLECT YOUR OWN ENVIRONMENT!!

strOU = "ou=BizTalk,ou=service accounts, dc=MYDOMAIN, dc=lab"

strDefaultPWD = "P@ssw0rd"

strDomainName = "MYDOMAIN.COM"

strAdministrator = "cn=administrator,cn=users,dc=MYDOMAIN, dc=lab"

 

REM ==CREATE ALL GROUPS (ASSUMES NONE EXIST ALREADY)

CreateGroup "SSO Administrator(s)",strOU

CreateGroup "SSO Affiliate Administrators",strOU

CreateGroup "BizTalk Server Administrators",strOU

CreateGroup "BizTalk Server Operators",strOU

CreateGroup "BizTalk Application Users",strOU

CreateGroup "BizTalk Isolated Host Users",strOU

CreateGroup "EDI Subsystem Users",strOU

CreateGroup "BizTalk BAM Portal Users",strOU

CreateGroup "BizTalk Sharepoint Adapter Enabled Hosts",strOU

CreateGroup "BizTalk BAS Web Services",strOU

CreateGroup "BizTalk BAS Users",strOU

CreateGroup "BizTalk BAS Managers",strOU

CreateGroup "BizTalk BAS Administrators",strOU

 

REM ==CREATE ALL USERS(ASSUMES NONE EXIST ALREADY)

CreateUser "svcSSO",strDefaultPWD, strOU

CreateUser "svcInstanceHost",strDefaultPWD, strOU

CreateUser "svcIsoInstanceHost",strDefaultPWD, strOU

CreateUser "svcReu",strDefaultPWD, strOU

CreateUser "svcEDI",strDefaultPWD, strOU

CreateUser "svcHWS",strDefaultPWD, strOU

CreateUser "svcHWSWeb",strDefaultPWD, strOU

CreateUser "svcBamNotification",strDefaultPWD, strOU

CreateUser "svcBamManWS",strDefaultPWD, strOU

CreateUser "svcBamAppPool",strDefaultPWD, strOU

CreateUser "svcBasOwner",strDefaultPWD, strOU

CreateUser "svcBasManWS",strDefaultPWD, strOU

CreateUser "svcBasPubWS",strDefaultPWD, strOU

CreateUser "svcBasAppPool",strDefaultPWD, strOU

AddUsersToGroups

'REM NOTIFY USERS OF COMPLETION

Msgbox("Created Groups and Accounts")

Sub CreateUser(UserName,Password,OU)

Set objOU = GetObject("LDAP://" & OU)

Set objUser = objOU.Create("User","cn=" & UserName)

objUser.Put "SAMAccountName","" & UserName & ""

objUser.Put "userPrincipalName","" & UserName & "@" & strDomainName

objUser.Put "name","BizTalk Service Account" & UserName & ""

objUser.Put "displayName","BizTalk Service Account" & UserName & ""

objUser.AccountExpirationDate = "01/01/1970"

objUser.SetInfo

objUser.AccountDisabled = FALSE

REM Const ADS_UF_DONT_EXPIRE_PASSWD = &H10000

REM objUser.Put "userAccountControl", ADS_UF_DONT_EXPIRE_PASSWD

objUser.SetPassword Password

objUser.SetInfo

End Sub

Sub CreateGroup(GroupName,OU)

Set objOU = GetObject("LDAP://" & OU)

Set objGroup = objOU.Create("Group","cn=" & GroupName)

objGroup.Put "sAMAccountName", "" & GroupName & ""

objGroup.SetInfo

End Sub

 

Sub AddUsersToGroups

REM === SSO Administrator(s) ===

Set objGroup = GetObject("LDAP://cn=SSO Administrator(s)," & strOU)

objGroup.PutEx 3,"member",Array("cn=svcSSO," & strOU,strAdministrator)

objGroup.SetInfo

 

REM === SSO Affiliate Administrators ===

Set objGroup = GetObject("LDAP://cn=SSO Affiliate Administrators," & strOU)

objGroup.PutEx 3,"member",Array(strAdministrator )

objGroup.SetInfo

 

REM === BizTalk Server Administrators ===

Set objGroup = GetObject("LDAP://cn=BizTalk Server Administrators," & strOU)

objGroup.PutEx 3,"member",Array(strAdministrator,"cn=svcBasManWS," & strOU )

objGroup.SetInfo

 

REM === BizTalk Server Operators ===

Set objGroup = GetObject("LDAP://cn=BizTalk Server Operators," & strOU)

objGroup.PutEx 3,"member",Array(strAdministrator)

objGroup.SetInfo

REM === BizTalk Application Users ===

Set objGroup = GetObject("LDAP://cn=BizTalk Application Users," & strOU)

objGroup.PutEx 3,"member",Array("cn=svcInstanceHost," & strOU)

objGroup.SetInfo

 

REM === BizTalk Isolated Host Users ===

Set objGroup = GetObject("LDAP://cn=BizTalk Isolated Host Users," & strOU)

objGroup.PutEx 3,"member",Array("cn=svcIsoInstanceHost," & strOU,"cn=svcHWSWeb," & strOU)

objGroup.SetInfo

REM === EDI Subsystem Users ===

Set objGroup = GetObject("LDAP://cn=EDI Subsystem Users," & strOU)

objGroup.PutEx 3,"member",Array("cn=svcEDI," & strOU)

objGroup.SetInfo

 

REM === BizTalk BAM Portal Users ===

REM === BizTalk BAS Web Services ===

Set objGroup = GetObject("LDAP://cn=BizTalk BAS Web Services," & strOU)

objGroup.PutEx 3,"member",Array("cn=svcBasManWS," & strOU,"cn=svcBasPubWS," & strOU,"cn=svcBasAppPool," & strOU)

objGroup.SetInfo

 

REM === BizTalk BAM Portal Users ===

REM === BizTalk BAS Managers ===

 

REM === BizTalk BAS Administrators ===

Set objGroup = GetObject("LDAP://cn=BizTalk BAS Administrators," & strOU)

objGroup.PutEx 3,"member",Array("cn=svcBasOwner," & strOU)

objGroup.SetInfo

 

REM === BizTalk Sharepoint Adapter Enabled Hosts ===

Set objGroup = GetObject("LDAP://cn=BizTalk Sharepoint Adapter Enabled Hosts," & strOU)

objGroup.PutEx 3,"member",Array("cn=svcInstanceHost," & strOU)

objGroup.SetInfo

End Sub

Posted on Tuesday, June 13, 2006 7:37 AM | Back to top


Comments on this post: BizTalk 2006 Server - Automatic Account and Group Creation

# re: BizTalk 2006 Server - Automatic Account and Group Creation
Requesting Gravatar...
Very nice, I'll try it out this evening
Left by gar on Jun 26, 2006 2:25 AM

# re: BizTalk 2006 Server - Automatic Account and Group Creation
Requesting Gravatar...
Hi Neil,
Excellent stuff you just saved me I don't know how many mouse clicks, the script worked like a charm.
Slán
Gar
Left by gar on Jun 30, 2006 1:19 PM

# BizTalk 2006 Server - Automatic Account and Group Creation
Requesting Gravatar...
This is a great time saver, a script that will create the Active Directory Groups, Users, and
Assign...
Left by Biztalking Cat on Nov 21, 2006 1:41 AM

# re: BizTalk 2006 Server - Automatic Account and Group Creation
Requesting Gravatar...
Thanks so much for doing this.
Left by Mashuk Rahman on Nov 21, 2006 4:18 PM

# re: BizTalk 2006 Server - Automatic Account and Group Creation
Requesting Gravatar...
Thanks very much for this script. You gave me a new year gift.
Again thanks.
Left by Avinash Dewangan on Jan 18, 2007 4:15 AM

# re: BizTalk 2006 Server - Automatic Account and Group Creation
Requesting Gravatar...
great stuff.
Left by dcu.lcr on Jan 20, 2007 8:41 AM

# re: BizTalk 2006 Server - Automatic Account and Group Creation
Requesting Gravatar...
Works a treat, thanks very much!
Left by Peter on Jan 30, 2007 10:55 PM

# re: BizTalk 2006 Server - Automatic Account and Group Creation
Requesting Gravatar...
Thanks, this worked very nicely.
Left by Glenn Walker on Sep 04, 2007 11:36 AM

# re: BizTalk 2006 Server - Automatic Account and Group Creation
Requesting Gravatar...
Excellent, thanks for providing the script

Cheers,
Steve C.
Left by SteveC on Feb 03, 2008 10:03 AM

# re: BizTalk 2006 Server - Automatic Account and Group Creation
Requesting Gravatar...
Jiyo It help me a lot to reduce the time.

Thanks!!!
Left by Dinkar More on Feb 28, 2008 7:57 AM

# re: BizTalk 2006 Server - Automatic Account and Group Creation
Requesting Gravatar...
Great script, since they are service accounts you may want to update the script to set account passwords not to expire (assuming the syntax is available and possible).
Left by Hector on Jun 20, 2008 3:25 AM

# re: BizTalk 2006 Server - Automatic Account and Group Creation
Requesting Gravatar...
Good job
Left by Filip on Jul 16, 2008 9:26 AM

# re: BizTalk 2006 Server - Automatic Account and Group Creation
Requesting Gravatar...
Very nice work. I can't tell you how much it sucks to do this manually. I am very grateful.
Left by Dan Draper on Jan 02, 2009 4:03 PM

# re: BizTalk 2006 Server - Automatic Account and Group Creation
Requesting Gravatar...
Thanks! I am new to this. Are the ONLY changes that need made in the "REM == CHANGE THESE VALUES TO REFLECT YOUR OWN ENVIRONMENT!!" part of the script?

---- change domain, password, and maybe take out lab dc?
Left by Josh on Feb 10, 2009 4:20 PM

# offer
Requesting Gravatar...
Watch this CRAZY VIDEO that shows how to pull in

734,185 visitors into your website, all completely for

FREE (with zero advertising costs)!
http://tinyurl.com/n7b4n5
Left by janifar on Jul 16, 2009 3:12 AM

Your comment:
 (will show your gravatar)


Copyright © Neil Thompson | Powered by: GeeksWithBlogs.net