Invoke-WsusServerCleanup
Performs the process of cleanup on a specified Windows Server Update Services (WSUS) server.
Invoke-WsusServerCleanup
[-CleanupObsoleteComputers]
[-CleanupObsoleteUpdates]
[-CleanupUnneededContentFiles]
[-CompressUpdates]
[-DeclineExpiredUpdates]
[-DeclineSupersededUpdates]
[-UpdateServer <IUpdateServer>]
[-Confirm]
[-WhatIf]
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.
PS C:\> Get-WsusServer | Invoke-WsusServerCleanup -CleanupObsoleteComputers
Obsolete Computers Deleted: 1
This example runs this cmdlet on the local WSUS Server specifying the option to clean up obsolete computers.
PS C:\> Get-WsusServer consoso | Invoke-WsusServerCleanup -CleanupObsoleteComputers -CleanupObsoleteUpdates
Obsolete Updates Deleted: 62
Obsolete Computers Deleted: 0
This example runs this cmdlet on the server named contoso specifying the options to clean up obsolete computers and obsolete updates.
Specifies that obsolete computers should be deleted from the database.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies that obsolete updates should be deleted from the database.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies that unneeded update files should be deleted.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies that obsolete revisions to updates should be deleted from the database.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies that expired updates should be declined.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies that superseded updates should be declined.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
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.
Type: | IUpdateServer |
Aliases: | Server |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Microsoft.UpdateServices.Commands.IUpdateServer
IUpdateServer
None