diff --git a/Fix-SplashtopService.ps1 b/Fix-SplashtopService.ps1 new file mode 100644 index 0000000..6515338 --- /dev/null +++ b/Fix-SplashtopService.ps1 @@ -0,0 +1 @@ +Control-Service -Restart -Name 'SplashtopRemoteService' \ No newline at end of file diff --git a/Fix-SystemPrintQueue.ps1 b/Fix-SystemPrintQueue.ps1 index 9e4a419..8bb6310 100644 --- a/Fix-SystemPrintQueue.ps1 +++ b/Fix-SystemPrintQueue.ps1 @@ -1,10 +1,17 @@ -## Stop the spooler service -Control-Service -Stop -Name 'spooler' +$SERVICE = 'spooler' -## Delete all print jobs -LogMsg "Deleting all print jobs from ""${Env:WINDIR}\System32\spool\PRINTERS""" -Try { Remove-Item "${Env:WINDIR}\System32\spool\PRINTERS\*" -Recurse } -Catch { LogErr $_.Exception.Message } +## Make sure the service isn't disabled +If (! ($(Get-Service -Name 'spooler').StartType -eq "Disabled") ) { -## Start the spooler service -Control-Service -Start -Name 'spooler' + ## Stop the spooler service + Control-Service -Stop -Name $SERVICE + + ## Delete all print jobs + LogMsg "Deleting all print jobs from ""${Env:WINDIR}\System32\spool\PRINTERS""" + Try { Remove-Item "${Env:WINDIR}\System32\spool\PRINTERS\*" -Recurse } + Catch { LogErr $_.Exception.Message } + + ## Start the spooler service + Control-Service -Start -Name $SERVICE + +} diff --git a/Set-EventLogs.ps1 b/Set-EventLogs.ps1 new file mode 100644 index 0000000..86eee01 --- /dev/null +++ b/Set-EventLogs.ps1 @@ -0,0 +1,7 @@ +$LogsToEnable = @( + +) + +ForEach ( $log in $LogsToEnable ) { + Toggle-Log -Name $log -Enable +} diff --git a/Tools.ps1 b/Tools.ps1 index d983ddf..601181c 100644 --- a/Tools.ps1 +++ b/Tools.ps1 @@ -443,8 +443,8 @@ function Toggle-Log { ) Try { $log = New-Object System.Diagnostics.Eventing.Reader.EventLogConfiguration $Name - If ( $Enable ) { $log.IsEnabled = $true } - If ( $Disable ) { $log.IsEnabled = $false } + If ( $Enable ) { LogMsg "Enabing ${Name} event log" ; $log.IsEnabled = $true } + If ( $Disable ) { LogMsg "Disabing ${Name} event log" ; $log.IsEnabled = $false } $log.SaveChanges() } Catch { LogMsg $_.Exception.Message } diff --git a/Uninstall-CCeanerCloud.ps1 b/Uninstall-CCleanerCloud.ps1 similarity index 100% rename from Uninstall-CCeanerCloud.ps1 rename to Uninstall-CCleanerCloud.ps1 diff --git a/rmm/Fix-SplashtopService.ps1 b/rmm/Fix-SplashtopService.ps1 index 6a0272b..35bccb5 100644 --- a/rmm/Fix-SplashtopService.ps1 +++ b/rmm/Fix-SplashtopService.ps1 @@ -1,2 +1,2 @@ . $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Control-Service -Restart -Name 'SplashtopRemoteService' \ No newline at end of file +Run-Script -LivePSScript Fix-SplashtopService \ No newline at end of file diff --git a/rmm/Set-EventLogs.ps1 b/rmm/Set-EventLogs.ps1 new file mode 100644 index 0000000..4655806 --- /dev/null +++ b/rmm/Set-EventLogs.ps1 @@ -0,0 +1,2 @@ +. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) +Run-Script -LivePSScript Set-EventLogs \ No newline at end of file