Case study: Hosting center automation

In this case study, a hosting center company named Montes Hosting has created two scripts. The first script creates an Active Directory structure under a specific hosting Organizational Unit, including sub-OUs, global groups and a template user to create new users from.

Case study: Hosting center automation

Case Study Note

Case Studies are provided to FastTrack Software by customers and are provided as-is. All case studies are unedited except from in most cases having actual company name, domain names, account names and server names replaced by fictitious names from a fictitious company named Acme. Please use our Contact Form, if you are interested in submitting an anonymous case study.

The scripts

The other script is a self-service script that the administrator at the new customer company can start from his or her desktop, to perform only the administrative tasks on the Active Directory sub-structure that Montes Hosting has decided to allow. The script also ensures that all operations are possible only under the scope of the OU that was created for this specific customer.

Montes Hosting has given permission to list the scripts here. Upon completion of the scripts, the script constructor and Technical Architect at Montes Hosting, Jacob Romer, said:
" We chose FastTrack to automate all our business processes in our hosting center, as it is very easy to work with. We wouldn't be able to create this internally with VBScript, PowerShell or KiXtart. With little effort and no upfront FastTrack knowledge, we have been able to automate all our core business processes within a couple of days. "

Script 1: Creating an Active Directory structure for new customers

The first script will create an Active Directory structure under the Organizational Unit named "Hosting". When the script is executed, the script prompts for information about the new customer:

Create customer

The short name is used as a prefix for all new Active Directory objects. Entering "Acme Corporation" as the name and "Acme" as the short name, will produce an Active Directory structure like this:

Active Directory application

The complete original script is listed below.

''==== Input new customer information ====

MultiInput Create new customer,Customer,ShortName|Short name,Domain

 

''==== Test cancel ====

If VarIsEmpty Customer Then Exit

 

''==== Create new OUs under the "Hosted" OU ====

CreateOU [Var Customer], Hosted

 

''==== Create computers, servers and users OU under the customers OU ====

CreateOU [Var ShortName]-Computers, [Var Customer]

CreateOU [Var ShortName]-Servers, [Var Customer]

CreateOU [Var ShortName]-Users, [Var Customer]

 

''==== Create global groups for the customer ====

CreateGlobalGroup [Var ShortName]-user, [Var Customer]

CreateGlobalGroup [Var ShortName]-manager, [Var Customer]

CreateGlobalGroup [Var ShortName]-admin, [Var Customer]

CreateGlobalGroup [Var ShortName]-template, [Var Customer]

 

''==== Create a template user to create new users from ====

CreateUserPlain [Var ShortName]-Standard,NoPass1234,[Var ShortName]-Users

SetUserName [Var ShortName]-Standard,[Var ShortName],Standarduser

SetUserDisplayName [Var ShortName]-Standard, [Var ShortName] Standarduser

SetUserHomeDir [Var ShortName]-Standard, "\\acmesrv\home\[Var ShortName]-template"

SetUserHomeDrive [Var ShortName]-Standard, "k:"

SetUserLogonScript [Var ShortName]-Standard, "FTLogon.exe"

SetUserDescription [Var ShortName]-Standard, UB

DisableUser [Var ShortName]-Standard

AddUserToGroup [Var ShortName]-Standard, [Var ShortName]-user

AddUserToGroup [Var ShortName]-Standard, [Var ShortName]-template

SetUserCustomProperty [Var ShortName]-Standard, userPrincipalName, Standarduser@[Var Domain]

     

''==== Create self-service user for the customer ====

SetVar ServiceCode, S[Random 9][Var ShortName][Random 9][UpperCase [Var ShortName]][Random 9]u 

CreateUserPlain [Var ShortName]-selfservice,[Var ServiceCode],[Var ShortName]-users

SetUserName [Var ShortName]-selfservice,[Var ShortName],selfservice

SetUserDisplayName [Var ShortName]-selfservice, [Var ShortName] selfservice

SetUserDescription [Var ShortName]-selfservice, UB

AddUserToGroup [Var ShortName]-selfservice, [Var ShortName]-user

AddUserToGroup [Var ShortName]-selfservice, Domain admins

SetUserCustomProperty [Var ShortName]-selfservice, userPrincipalName, service@[Var Domain]

 

''==== Create share for self-service user ====

MakeDir \\acmesrv\home\[Var Customer]

CreateShare C:\Hosting\[Var Customer],\\acmesrv\home\[Var ShortName]-Hosted

SetDirPermissions \\acmesrv\home\[Var Customer],Administrator:FC

AddDirPermissions \\acmesrv\home\[Var Customer],[Var ShortName]-user:RE,[Var ShortName]-user:M,[Var ShortName]-user:W

SetSharePermissions \\acmesrv\home\[Var ShortName]-Hosted,Administrator:Full Control

AddSharePermissions \\acmesrv\home\[Var ShortName]-Hosted,[Var ShortName]-user:change

 

''==== Complete ====

ShowMessage Customer [Var Customer] created successfully.


Script 2: Self-service

Users in the Montes Hosting setup are mainly Remote Desktop Services users and the Montes administrator puts a script on the desktop of the person that must be the user account administrator at the customer company. When the customer administrator then starts the icon on the desktop, it looks like this:

Self-service application

The script is based loosely on the HelpDesk Application script. When for example the option to create a new user is chosen, the script prompts for new user information:

Self-service application

The complete original script is listed below. The Montes administrator sets the variables at the top, when the script is copied to the customer administrators desktop. FastTrack Software prefers to list the original material, but the information could have been stored in properties on the Active Directory customer administrator account and then be read from there, to have an identical script for all customers.

'' Settings (here replaced by fictitious data)

SetVar CustomerOU, Acme

SetVar CustomerInit, Acme   

SetVar MailAdr, xxx@acme.com

SetVar Smtpserver, 192.112.11.2

 

'' Show menu

:Restart

SetVar Selection,[Menu Self-Service,User|Create new user,Trashcan|Delete user,Connected|Change user password,_

                       Network|Unlock user account,documents|Change user info,information|Show user groups,_

                       Add user to group,process|Remove user from group,Stop|Exit]

If [Var Selection]=Exit Then Exit

If Not VarIsEmpty Selection Then Goto [Var Selection]

Exit

 

/******************* CREATE USER ACCOUNT IN THE CUSTOMERS OU *******************/

:Create new user

MultiInput Create new user,UserName|User name (Initials), FirstName|First name,LastName|Last name,Title,_

               PhoneNo|PhoneNo,Password|Password (Min 6 chars)

If Not [Var UserName]=[Blank] Then

  SetVar SelectedUser,[ListMenu Select template user, [GroupUsers [Var CustomerInit]-template]]

  SetVar SelectedOU,[ListMenu Select location,[OUsInOU [Var CustomerOU]]]

  If Not [Var SelectedOU]=[Blank] Then

    If Ask "Are you sure you wish to create: [Var UserName] in [Var CustomerOU] [Var SelectedOU]?" Then

      '' Create new user and set properties

      CreateUserPlain [Var CustomerInit]-[Var UserName],[Var Password],[Var SelectedOU]

      SetUserName [Var CustomerInit]-[Var UserName],[Var FirstName],[Var LastName]

      SetUserDisplayName [Var CustomerInit]-[Var UserName], [Var FirstName] [Var LastName]

      SetUserPhoneNo [Var CustomerInit]-[Var UserName],[Var PhoneNo]

      SetUserCustomProperty [Var CustomerInit]-[Var UserName],title, [Var Title]

      DisableUserMustChangePassword [Var CustomerInit]-[Var UserName]

                  

      '' Copy groups from template user

      Loop SelecedGroup,[UserGroups [Var SelectedUser]]

        If Not [LowerCase [Right [Var SelecedGroup] ,8]] = template Then

          AddUserToGroup  [Var CustomerInit]-[Var UserName], [Var SelecedGroup]

        End If   

      End Loop

            

      '' Copy username and domain from template user

      SetVar Domain, [replace [UserCustomProperty userPrincipalName, [Var SelectedUser]], [Var SelectedUser]@,[Blank]]

      SetUserCustomProperty [Var CustomerInit]-[Var UserName], userPrincipalName, [Var UserName]@[Var Domain]

 

      '' Copy logon script, home drive, etc from template user

      SetUserLogonScript [Var CustomerInit]-[Var UserName], [Userlogonscript [Var SelectedUser]]

      SetUserHomeDrive [Var CustomerInit]-[Var UserName], [UserHomeDrive [Var SelectedUser]]

      SetVar HomeDir, [UserHomeDir [Var SelectedUser]]

      If Not [Var HomeDir]=[Blank] Then

        SetVar HomeDirTemp, [replace [Var HomeDir], [Var SelectedUser],[Blank]]

        SetUserHomeDir [Var CustomerInit]-[Var UserName],[Var HomeDirTemp][Var CustomerInit]-[Var UserName]

      End If

 

      '' Notify hosting center admin that the customer created a new user account

      SendMail [Var Smtpserver],25,[Var MailAdr],Self-Service,[Var mailadr],Selfservice,_

               User [Var SelectedUser] created by [LocalUserName] on [ComputerName] at [DateTime]

    End If

  End If

End If

Goto Restart

 

/**************************** CHANGE USER ACCOUNT *****************************/

:Change user info

SetVar SelectedUser,[ListMenu Select user to change info for,[UsersInOU [Var CustomerOU]]]

 

Set Name=[UserFirstName [Var SelectedUser]]

Set SurName=[UserLastName [Var SelectedUser]]

Set DisplayName=[UserCustomProperty displayName, [Var SelectedUser]]

Set PhoneNo=[UserPhoneNo [Var SelectedUser]]

Set Title=[UserCustomProperty title, [Var SelectedUser]]

Set CompanyName=[UserCompany [Var SelectedUser]]

 

MultiInput Edit user information,Name,SurName,DisplayName,Title,PhoneNo,CompanyName

If Not VarIsEmpty Name Then

  If Ask "Are you sure you wish to correct info on [Var SelectedUser]?" Then

    SetUserName [Var SelectedUser], [Var Name], [Var SurName]

    SetUserDisplayName  [Var SelectedUser], [Var DisplayName]

    SetUserPhoneNo  [Var SelectedUser], [Var PhoneNo]

    SetUserCompany [Var SelectedUser], [Var CompanyName]

    SetUserCustomProperty [Var SelectedUser],title, [Var Title]

    ShowMessage "user information changed for [Var SelectedUser]"

    SendMail [Var Smtpserver],25,[Var MailAdr],Self-Service,[Var mailadr],Selfservice,_

             User [Var SelectedUser] updated by [LocalUserName] on [ComputerName] at [DateTime]

  End If

End If

Goto Restart

 

/**************************** DELETE USER ACCOUNT *****************************/

:Delete user

SetVar SelectedUser,[ListMenu Select user to delete,[UsersInOU [Var CustomerOU]]]

If Not VarIsEmpty SelectedUser Then

  If Ask "Are you sure you wish to delete [Var SelectedUser]?" Then

    DeleteUser [Var SelectedUser]

    ShowMessage "User [Var SelectedUser] is now deleted"

    SendMail [Var Smtpserver],25,[Var MailAdr],Self-Service,[Var MailAdr],Selfservice,_

              User deleted [Var SelectedUser] by [LocalUserName] on [ComputerName] at [DateTime]

  End If

End If

Goto Restart

 

/**************************** UNLOCK USER ACCOUNT *****************************/

:Unlock user account

SetVar SelectedUser,[ListMenu Select user to unlock,[UsersInOU [Var CustomerOU]]]

If Not VarIsEmpty SelectedUser Then

  If Ask "Are you sure you wish to unlock the user account for [Var SelectedUser]?" Then

    UnlockUser [Var SelectedUser]

    ShowMessage "User account [Var SelectedUser] is now unlocked."

    SendMail [Var Smtpserver],25,[Var MailAdr],Self-Service,[Var MailAdr],Selfservice,_

             User account [Var SelectedUser] unlocked by [LocalUserName] on [ComputerName] at [DateTime]

  End If

End If

Goto Restart

 

/**************************** CHANGE USER PASSWORD ****************************/

:Change user password

SetVar SelectedUser,[ListMenu Select user to change password for,[UsersInOU [Var CustomerOU]]]

If Not VarIsEmpty SelectedUser Then

  SetVar Password,[InputPassword Enter new password (Min 6 chars)]

  If [Length [Var Password]] > 6  Then

    If Ask "Are you sure you wish to change password for [Var SelectedUser]?" Then

      SetUserPasswordPlain [Var SelectedUser],[Var Password]

      UnlockUser [Var SelectedUser]  ''Just in case the user has tried with bad passwords

      ShowMessage "User [Var SelectedUser] can now log on with the new password"

      SendMail [Var Smtpserver],25,[Var MailAdr],Self-Service,[Var MailAdr],Selfservice,_

               User password changed for [Var SelectedUser] by [LocalUserName] on [ComputerName] at [DateTime]

    End If

  Else

    ShowMessage "The password must be at least 6 chars. Password not changed."

  End If

End If

Goto Restart

 

/***************************** SHOW USER'S GROUPS *****************************/

:Show user groups

SetVar SelectedUser,[ListMenuForced Select user,[UsersInOU [Var CustomerOU]]]

SetVar SelectedGroup,[ListMenu User [Var SelectedUser] is member of:,[UserGroups [Var SelectedUser]]]

Goto Restart

 

/***************************** ADD USER TO GROUP ******************************/

:Add user to group

SetVar SelectedGroup,[ListMenu Select group,[GroupsInOU [Var CustomerOU]]]

If Not VarIsEmpty SelectedGroup Then

  SetVar SelectedUser,[ListMenu Select user to add,[UsersInOU [Var CustomerOU]]]

  If Not VarIsEmpty SelectedUser Then

    If Ask "Are you sure you wish to add [UserFullName [Var SelectedUser]] to the group [Var SelectedGroup]?" Then

      AddUserToGroup [Var SelectedUser],[Var SelectedGroup]

      ShowMessage "User [UserFullName [Var SelectedUser]] is now member of [Var SelectedGroup]"

      SendMail [Var Smtpserver],25,[Var MailAdr],Self-Service,[Var MailAdr],Selfservice,_

               User [UserFullName [Var SelectedUser]] is now member of the group [Var SelectedGroup],_

               added by [LocalUserName] on [ComputerName] at [DateTime]

    End If

  End If

End If

Goto Restart

 

/*************************** REMOVE USER FROM GROUP ***************************/

:Remove user from group

SetVar SelectedGroup,[ListMenu Select group,[GroupsInOU [Var CustomerOU]]]

If Not VarIsEmpty SelectedGroup Then

  SetVar SelectedUser,[ListMenu Select user to remove from the group,[GroupUsers [Var SelectedGroup]]]

  If Not VarIsEmpty SelectedUser Then

    If Ask "Are you sure you wish to remove [UserFullName [Var SelectedUser]] from the group [Var SelectedGroup]?" Then

      RemoveUserFromGroup [Var SelectedUser],[Var SelectedGroup]

      ShowMessage "User [UserFullName [Var SelectedUser]] is now removed from [Var SelectedGroup]"

      SendMail [Var Smtpserver],25,[Var MailAdr],Self-Service,[Var MailAdr],Selfservice,_

               User [UserFullName [Var SelectedUser]] is now removed from the group [Var SelectedGroup],_

               removed by [LocalUserName] on [ComputerName] at [DateTime]

    End If

  End If

End If

Goto Restart



Rating: 5 out of 5

"Use this as a replacement for VBScript and PowerShell"

"It's easy to include attractive GUI elements in FastTrack scripts, beyond the basic dialog boxes and text input that VBScript offers ... Another powerful feature is the ability to distribute scripts as Windows Installer (.msi) or standard .exe files. Although interesting in its own right, this ability results in a much more intriguing capability: to repackage -- or wrap -- software installers as .msi files without using snapshots. If you've ever created an .msi installer file from before-and-after system snapshots, for use with a software distribution system such as Group Policy or SCCM, then you know how hit-and-miss the results can be."

Read full review


Rating: 8 out of 10

"Faster than the rest"

"We found the FastTrack syntax to be more transparent and easier to learn than Microsoft's PowerShell – the editor in particular provided good support in this regard. the Script Editor offers a large number of options from the command set through to simple output of graphical elements, which cannot be achieved at all with PowerShell or other solutions or only with a significantly greater level of effort."

"Anyone wanting to tackle the many hurdles in everyday admin and especially anyone for whom logon scripts and client automation is a priority will benefit from the variety of functions offered by FastTrack."

Review in English      Review in German