One of the most common activities for a System Administrator working with Teamcenter and Active Workspace is to start and stop Teamcenter Services using a script in the environment. It is a repeated task that deserves automation.
1st, create a script named _runTc.cmd and place it on the server desktop and execute with administrative rights.
Note. Starting and stopping services requires administrative rights, therefore that is the first thing to verify.
After validating the script is running with administrative rights, we need to present a menu where the administrator can choose to start or stop the services for the environment.
Once the administrator makes a choice then we perform the necessary tasks to complete that choice. I use the display name of the service (in quotes) for clarity instead of the service name which may not be clear.
The _runTc.cmd script is defined (below).
Note. you may download the file below. The downloaded file will be a .zip file. Extract the .zip file to find the _runTc.cmd file. The code in the file is the same as in the example below.
Tip. Modify this script for the services that you are actually running in both the net start and net stop locations for each service.
Now you can simply right-click the script and select "Run as administrator". Enjoy!
@echo off
setlocal enableextensions
setlocal enabledelayedexpansion
:: ****************************************************************************
:: Name: _runTc.cmd
:: ****************************************************************************
:: Description:
:: Start/Stop Teamcenter Services (Tc4Sherpa).
::
:: Instructions:
:: Open a command prompt with "Run as administrator".
:: Run the script.
::
:: PreRequisite
:: Administrative Rights.
::
:: Script History:
:: XX.XXX YYYYMMDD Who Description
set version=00.000-beta &:20230227 RTE Initial build.
set version=00.100 &:20230228 MJM Release post debug
set version=01.000 &:20230303 RTE Initial release.
set version=01.100 &:20230303 BAC Modified; Tc4Sherpa use.
:: For new entry, copy the last entry and modify Date, Initials and Description
set version=%version: =%
set title=%~nx0 - version %version%
title %title%
:: ****************************************************************************
:: Validate administrative rights. ____________________________________________
@echo.Administrative permissions required. Detecting permissions...
net session >nul 2>&1
if not %errorLevel% == 0 (
echo.FATAL: Current permissions inadequate. Use "Run as administrator"
pause
exit /b 0
)
@echo.All good!
@echo.
:: Execution
:select
@echo.1 = Start Tc Services
@echo.2 = Stop Tc Services ^(Full Downtime^)
@echo.3 = Stop Tc Services ^(Deployment - leaves FSC and Microservices running^)
set /P "iWant2= "
:: List services...
if [%iWant2%]==[1] (
@echo.Starting Teamcenter Services...
net start "Teamcenter FSC Service FSC_PDX_CORP1"
net start "Teamcenter Process Manager"
net start "Teamcenter Server Manager Tc4Sherpa_PoolA"
net start "Teamcenter Shared Metadata Cache Service"
net start "Teamcenter Subscription Manager Service"
net start "Teamcenter Action Manager Service"
net start "Teamcenter Task Monitor Service"
net start "Teamcenter Dispatcher Module V13000.2.0.21_20221208.00"
net start "Teamcenter Dispatcher Scheduler V13000.2.0.21_20221208.00"
net start "Apache Tomcat 8.5 Tomcat8"
net start "Active Workspace Indexing Service"
net start "Teamcenter AM Read Expression Manager Service"
net start "Teamcenter VisServlet vispool-A"
net start "Teamcenter VisServlet visassigner-A"
net start "Teamcenter TcFTSIndexer Sync"
)
:: List of services to stop...
if [%iWant2%]==[2] (
@echo.Stopping Teamcenter Services...
net stop "Teamcenter TcFTSIndexer Sync"
net stop "Teamcenter VisServlet visassigner-A"
net stop "Teamcenter VisServlet vispool-A"
net stop "Teamcenter AM Read Expression Manager Service"
net stop "Active Workspace Indexing Service"
net stop "Apache Tomcat 8.5 Tomcat8"
net stop "Teamcenter Dispatcher Scheduler V13000.2.0.21_20221208.00"
net stop "Teamcenter Dispatcher Module V13000.2.0.21_20221208.00"
net stop "Teamcenter Task Monitor Service"
net stop "Teamcenter Action Manager Service"
net stop "Teamcenter Subscription Manager Service"
net stop "Teamcenter Shared Metadata Cache Service"
net stop "Teamcenter Server Manager Tc4Sherpa_PoolA"
net stop "Teamcenter Process Manager"
net stop "Teamcenter FSC Service FSC_PDX_CORP1"
)
:: List of services to stop for DM Deployment...
if [%iWant2%]==[3] (
@echo.Stopping Teamcenter Services for Deployment...
net stop "Teamcenter TcFTSIndexer Sync"
net stop "Teamcenter VisServlet visassigner-A"
net stop "Teamcenter VisServlet vispool-A"
net stop "Teamcenter AM Read Expression Manager Service"
net stop "Active Workspace Indexing Service"
net stop "Apache Tomcat 8.5 Tomcat8"
net stop "Teamcenter Dispatcher Scheduler V13000.2.0.21_20221208.00"
net stop "Teamcenter Dispatcher Module V13000.2.0.21_20221208.00"
net stop "Teamcenter Task Monitor Service"
net stop "Teamcenter Action Manager Service"
net stop "Teamcenter Subscription Manager Service"
net stop "Teamcenter Shared Metadata Cache Service"
net stop "Teamcenter Server Manager Tc4Sherpa_PoolA"
)
:: Misc.
::net start "Teamcenter_DC_Service"
::net start "Teamcenter_DC_RepoService"
::net start "Teamcenter_DC_RepoService_Publisher"
::net start "Tc-Mgmt-Console-Container"
:: Done. ______________________________________________________________________
@echo.Completed.
endlocal
If you are having difficulties with Teamcenter and Active Workspace starting and stopping services, check out the Siemens Communities page for general questions and resolutions.
This post was provided by Sherpa Design, Inc.
Edit. Original publish date April 3, 2023 by Randy Ellsworth. Updated publish time for formatting adjustments.
Comments