Invoke-WsusServerCleanup
Invoke-WsusServerCleanup
Performs the process of cleanup on a specified Windows Server Update Services (WSUS) server.
Syntax
Parameter Set: Default
Invoke-WsusServerCleanup [-CleanupObsoleteComputers] [-CleanupObsoleteUpdates] [-CleanupUnneededContentFiles] [-CompressUpdates] [-DeclineExpiredUpdates] [-DeclineSupersededUpdates] [-UpdateServer <IUpdateServer> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Detailed Description
The Invoke-WsusServerCleanup cmdlet performs the process of cleanup on a specified Windows Server Update Services (WSUS) server. This process has the same impact as running the Cleanup Wizard from within the WSUS Console application and allows the specification of the same options as parameters.
Parameters
-CleanupObsoleteComputers
Specifies that obsolete computers should be deleted from the database.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-CleanupObsoleteUpdates
Specifies that obsolete updates should be deleted from the database.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-CleanupUnneededContentFiles
Specifies that unneeded update files should be deleted.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-CompressUpdates
Specifies that obsolete revisions to updates should be deleted from the database.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-DeclineExpiredUpdates
Specifies that expired updates should be declined.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-DeclineSupersededUpdates
Specifies that superseded updates should be declined.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-UpdateServer<IUpdateServer>
Specifies the object that contains the WSUS server. This value is obtained by calling the Get-WsusServer cmdlet and piping the resulting IUpdateServer object into this cmdlet.
Aliases |
Server |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
true (ByValue) |
Accept Wildcard Characters? |
false |
-Confirm
Prompts you for confirmation before running the cmdlet.
Required? |
false |
Position? |
named |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? |
false |
Position? |
named |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Microsoft.UpdateServices.Commands.IUpdateServer
IUpdateServer
Outputs
The output type is the type of the objects that the cmdlet emits.
- None
Examples
EXAMPLE 1
This example runs this cmdlet on the local WSUS Server specifying the option to clean up obsolete computers.
PS C:\> Get-WsusServer | Invoke-WsusServerCleanup -CleanupObsoleteComputers
EXAMPLE 2
This example runs this cmdlet on the server named contoso specifying the options to clean up obsolete computers and obsolete updates.
PS C:\> Get-WsusServer consoso | Invoke-WsusServerCleanup -CleanupObsoleteComputers -CleanupObsoleteUpdates