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
|
||||
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
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
$LogsToEnable = @(
|
||||
|
||||
)
|
||||
|
||||
ForEach ( $log in $LogsToEnable ) {
|
||||
Toggle-Log -Name $log -Enable
|
||||
}
|
||||
@@ -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 }
|
||||
|
||||
@@ -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'
|
||||
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