My Tridion Newsletters

SDL Tridion Nominate your MVP Candidate

Sign up and get a newsletter when new Tridion stuff is added to the site


SDL Tridion Nominate your MVP Candidate

If you find the content of this page useful, please nominate me for the SDL Tridion MVP award.

Auto Configuration

Tridion Environment Variables

Set oShell = CreateObject( "WScript.Shell" )
    computername  = oShell.ExpandEnvironmentStrings("%COMPUTERNAME%")
    tridionhome   = oShell.ExpandEnvironmentStrings("%TRIDION_HOME%")
    tridionbchome = oShell.ExpandEnvironmentStrings("%TRIDION_BC_HOME%")
Set oShell = Nothing

IIS Configuration

Examine the IIS configuration on this server to see which Tridion web applications are configured, checks for Tridion Content Manager, Business Connector, Workflow and WebDAV.

strComputer = "." 
Set objWMIService = GetObject("winmgmts:\\" & strComputer & _
Set colItems = _
  objWMIService.ExecQuery("SELECT * FROM IIsWebVirtualDirSetting",,48) 

For Each objItem In colItems 
    If objItem.AppFriendlyName = "Tridion Content Manager" Then
        tcmpath = objItem.Path
        previewpath = tcmpath & "Preview"
        uploadpath =  tcmpath & "Upload"
    End If
    If objItem.AppFriendlyName = "BCListener" Then
        bcpath = objItem.Path
    End If
    If objItem.AppFriendlyName = "webdav" Then
        webdavpath = objItem.Path
    End If
    If objItem.AppFriendlyName = "WFListener" Then
        WFpath = objItem.Path
    End If

Tridion Services

Build a dictionary of Tridion Services including the services state, running, stopped or disabled

Tridion Services
Name Service
TCDBroker Tridion Content Broker
TCDDeployer Tridion Content Deployer
TCDTransportService Tridion Content Distributor Transport Service
TCMBCCOM Tridion Content Manager Business Connector
TCMPublish Tridion Content Manager Publisher
TCMSearch Tridion Content Manager Search
TCMWorkflow Tridion Content Manager Workflow Agent
TMSBounceProcessor Tridion Marketing Communication Solution Bounce Processor Service
TmsMailer Tridion Marketing Communication Solution Mailer Service
TMSSynchService Tridion Marketing Communication Solution Contact Synchronization Service
TmsTrigger Tridion Marketing Communication Solution Trigger Service


sComputer     = "."
Dim objTridionServicesDictionary
Set objTridionServicesDictionary = CreateObject("Scripting.Dictionary")
Set cInstances = GetObject("winmgmts:{impersonationLevel=impersonate}//" & _
sComputer & "/root/cimv2:Win32_Service").Instances_

For Each oInstance In cInstances
    If  InStr(oInstance.Properties_("DisplayName").Value,"Tridion") > 0 Then
        PropertyArray = Array(oInstance.Properties_("DisplayName").Value, _
          oInstance.Properties_("StartMode").Value, _

        objTridionServicesDictionary.Add _
          oInstance.Properties_("Name").Value, PropertyArray
    End If
Set cInstances = Nothing

Tridion config files

Tridion has a number of xml configuration files that can be read by the maintenance script to determine the location of the files to be purged, these are: cd_transport_config.xml, cd_instances_config.xml, cd_deployer_config.xml and cd_broker_config.xml.

The script checks for the presence of the cd_instances_config.xml file to find the location of the cd_deployer_config.xml file(s)

The deployer file cleaning script reads the location information from the cd_deployer_config.xml

Sub CleanDeployerFiles(ConfigFile)
    Set fso = CreateObject("Scripting.FileSystemObject")
    If fso.FileExists(ConfigFile) Then
        writeloghead ""
        writeloghead "Content Deployer Folder Maintenance Task"
        writeloghead "Using Deployer Config " & ConfigFile
        Set ConfigXmlDoc = CreateObject("Microsoft.XMLDOM")
        If ConfigXmlDoc.load(ConfigFile) Then
            For Each inode In _
                fpath = inode.getAttribute("Location")
                writeloghead "Delete zipped packages"
                writeloghead "Deleting files from " & fpath
                DeleteFiles fpath & "\", "*.zip,*.xml", _
            For Each inode In _
                fpath = inode.getAttribute("Location")
                writeloghead "Delete unzipped package folders"
                writeloghead "Deleting files from " & fpath
                DeleteFolders fpath & "\", _ 
            writeloghead "Error reading cd_deployer_conf.xml"
        End If    
        writeloghead "Error reading cd_deployer_conf.xml" & ConfigFile
    End if
Set fso = Nothing
End Sub

Created: Thursday 27th May 2010 11:13 PM
Last Modified: Monday 28th June 2010 9:27 AM LinkedIn link: View Chris Mills' profile on LinkedIn
Valid XHTML 1.0! Valid CSS! Level A conformance icon, W3C-WAI Web Content Accessibility Guidelines 1.0