WSUS CLEANUP via Powershell

$WSUS = Get-WsusServer -Name SERVERNAME -PortNumber 8530Invoke-WsusServerCleanup -UpdateServer $WSUS -CleanupObsoleteComputers -VerboseInvoke-WsusServerCleanup -UpdateServer $WSUS -CleanupObsoleteUpdates -VerboseInvoke-WsusServerCleanup -UpdateServer $WSUS -CleanupUnneededContentFiles -VerboseInvoke-WsusServerCleanup -UpdateServer $WSUS -DeclineExpiredUpdates -VerboseInvoke-WsusServerCleanup -UpdateServer $WSUS -DeclineSupersededUpdates -Verbose

GPO | Create a scheduled task

Create the task on a computer. Set the executional principal to ‘NT AUTHORITY\SYSTEM’. Type the string directly or search for ‘SYSTEM’ in the computers local branch. Test it locally. Export the Task as xml. Copy the xml to an accessable network share. Create a powershell script to install the task out of this xml. Example […]

Windows 10 | Setting NIC Properties dependig on Vendor via Powershell

Get-NetAdapter -Physical | where InterfaceDescription -eq “Intel(R) Ethernet Connection (7) I219-V” | Set-NetAdapterAdvancedProperty -NoRestart -DisplayName “Energieeffizientes Ethernet” -DisplayValue “Aus” Get-NetAdapter -Physical | where InterfaceDescription -eq “Realtek*” | Set-NetAdapterAdvancedProperty -NoRestart -RegistryKeyword “EEE” -RegistryType “REG_SZ” -RegistryValue “0” Get-NetAdapter -Physical | where DriverProvider -eq “Intel” | where DriverVersion -like “12.18.8.*” | Set-NetAdapterAdvancedProperty -NoRestart -DisplayName “Energieeffizientes Ethernet” -DisplayValue “Ein” […]

Powershell | Cleanup all the printer spooler queues

$computers = @(“COMP01″,”COMP02”) foreach ($computer in $computers) { echo $computer if (Test-Connection -BufferSize 32 -Count 1 -ComputerName $computer -Quiet) { echo “ON” #Get-WmiObject -computer $computers Win32_Service -Filter “Name=’Spooler'”| ft systemname, name, state #set your first argument as $computer #$computer = $args[0] #Stop the service: Get-WmiObject -Class Win32_Service -Filter ‘name=”spooler”‘ -ComputerName $computer | Invoke-WmiMethod -Name StopService […]