Thanks for this information I am trying to do the same thing.
FYI:
I noticed that you had stop and start windchill services as well as clearing the tomcat cache as manual steps. I just wrote some powershell scripts to do this here they are if you want them obviously you will need to change the service names and paths to be correct for your Windchill environment:
Script 1 Stop Windchilll Services: ===================================
#Stop Windchill Services
#3-30-2015
#Brian R. Reed
FUNCTION STOPWINDCHILL(){
Stop-Service "PTC-Windchill"
Stop-Service "PTC-WindchillDS"
Stop-Service "PTC-Apache"
}
Script 2 Start Windchill Services: ====================================
#Script to Start Windchill Services
#3-30-2015
#Brian R. Reed
FUNCTION STARTWINDCHILL(){
Start-Service "PTC-Apache"
Start-Service "PTC-WindchillDS"
Sleep 15
Start-Service "PTC-Windchill"
}
STARTWINDCHILL
Script 3 Stop Services Clear Cache Start Services: ===================================
#Script Written by Brian Reed
#Functionality: This script does the following:
#----1. Shuts down Windchill
#----2. Shuts down Windchill DS
#----3. Shuts down Apache
#----4. Checks to make sure Services were terminated - If not tries again.
#----5. Clears System Cache
#----6. Restarts Apache
#----7. Restarts Windchill DS
#----8. Restarts Windchill
$allServicesStoppedFlag = $false
$allServicesStartedFlag = $false
#allServicesStatus gives the current state of the Windchill Services
#$True means services are on
#$False means services are off
#"" means service status unknown
$allServicesStatus = $null
FUNCTION STOPWINDCHILL(){
Stop-Service "PTC-Windchill"
Stop-Service "Windchill Directory Server"
Stop-Service "PTC-Apache"
}
FUNCTION STARTWINDCHILL(){
Start-Service "PTC-Apache"
Start-Service "Windchill Directory Server"
sleep 15
Start-Service "PTC-Windchill"
}
#Attempt to Stop Windchill Services:
STOPWINDCHILL
#Get status of Windchill Services:
FUNCTION GETSERVICESTATUS(){
$WindchillServiceInfo = Get-Service "PTC-Windchill"
$ApacheServiceInfo = Get-Service "PTC-Apache"
$WindchillDSServiceInfo = Get-Service "Windchill Directory Server"
return $WindchillServiceInfo, $ApacheServiceInfo, $WindchillDSServiceInfo
}
FUNCTION TESTSERVICESTATUS(){
$aStatus = GETSERVICESTATUS
$wc1 = ""
$wc2 = ""
$wc3 = ""
$serviceOn = ""
foreach($item in $aStatus){
if ($item.Name -eq "PTC-Windchill"){
if($item.Status -eq "Running"){$wc1 = $true}
elseif($item.Status -eq "Stopped"){$wc1 = $false}
else{$wc1 = ""}
}
elseif($item.Name -eq "PTC-Apache"){
if($item.Status -eq "Running"){$wc2 = $true}
elseif($item.Status -eq "Stopped"){$wc2 = $false}
else{$wc2 = ""}
}
elseif($item.Name -eq "Windchill Directory Server"){
if($item.Status -eq "Running"){$wc3 = $true}
elseif($item.Status -eq "Stopped"){$wc3 = $false}
else{$wc3 = ""}
}
else{
$allServicesStartedFlag = $null
}
}
if($wc1 -eq $true -and $wc2 -eq $true -and $wc3 -eq $true){
$serviceOn -eq $true
}
elseif($wc1 -eq $false -and $wc2 -eq $false -and $wc3 -eq $false){
$serviceOn -eq $false
}
else{
$serviceOn -eq $null
}
return $serviceOn
}
#Test Services Status
$serviceStatus = TESTSERVICESTATUS
#If Services stopped continue
if($serviceStatus -eq $false){
}
#If Services did not stop try again:
else{
$i = 0
while($i -lt 3){
sleep 20
STOPWINDCHILL
$serviceStatus = TESTSERVICESTATUS
$i++
}
}
#Clear System Cache:
Remove-Item D:\ptc\Windchill_10.0\Windchill\tomcat\instances\* -recurse
Remove-Item D:\ptc\Windchill_10.0\Windchill\tasks\codebase\com\infoengine\compiledTasks\* -recurse
Remove-Item D:\ptc\Windchill_10.0\Windchill\logs\* -recurse
#Start Windchill
STARTWINDCHILL
#If Services started exit script
if($serviceStatus -eq $true){
}
#If Services did not start try again:
else{
$i = 0
while($i -lt 3){
sleep 20
STARTWINDCHILL
$serviceStatus = TESTSERVICESTATUS
$i++
}
}