How To
Summary
This tool was known as the IBM Tivoli Storage Manager nodes PowerShell tool.
#========================================================================
# Created with: SAPIEN Technologies, Inc., PowerShell Studio 2012 v3.1.34
# Created on: 10/02/2014 09:45 AM
# Created by: Brandon Stevens brandon.stevens@bannerhealth.com
# Organization: Banner Health
# Filename: TSMForm2.psf
#========================================================================
Objective
Add-PSSnapin Microsoft.WSMan.Management
$formTSMBackupRepairTool_Load = {
#TODO: Place custom script here
$Tooltip = New-Object System.Windows.Forms.ToolTip
$ToolTip.AutomaticDelay = 0
$ToolTip.ToolTipIcon = “info”
$ToolTip.SetToolTip($buttonClear, “Clear All Text”)
$ToolTip.SetToolTip($buttonClose, “Close this Tool”)
$ToolTip.SetToolTip($buttonCycleCryptographicSe, “This button will cycle the Cryptographic Service”)
$ToolTip.SetToolTip($buttonTSMNodeErrorLog, “Displays TSM error log 'C:\Program Files\Tivoli\TSM\BaClient\DSMerror.log'”)
$ToolTip.SetToolTip($buttonTSMNodeScheduleLog, “Displays TSM schedule log 'C:\Program Files\Tivoli\TSM\BaClient\DSMsched.log'”)
$ToolTip.SetToolTip($buttonCycleTSMJournalServi, “Stops the TSM Journal Service, deletes all .jbbdb files from TSM directory and starts TSM journal service. This may take about 15 seconds to run.”)
$ToolTip.SetToolTip($buttonTSMNodeServices, “Displays dependent and affiliated services for Tivoli Storage Manager”)
$ToolTip.SetToolTip($buttonCycleTSMScheduleServ, “Cycles the TSM Scheduler Service. ::WARNING:: If an actual backup is running the stopping of this service kills the backup session.”)
$ToolTip.SetToolTip($buttonCycleWindowsManageme, “Cycles the Windows Management Instrumentation Service and services dependent with it”)
$ToolTip.SetToolTip($VSSadmin, “If writer state shows not running than cycle the services affilitated with it”)
$ToolTip.SetToolTip($buttonCycleCOMEventSystemS, “Cycles the COM + Event Service”)
$Tooltip.SetToolTip($buttonServerUptime, "Shows uptime of the host in the results text box")
$tooltip.SetToolTip($TSMJBBD, "When cycling the Journal Service sometimes the TSMJBBD process is stuck. This will end that process.")
}
$buttonTSMNodeServices_Click= {
$Server = $ComputerName.Text.Trim()
$Services.Text = Get-Service 'TSM Journal Service', 'TSM Scheduler', 'TSM Scheduler Clstr', EventSystem, CryptSvc, Winmgmt -Cn $Server | Format-Table -AutoSize -Wrap | Out-String
$o = Get-WmiObject win32_OperatingSystem -ComputerName $Server
$systemDrive = $o.SystemDrive
$aOSName = $o.name.Split("|")
$b = Get-WmiObject win32_Bios -ComputerName $Server
$biosMfgTextBox.Text = $b.Manufacturer
$SystemInfo.Text = $aOSName[0], $o.OSArchitecture, $b.Manufacturer
}
$buttonTSMNodeErrorLog_Click= {
$Server = $ComputerName.Text.Trim()
$ResultObj = Get-Content -Path "\\$Server\C$\Program Files\Tivoli\TSM\baclient\dsmerror.log" | Select-Object -Last 100
$ResultObj | Out-GridView -Title "DSM Error Log" -PassThru
$Services.AppendText("")
}
$buttonTSMNodeScheduleLog_Click={
$Server = $ComputerName.Text.Trim()
$ResultObj = Get-Content -Path "\\$Server\C$\Program Files\Tivoli\TSM\baclient\dsmsched.log" | Select-Object -Last 100
$ResultObj | Out-GridView -Title "DSM Schedule Log" -PassThru
$ResultObj.AppendText("")
}
$buttonCycleCOMEventSystemS_Click= {
#TODO: Place custom script here
$Server = $ComputerName.Text.Trim()
$SrvName = "EventSystem"
$SrvObj = Get-Service -Name $SrvName -Cn $Server
$SrvObj | Stop-Service -force -PassThru
$SrvName + " is now " + (Get-Service $SrvName).status
$Results.Text = $SrvName + " is now " + $($SrvObj.Status)
Start-Sleep -s 10
$SrvObj | Start-Service -PassThru
$SrvName + " is now " + (Get-Service $SrvName).status
$Results.Text = $SrvName + " is now " + $($SrvObj.Status)
}
$buttonCycleCryptographicSe_Click={
#TODO: Place custom script here
$Server = $ComputerName.Text.Trim()
$SrvName = "CryptSvc"
$SrvObj = Get-Service -Name $SrvName -Cn $Server
$SrvObj | Stop-Service -force -PassThru
$SrvName + " is now " + (Get-Service $SrvName).status
$Results.Text = $SrvName + " is now " + $($SrvObj.Status)
Start-Sleep -s 10
$SrvObj | Start-Service -PassThru
$SrvName + " is now " + (Get-Service $SrvName).status
$Results.Text = $SrvName + " is now " + $($SrvObj.Status)
}
$buttonCycleWindowsManageme_Click={
#TODO: Place custom script here
$Server = $ComputerName.Text.Trim()
$SrvName= "CCMExec", "BITS", "VMUSArbService", "UALSVC", "Winmgmt"
$SrvObj = Get-Service -Name $SrvName -Cn $Server
$SrvObj | Stop-Service -Force -PassThru
$SrvName + " is now " + (Get-Service $SrvName).status
$Results.Text = $SrvName + " is now stopping " | Format-Table -AutoSize -Wrap | Out-String
Start-Sleep -s 8
$SrvObj | Start-Service -PassThru
$SrvName + " is now " + (Get-Service $SrvName).status
$Results.Text = $SrvName + " is now running " | Format-Table -AutoSize -Wrap | Out-String
}
$buttonCycleTSMScheduleServ_Click= {
#TODO: Place custom script here
$OUTPUT = [System.Windows.Forms.MessageBox]::Show("Do not proceed if backup is running! Are you sure you want to cycle the TSM Scheduler Service", "Status", 4)
if ($OUTPUT -eq "YES")
{
$Server = $ComputerName.Text.Trim()
$SrvName = "TSM Scheduler"
$SrvObj = Get-Service -Name $SrvName -Cn $Server
$SrvObj | Stop-Service -force -PassThru
$SrvName + " is now " + (Get-Service $SrvName).status
$Results.Text = $SrvName + " is now " + $($SrvObj.Status)
Start-Sleep -s 2
$SrvObj | Start-Service -PassThru
$SrvName + " is now " + (Get-Service $SrvName).status
$Results.Text = $SrvName + " is now " + $($SrvObj.Status)
}
else
{
$CancelSched = Write-Host 'Cancelled'
$Results.Text = "TSM Schedule Service cycling is cancelled."
}
}
$buttonCycleTSMJournalServi_Click={
#TODO: Place custom script here
$Server = $ComputerName.Text.Trim()
$SrvName = "TSM Journal Service"
$SrvObj = Get-Service -Name $SrvName -Cn $Server
$SrvObj | Stop-Service -force -PassThru
$SrvName + " is now " + (Get-Service $SrvName).status
$Results.Text = $SrvName + " is now " + $($SrvObj.Status)
Start-Sleep -s 3
$SrvObj1 = "\\$Server\c`$\Program Files\Tivoli\TSM\baclient\"
Get-ChildItem –Path $SrvObj1 -Filter *.jbbdb –Recurse | Remove-Item –Force
Start-Sleep -s 2
$SrvName2 = "TSM Journal Service"
$SrvObj2 = Get-Service -Name $SrvName2 -Cn $Server
$SrvObj2 | Start-Service
$SrvName2 + " is now " + (Get-Service $SrvName2).status
$Results.Text = $SrvName2 + " is now " + $($SrvObj2.Status)
}
$VSSadmin_Click={
#TODO: Place custom script here
$Server = $ComputerName.Text.Trim()
$ResultObj = Invoke-Command -ComputerName $Server -ScriptBlock { VSSAdmin List Writers }
$ResultObj | Out-GridView -PassThru
}
$buttonClose_Click={
#TODO: Place custom script here
$formTSMBackupRepairTool.Close()
}
$buttonOK_Click={
#TODO: Place custom script here
$Server = $ComputerName.Text.Trim()
$Services.Text = Get-Service 'TSM Journal Service', 'TSM Scheduler', EventSystem, CryptSvc, Winmgmt -Cn $Server | Format-Table -AutoSize -Wrap | Out-String
$Services.ForeColor = 'Black'
$Services.BackColor = 'White'
$Services.AppendText("")
}
$buttonClear_Click={
#TODO: Place custom script here
$ComputerName.Clear()
$Services.Clear()
$Results.Clear()
$Label1.Clear()
$SystemInfo_Click.Clear()
}
$buttonServerUptime_Click={
#TODO: Place custom script here
$Server = $ComputerName.Text.Trim()
$date = Get-WmiObject Win32_OperatingSystem -ComputerName $Server | foreach{ $_.LastBootUpTime }
$RebootTime = [System.DateTime]::ParseExact($date.split('.')[0], 'yyyyMMddHHmmss', $null)
$Results.Text = "The host has been running since " +$RebootTime
}
$buttonTSMClusterErrorLog_Click={
#TODO: Place custom script here
$Server = $ComputerName.Text.Trim()
$ResultObj = Get-Content -Path "\\$Server\C$\Program Files\Tivoli\TSM\baclient\dsmerrorclstr.log" | Select-Object -Last 100
$ResultObj | Out-GridView -Title "DSM Error Log" -PassThru
$Services.AppendText("")
}
$TSMJBBD_Click = {
#TODO: Place custom script here
$Server = $ComputerName.Text.Trim()
Invoke-Command -ComputerName $Server -ScriptBlock { taskkill /IM tsmjbbd.exe /f }
Document Location
Worldwide
Was this topic helpful?
Document Information
Modified date:
19 March 2020
UID
ibm13369423