bunch of fixes and updates
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
Control-Service -Restart -Name 'SplashtopRemoteService'
|
||||||
@@ -1,10 +1,17 @@
|
|||||||
## Stop the spooler service
|
$SERVICE = 'spooler'
|
||||||
Control-Service -Stop -Name 'spooler'
|
|
||||||
|
|
||||||
## Delete all print jobs
|
## Make sure the service isn't disabled
|
||||||
LogMsg "Deleting all print jobs from ""${Env:WINDIR}\System32\spool\PRINTERS"""
|
If (! ($(Get-Service -Name 'spooler').StartType -eq "Disabled") ) {
|
||||||
Try { Remove-Item "${Env:WINDIR}\System32\spool\PRINTERS\*" -Recurse }
|
|
||||||
Catch { LogErr $_.Exception.Message }
|
|
||||||
|
|
||||||
## Start the spooler service
|
## Stop the spooler service
|
||||||
Control-Service -Start -Name 'spooler'
|
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
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
$LogsToEnable = @(
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
ForEach ( $log in $LogsToEnable ) {
|
||||||
|
Toggle-Log -Name $log -Enable
|
||||||
|
}
|
||||||
@@ -443,8 +443,8 @@ function Toggle-Log {
|
|||||||
)
|
)
|
||||||
Try {
|
Try {
|
||||||
$log = New-Object System.Diagnostics.Eventing.Reader.EventLogConfiguration $Name
|
$log = New-Object System.Diagnostics.Eventing.Reader.EventLogConfiguration $Name
|
||||||
If ( $Enable ) { $log.IsEnabled = $true }
|
If ( $Enable ) { LogMsg "Enabing ${Name} event log" ; $log.IsEnabled = $true }
|
||||||
If ( $Disable ) { $log.IsEnabled = $false }
|
If ( $Disable ) { LogMsg "Disabing ${Name} event log" ; $log.IsEnabled = $false }
|
||||||
$log.SaveChanges()
|
$log.SaveChanges()
|
||||||
}
|
}
|
||||||
Catch { LogMsg $_.Exception.Message }
|
Catch { LogMsg $_.Exception.Message }
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1')))
|
. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1')))
|
||||||
Control-Service -Restart -Name 'SplashtopRemoteService'
|
Run-Script -LivePSScript Fix-SplashtopService
|
||||||
@@ -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
|
||||||
Reference in New Issue
Block a user