Skip to content

Commit

Permalink
2 scripts added
Browse files Browse the repository at this point in the history
  • Loading branch information
silversword411 committed Apr 10, 2021
1 parent b987d04 commit a648929
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
10 changes: 10 additions & 0 deletions api/tacticalrmm/scripts/community_scripts.json
Original file line number Diff line number Diff line change
Expand Up @@ -397,5 +397,15 @@
"shell": "powershell",
"category": "TRMM (Win):Other",
"default_timeout": "90"
},
{
"guid": "83f6c6ea-6120-4fd3-bec8-d3abc505dcdf",
"filename": "Win_TRMM_Start_Menu_Delete_Shortcut.ps1",
"submittedBy": "https://github.com/silversword411",
"name": "TRMM Delete Start Menu Shortcut for App",
"description": "Tactical RMM delete its application shortcut that's installed in the start menu",
"shell": "powershell",
"category": "TRMM (Win):TacticalRMM Related",
"default_timeout": "10"
}
]
18 changes: 8 additions & 10 deletions scripts/Win_Disk_Status.ps1
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
# Checks local disks for errors reported in event viewer within the last 24 hours

$ErrorActionPreference= 'silentlycontinue'
$ErrorActionPreference = 'silentlycontinue'
$TimeSpan = (Get-Date) - (New-TimeSpan -Day 1)
if (Get-WinEvent -FilterHashtable @{LogName='system';ID='11','9','15','52','129','7','98';Level=2,3;ProviderName='*disk*','*storsvc*','*ntfs*';StartTime=$TimeSpan})

if (Get-WinEvent -FilterHashtable @{LogName = 'system'; ID = '11', '9', '15', '52', '129', '7', '98'; Level = 2, 3; ProviderName = '*disk*', '*storsvc*', '*ntfs*'; StartTime = $TimeSpan } -MaxEvents 10 | Where-Object -Property Message -Match Volume*)
{
Write-Output "Disk errors detected please investigate"
Get-WinEvent -FilterHashtable @{LogName='system';ID='11','9','15','52','129','7','98';Level=2,3;ProviderName='*disk*','*storsvc*','*ntfs*';StartTime=$TimeSpan}
exit 1
Write-Output "Disk errors detected please investigate"
Get-WinEvent -FilterHashtable @{LogName = 'system'; ID = '11', '9', '15', '52', '129', '7', '98'; Level = 2, 3; ProviderName = '*disk*', '*storsvc*', '*ntfs*'; StartTime = $TimeSpan }
exit 1
}


else
{
Write-Output "Disks are Healthy"
exit 0
else {
Write-Output "Disks are Healthy"
exit 0
}


Expand Down
1 change: 1 addition & 0 deletions scripts/Win_TRMM_Start_Menu_Delete_Shortcut.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove-Item -Path "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Tactical RMM Agent.lnk" -Force

0 comments on commit a648929

Please sign in to comment.