# Get current Application Pool settings
cmd /c '"c:\Windows\System32\inetsrv\appcmd.exe"  list apppool "wsuspool" /text:*'

# Set private memory limit for WsusPool
C:\Windows\System32\inetsrv\InetMgr.exe
iisreset

# next demo...
pause

# Move WID to D:
Stop-Service IISADMIN
Stop-Service WsusService
# do the move...
pause

Start-Service IISADMIN
Start-Service WsusService

# Run WSUS Re-Index script
cmd /c 'sqlcmd -S np:\\.\pipe\MICROSOFT##WID\tsql\query -i c:\NTK\WsusDBMaintenance.sql -I'

# Enhance cleanup performance
cmd /c 'sqlcmd -S np:\\.\pipe\MICROSOFT##WID\tsql\query -i "C:\NTK\EnhanceCleanupPerformance.sql" -I'

# Run WSUS Server Cleanup Utility
Get-WsusServer | Invoke-WsusServerCleanup CleanupObsoleteUpdates -CleanupUnneededContentFiles -CompressUpdates -DeclineExpiredUpdates -DeclineSupersededUpdates

# Move Content
cmd /c '"C:\Program Files\Update Services\Tools\WsusUtil.exe" movecontent D:\WSUS\ D:\wsusmove.log'

# check Superseded Updates
.\Decline-SupersededUpdatesWithExclusionPeriod.ps1 -UpdateServer (hostname) -Port 8530 -SkipDecline

# next demo...
pause

# Run DGASoftwareUpdateMaintenance.ps1
C:\NTK\SoftwareUpdateMaintenance\Invoke-DGASoftwareUpdateMaintenance.ps1 -FirstRun

# Run DGASoftwareUpdateMaintenance.ps1
C:\NTK\SoftwareUpdateMaintenance\Invoke-DGASoftwareUpdateMaintenance.ps1