Restart-AdsComputer
SYNOPSIS
Restarts ("reboots") the operating system on local and remote TwinCAT computers.
SYNTAX
NetIdPort (Default)
Restart-AdsComputer [-Wait] [-WaitTimeout <Int32>] [-Delay <Int32>] [[-NetId] <AmsNetId[]>] [-Timeout <Int32>]
[-Quiet] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
Route
Restart-AdsComputer [-Wait] [-WaitTimeout <Int32>] [-Delay <Int32>] [-InputObject] <IRoute[]>
[-Timeout <Int32>] [-Quiet] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
AddressStr
Restart-AdsComputer [-Wait] [-WaitTimeout <Int32>] [-Delay <Int32>] [-Address] <String[]> [-Timeout <Int32>]
[-Quiet] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
Session
Restart-AdsComputer [-Wait] [-WaitTimeout <Int32>] [-Delay <Int32>] -Session <ISession[]> [-Timeout <Int32>]
[-Quiet] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
SessionId
Restart-AdsComputer [-Wait] [-WaitTimeout <Int32>] [-Delay <Int32>] -SessionId <Int32[]> [-Timeout <Int32>]
[-Quiet] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
DESCRIPTION
The Restart-AdsComputer cmdlet restarts the operating system on the local and remote TwinCAT computers.
You can use the parameters of Restart-AdsComputer to specify available ADS target systems to restart.
The restart can be done delayed if Users are logged into the target system (existant Session UI) or forced immediatly.
You can wait for the restart to complete before you run the next command and specify a waiting time-out.
This feature makes it practical to use Restart-AdsComputer in scripts and functions.
EXAMPLES
EXAMPLE 1
PS> Restart-AdsComputer CX_1111,CX_2222 -force
Restarts the computers CX_1111 and CX_2222 immediatly without warning logged in users on the target system and returns immediatly without waiting the finished reboot.
The Force parameter supresses the ShouldProcess query.
EXAMPLE 2
PS> Restart-AdsComputer -netId '1.2.3.4.1.1', '1.2.3.5.1.1' -Delay 30 -Wait -WaitTimeout 240 -force
Restarts the TwinCAT targets '1.2.3.4.1.1' and 1.2.3.5.1.1' without ShouldProcess query after a delay of 30 Seconds (if a user is logged in) and waits for the reboot before continuing.
The Wait timeout is set to 240 Seconds.
PARAMETERS
-Wait
Activates a wait until the rebooted system is available again.
The parameter -WaitTimeout specifies how long the script waits for the reboot.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-WaitTimeout
The Wait time for the reboot of the target system (default 120 Seconds).
This parameter is used in conjunction with the -Wait parameter.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 120
Accept pipeline input: False
Accept wildcard characters: False
-Delay
The delay time for the reboot/shutdown of the target system(s) in seconds.
The default is 120 Seconds.
If no user is logged in the target system the reboot/shotdown occurs always immediatly without warning.
In case of a log in, a Warning message with countdown will be presented to the user.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
-NetId
NetId(s) of the target system.
Type: AmsNetId[]
Parameter Sets: NetIdPort
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-InputObject
The ADS routes to shutdown/reboot.
Type: IRoute[]
Parameter Sets: Route
Aliases: Destination, Route
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
-Address
Target names/addresses.
These can consist of RouteName, NetID, HostName or IPAddress.
This parameter supports wildcards.
Type: String[]
Parameter Sets: AddressStr
Aliases: Name
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: True
-Session
The Session(s) to use for addressing the target systems.
Type: ISession[]
Parameter Sets: Session
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
-SessionId
Specifies the Sessions (with unique ID) to use for addressing the target systems.
Type: Int32[]
Parameter Sets: SessionId
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Timeout
The communication ADS timeout in milliseconds.
A value of 0 disables the timeout.
A value \<= 0 sets the Default (5000 ms).
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: -1
Accept pipeline input: False
Accept wildcard characters: False
-Quiet
The Quiet parameter suppresses the 'ShouldProcess' messsage and the Cmdlet will be processed without further user confirmation.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: Silent
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ProgressAction
{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
TwinCAT.IRoute[]
The ADS routes to shutdown/reboot.
TwinCAT.ISession[]
The Session(s) to use for addressing the target systems.