Home
Solutions
Download
Purchase
Documentation
Get Help
Reseller
My Account
Testimonials
Customers
Contact

Case study: Hosting center automation

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.

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.

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 FSH 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 FSH knowledge, we have been able to automate all our core business processes within a couple of days. "

Related pages

Getting Started Guide

Goes through the basics of the language.

Documentation overview

Browse online documentation.

Setting up logon scripts

How to set up logon scripts with FastTrack Logon.

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, "\\montessrv\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 \\montessrv\home\[Var Customer]

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

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

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

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

AddSharePermissions \\montessrv\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


NOAA GLS Maersk Kawasaki Disney Goodyear Telenor AJG All testimonials ->
More customers ->