external help file | Module Name | online version | schema |
---|---|---|---|
AutomaticMaintenance-help.xml |
AutomaticMaintenance |
2.0.0 |
The function executes all maintenance steps on a single host.
Invoke-ComputerMaintenance -ComputerName <String> [-PreventiveLockTimeout <Int32>] [-PreventiveLockThreshold <TimeSpan>] [-SkipNotLockable] [-SkipPreventivelyLocked] [-EnableMaintenanceLog] [<CommonParameters>]
Use this function to perform maintenance on a single host, defined in the hosts configuration file. If you use an orchestration/configuration management system, you might prefer it over Invoke-InfrastructureMaintenance to run Invoke-ComputerMaintenance.
PS C:\> Start-ComputerMaintenance -ComputerName 'SRV01'
Performs maintenance tasks on SRV01.
PS C:\> Start-ComputerMaintenance -ComputerName 'SRV01' -PreventiveLockThreshold (New-Object -TypeName 'System.TimeSpan' -ArgumentList @(2, 0, 0))
Performs maintenance tasks on SRV01. If the host will be locked, the function will wait for 2 hours for it to unlock.
The name of a computer to process.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies how long the function will wait if a target host is locked by some other function.
Type: TimeSpan
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies how often the function will request the lock status of a target host while waiting for it to unlock.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Defines if the maintenance process should silently skip a host if the function cannot put a host lock on it. Otherwise the function will raise an exception.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Defines if the maintenance process should silently skip a host if it is locked by some other function. Otherwise the function will raise an exception.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies if maintenance events should be tracked in the $ModuleWideMaintenanceLogFilePath
file. Disabled by default.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).