Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
Uploading all scripts
  • Loading branch information
Dylan-Grove committed Mar 5, 2024
1 parent 98c6a67 commit a0ff658
Show file tree
Hide file tree
Showing 14 changed files with 817 additions and 0 deletions.
37 changes: 37 additions & 0 deletions Automation - Givex Error Log Checker.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#Checks to see if there are any errors in the givex log file. Restarts the service if any are detected.

# Import the required module
Import-Module $env:SyncroModule

# Define the path to the text file
$filePath = "C:\Program Files (x86)\MicrosGivex\GIVEX.LOG"

# Define a list of strings to search for
$searchStrings = @(
'gethostbyname("dc-ca1.givex.com") failed'
)

# Check if the file exists
if (Test-Path -Path $filePath -PathType Leaf) {
# Read the file content
$fileContent = Get-Content -Path $filePath -Raw

# Initialize a variable to track if any of the search strings are found
$found = $false

# Iterate through the list of search strings
foreach ($searchString in $searchStrings) {
if ($fileContent -like "*$searchString*") {
Write-Host "String '$searchString' was found in the file."
$found = $true
}
}

if ($found) {
Write-Host "Errors detected in the givex log file, resetting service..."
Restart-Service givexSVC -Force
}
}
else {
Write-Host "The file '$filePath' does not exist."
}
21 changes: 21 additions & 0 deletions Automation - KDS Controller Checker.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#Checks the KDS Controller for errors. Deploys automated remediation to restart the service.

Import-Module $env:SyncroModule

[String] $KDSLog = (Get-content C:\Micros\KDS\etc\KdsController.log -raw)

Get-content C:\Micros\KDS\etc\KdsController.log | select -Last 50 > C:\windows\temp\KDSController.log
$Logsforalert = (Get-Content C:\windows\temp\KDSController.log -raw)

$Body = "
KDS Controller log contained errors. This is the last 50 lines from the KDSController log:
$Logsforalert
Deploying Automated Remediation...
"


if($KDSLog -like "*KDSC 1 POS server has no clients*"){
$Hostname = hostname
#Rmm-Alert -Category 'KDS Service' -Body $Body
}
16 changes: 16 additions & 0 deletions Automation - Simphony EGatewayLog Error Checker.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#Once a day, this log will check for errors in all workstations EGatewayLog for errors. Then it will create alerts depending on what error was present.
Import-Module $env:SyncroModule

$logFilePath = "C:\Micros\Simphony\WebServer\wwwroot\EGateway\EGatewayLog\Log_${Env:COMPUTERNAME}.txt"


# Check if the log file exists
if (Test-Path $logFilePath) {
# Read the contents of the log file
$logContents = Get-Content $logFilePath

# Check if the log contents contain the search string
if ($logContents -match "ERC_SEC_NOT_AUTHORIZED") {
Rmm-Alert -Category 'Oracle Authentication Error' -Body "${Env:COMPUTERNAME} is not authenticated with oracle. Please remotely connect and authenticate it."
}
}
9 changes: 9 additions & 0 deletions Automation - UKlog.dat Checker.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#Checks to see if UKlog.dat is larger than 1KB. If it is, an alert is triggered. This alert will trigger an automated remediation and replace UKlog.dat with a 1KB read-only file.

Import-Module $env:SyncroModule


if( (get-item C:\Uklog.dat).Length -gt 100 ){
$Hostname = hostname
Rmm-Alert -Category 'Diskspace' -Body 'C:\UKlog.dat is consuming a large amount of diskspace. Deploying Automated Remediation...'
}
10 changes: 10 additions & 0 deletions Automation - UKlog.dat Cleaner.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#Sets C:\UKlog.dat to a small size and then sets it to be read-only.
Import-Module $env:SyncroModule


echo "" > c:\Uklog.dat
attrib +r c:\Uklog.dat

$Hostname = hostname

Rmm-Alert -Category 'Diskspace' -Body "UKlog.dat has been cleared and set to read-only."
27 changes: 27 additions & 0 deletions Automation - Zombie check checker.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#Searches the micros egateway log files for references to zombie checks.
Import-Module $env:SyncroModule


$path = "C:\Micros\Simphony\WebServer\wwwroot\EGateway\EGatewayLog\Log_$env:COMPUTERNAME.txt"
$Search = "is a Local zombie"

$Results = @()
Get-ChildItem $path -File | %{

if(get-content $_.FullName | where {$_ -like "*$Search*"}){
$Results += $_.FullName

}

}


$Body = "
Zombie checks were referenced in the latest EGatway log, which usually indicates a stuck check on the local database of the POS:
$Path
Deploying automated remediation...
"

#If($Results){Rmm-Alert -Category 'Zombie check' -Body $Body}
69 changes: 69 additions & 0 deletions Clean SQL Removal.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#Removes a few SQL folders and regkeys

Get-Process -Name sqlwriter | Stop-Process -force -ErrorAction SilentlyContinue
Get-Process -Name sqlservr | Stop-Process -force -ErrorAction SilentlyContinue

SC.exe Stop 'MSSQL$SQLEXPRESS'
SC.exe Stop 'SQLAgent$SQLEXPRESS'
SC.exe Stop MSSQL$SQLEXPRESS
SC.exe Stop SQLAgent$SQLEXPRESS
SC.exe Stop SQLBrowser
SC.exe Stop SQLWriter
SC.exe Stop SQLAgent$SQLEXPRESS
SC.exe Delete SQLAgent$SQLEXPRESS
SC.exe Delete 'MSSQL$SQLEXPRESS'
SC.exe Delete 'SQLAgent$SQLEXPRESS'
SC.exe delete MSSQL$SQLEXPRESS
SC.exe Delete SQLAgent$SQLEXPRESS
SC.exe Delete SQLBrowser
SC.exe Delete SQLWriter

Remove-item 'C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft SQL Server 2012' -recurse -force -ErrorAction SilentlyContinue
Remove-item 'C:\Program Files\Microsoft SQL Server' -recurse -force -ErrorAction SilentlyContinue
Remove-item 'C:\Program Files (x86)\Common Files\Microsoft Shared\SQL Debugging' -recurse -force -ErrorAction SilentlyContinue
Remove-item 'C:\Program Files (x86)\Microsoft SQL Server' -recurse -force -ErrorAction SilentlyContinue

Remove-item 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft SQL Server 12' -recurse -force
Remove-item 'HKLM:\SOFTWARE\Microsoft\MSSQLServer' -recurse -force
Remove-item "HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server" -recurse -force
Remove-item "HKLM:\SYSTEM\CurrentControlSet\Services\MSSQL$SQLEXPRESS" -recurse -force
Remove-item "HKLM:\SYSTEM\CurrentControlSet\Services\SQLAgent$SQLEXPRESS" -recurse -force
Remove-item "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Microsoft SQL Server" -recurse -force
Remove-item "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Microsoft SQL Server Native Client 11.0" -recurse -force
Remove-item "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Microsoft SQL Server Redist" -recurse -force
Remove-item "HKLM:\SOFTWARE\WOW6432Node\Microsoft\MSSQLServer" -recurse -force
Remove-item "HKLM:\SOFTWARE\WOW6432Node\Microsoft\SQLNCLI11" -recurse -force
Remove-item "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{5B2CB8F5-3151-4B85-8EC7-E7BF1CFC8646}" -recurse -force
Remove-item "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{30CA21F2-901A-44DB-A43F-FC31CD0F2493}" -recurse -force
Remove-item "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{54F84805-0116-467F-8713-899DFC472235}" -recurse -force
Remove-item "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{7D29ED63-84F9-4EC7-B49F-994A3A3195B2}" -recurse -force
Remove-item "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{87D50333-E534-493A-8E98-0A49BC28F64B}" -recurse -force
Remove-item "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{C22613C2-C7A4-4761-A906-116ECD4E7477}" -recurse -force
Remove-item "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{D0F44C37-A22B-4733-BBA7-86C9F4988725}" -recurse -force
Remove-item "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{EECD1187-14B3-405E-8028-DA81045AD813}" -recurse -force
Remove-item "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{124D51A1-F3C2-45AE-B812-D3CA71247093}" -recurse -force
Remove-item "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{4B9E6EB0-0EED-4E74-9479-F982C3254F71}" -recurse -force
Remove-item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{6603C2CE-3C54-4F1D-92F9-8390CD4CCCA8}" -recurse -force
Remove-item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{54FF8FAB-DE27-4187-82F1-EBAE6AEE869A}" -recurse -force
Remove-item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{26773F6F-E7B5-4F58-9347-0347C998BA7D}" -recurse -force
Remove-item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{202AAF1F-69AA-442A-B59F-6B54B1AD07C6}" -recurse -force
Remove-item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1D411379-9CE0-4B13-A19B-72D3222DD620}" -recurse -force
Remove-item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{076FF390-D283-4174-B602-B0B7B72BD024}" -recurse -force
Remove-item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{0259C5EE-D53B-40A0-80A7-30C88D217749}" -recurse -force
Remove-item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{6603C2CE-3C54-4F1D-92F9-8390CD4CCCA8}" -recurse -force
Remove-item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{9AE22681-C27C-402A-A136-15854DFF693D}" -recurse -force
Remove-item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{B40EE88B-400A-4266-A17B-E3DE64E94431}" -recurse -force
Remove-item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{C22864D5-FB3F-4609-BF0C-ADBCC70742C4}" -recurse -force
Remove-item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{3E0DD83F-BE4C-4478-86A0-AD0D79D1353E}" -recurse -force
Remove-item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{B40EE88B-400A-4266-A17B-E3DE64E94431}" -recurse -force
Remove-item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{BDF7F870-15E2-49A7-9123-65E8FF52ECAA}" -recurse -force
Remove-item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{BED1EA3D-592D-4305-9D1F-20F03726EFC1}" -recurse -force
Remove-item "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft SQL Server 11" -recurse -force
Remove-item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft SQL Server 11" -recurse -force
Remove-item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft SQL Server SQLServer2012" -recurse -force
Remove-item "HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server 2005 Redist" -recurse -force
Remove-item "HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server 2012 Redist" -recurse -force
Remove-item "HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server Native Client 11.0" -recurse -force
Remove-item "HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server" -recurse -force
Remove-item "HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server Redist" -recurse -force
Remove-item "HKLM:\SOFTWARE\Microsoft\SQLNCLI11" -recurse -force
117 changes: 117 additions & 0 deletions Simphony & RES3700 - Micros Clean Uninstall .ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
#Stops all running micros programs, runs the uninstaller silently, removes the micros registry key, deletes extra folders.

$AnswerFile = @'
[{D2C63C6D-1FAC-4A7F-A994-F02F056CB853}-DlgOrder]
Dlg0={D2C63C6D-1FAC-4A7F-A994-F02F056CB853}-SdWelcomeMaint-0
Count=3
Dlg1={D2C63C6D-1FAC-4A7F-A994-F02F056CB853}-MessageBox-0
Dlg2={D2C63C6D-1FAC-4A7F-A994-F02F056CB853}-SdFinish-0
[{D2C63C6D-1FAC-4A7F-A994-F02F056CB853}-SdWelcomeMaint-0]
Result=303
[{D2C63C6D-1FAC-4A7F-A994-F02F056CB853}-MessageBox-0]
Result=6
[{D2C63C6D-1FAC-4A7F-A994-F02F056CB853}-SdFinish-0]
Result=1
bOpt1=0
bOpt2=0
'@

$ResAnswerFile = @'
[{6E276C72-EEAD-49A0-9657-E9FEB897E618}-DlgOrder]
Dlg0={6E276C72-EEAD-49A0-9657-E9FEB897E618}-SdWelcomeMaint-0
Count=3
Dlg1={6E276C72-EEAD-49A0-9657-E9FEB897E618}-MessageBox-0
Dlg2={6E276C72-EEAD-49A0-9657-E9FEB897E618}-SdFinish-0
[{6E276C72-EEAD-49A0-9657-E9FEB897E618}-SdWelcomeMaint-0]
Result=303
[{6E276C72-EEAD-49A0-9657-E9FEB897E618}-MessageBox-0]
Result=6
[{6E276C72-EEAD-49A0-9657-E9FEB897E618}-SdFinish-0]
Result=1
bOpt1=0
bOpt2=0
'@


mkdir C:\bin
mkdir C:\bin\McrsCAL144

$AnswerFile > C:\bin\McrsCAL144\uninstall.iss
$ResAnswerFile > C:\bin\McrsCAL144\resuninstall.iss


Get-Process -Name Servicehost | Stop-Process -force -ErrorAction SilentlyContinue
Get-Process -Name McrsCal | Stop-Process -force -ErrorAction SilentlyContinue
Get-Process -name WIN7CALStart | Stop-Process -force -ErrorAction SilentlyContinue
Get-Process -Name DbUpdateServer | Stop-Process -force -ErrorAction SilentlyContinue
Get-Process -Name MDSHTTPService | Stop-Process -force -ErrorAction SilentlyContinue
Get-Process -Name KDSController | Stop-Process -force -ErrorAction SilentlyContinue
Get-Process -Name ops | Stop-Process -force -ErrorAction SilentlyContinue
Get-Process -Name Periphs | Stop-Process -force -ErrorAction SilentlyContinue
Get-Process -Name CTUtil | Stop-Process -force -ErrorAction SilentlyContinue
Get-Process -Name AppStarter | Stop-Process -force -ErrorAction SilentlyContinue

SC Stop "MICROS Backup Server"
SC Stop "MICROS CAL Client"
SC Stop "MICROS Credit Card Server"
SC Stop "DbUpdateServer"
SC Stop "MICROS ILDS Server"
SC Stop "MICROS Interface Server"
SC Stop "MICROS KDS Controller"
SC Stop "srvMDSHTTPService"
SC Stop "MICROS Print Controller"
#SC Stop "MSSQL$SQLEXPRESS"
#SC Stop "SQLAgent$SQLEXPRESS"

SC Delete "MICROS Backup Server"
SC Delete "MICROS CAL Client"
SC Delete "MICROS Credit Card Server"
SC Delete "DbUpdateServer"
SC Delete "MICROS ILDS Server"
SC Delete "MICROS Interface Server"
SC Delete "MICROS KDS Controller"
SC Delete "srvMDSHTTPService"
SC Delete "MICROS Print Controller"
#SC Delete "MSSQL$SQLEXPRESS"
#SC Delete "SQLAgent$SQLEXPRESS"

C:\Bin\McrsCAL144\setup.exe /s /f1C:\bin\McrsCAL144\uninstall.iss
C:\Temp\setup.exe /s /f1C:\bin\McrsCAL144\resuninstall.iss

Remove-item c:\micros -force -Recurse
Remove-item 'C:\Program Files (x86)\MICROS' -recurse -force
Remove-item c:\Win32Registry.bat -force -ErrorAction SilentlyContinue
Remove-item c:\dotnetfx35.exe -force -ErrorAction SilentlyContinue
Remove-item c:\PrereqCheck.exe -force -ErrorAction SilentlyContinue
Remove-item c:\vcredist_x86.exe -force -ErrorAction SilentlyContinue
Remove-item c:\PrepareForinstallation.bat -force -ErrorAction SilentlyContinue
Remove-item c:\MicrosRegSettings.reg -force -ErrorAction SilentlyContinue
Remove-item c:\Kill.exe -force -ErrorAction SilentlyContinue
Remove-item 'c:\ProgramData\Microsoft\Windows\Start Menu\Programs\MICROS Applications' -recurse -force -ErrorAction SilentlyContinue
Remove-item 'c:\ProgramData\Microsoft\Windows\Start Menu\Programs\MICROS Client Application Loader' -recurse -force -ErrorAction SilentlyContinue
Remove-item c:\CALTemp -force -Recurse -ErrorAction SilentlyContinue
Remove-item c:\Install -force -Recurse -ErrorAction SilentlyContinue
Remove-item 'C:\Program Files\MICROS' -recurse -force -ErrorAction SilentlyContinue
#Remove-item 'C:\Program Files\Microsoft Point Of Service' -recurse -force -ErrorAction SilentlyContinue
#Remove-item 'C:\Program Files\Microsoft SQL Server' -recurse -force -ErrorAction SilentlyContinue
#Remove-item 'C:\Program Files (x86)\Microsoft SQL Server' -recurse -force -ErrorAction SilentlyContinue
#Remove-item 'C:\Program Files\Microsoft SQL Server' -recurse -force -ErrorAction SilentlyContinue
#Remove-item 'C:\Program Files (x86)\Microsoft SQL Server' -recurse -force -ErrorAction SilentlyContinue
#Remove-item 'C:\ProgramData\Microsoft\Windows\Start Menu\Programs\MICROS Simphony' -recurse -force -ErrorAction SilentlyContinue
#Remove-item 'C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft SQL Server 201' -recurse -force -ErrorAction SilentlyContinue

Remove-Item 'HKLM:\SOFTWARE\WOW6432Node\Micros' -recurse -force
Remove-Item 'HKLM:\SOFTWARE\Micros' -recurse -force
Remove-Item 'HKLM:\SOFTWARE\WOW6432Node\Micros' -recurse -force
#Remove-item "HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server" -recurse -force
#Remove-item "HKLM:\SYSTEM\CurrentControlSet\Services\MSSQL$SQLEXPRESS" -recurse -force
#Remove-item "HKLM:\SYSTEM\CurrentControlSet\Services\SQLAgent$SQLEXPRESS" -recurse -force
#Remove-item "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{5B2CB8F5-3151-4B85-8EC7-E7BF1CFC8646}" -recurse -force
#Remove-item "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{30CA21F2-901A-44DB-A43F-FC31CD0F2493}" -recurse -force
#Remove-item "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{54F84805-0116-467F-8713-899DFC472235}" -recurse -force
#Remove-item "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{7D29ED63-84F9-4EC7-B49F-994A3A3195B2}" -recurse -force
#Remove-item "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{87D50333-E534-493A-8E98-0A49BC28F64B}" -recurse -force
#Remove-item "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{C22613C2-C7A4-4761-A906-116ECD4E7477}" -recurse -force
#Remove-item "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{D0F44C37-A22B-4733-BBA7-86C9F4988725}" -recurse -force
#Remove-item "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{EECD1187-14B3-405E-8028-DA81045AD813}" -recurse -force
#Remove-item "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft SQL Server 11" -recurse -force
Loading

0 comments on commit a0ff658

Please sign in to comment.