SCCM WebService API Reference

SCCMWebService..::..RestartComputer Method

Restarts the computer.

Namespace:  SCCMWebService
Assembly:  SCCMWebService (in SCCMWebService.dll)

Syntax


[SoapHeaderAttribute]
[WebMethodAttribute]
public bool RestartComputer(
	string computername,
	int timeoutSeconds,
	bool force
)
<SoapHeaderAttribute> _
<WebMethodAttribute> _
Public Function RestartComputer ( _
	computername As String, _
	timeoutSeconds As Integer, _
	force As Boolean _
) As Boolean
[SoapHeaderAttribute]
[WebMethodAttribute]
public:
bool^ RestartComputer(
	String^ computername, 
	int^ timeoutSeconds, 
	bool^ force
)

Parameters

computername
Type: String
The computername.
timeoutSeconds
Type: Int32
The timeout seconds.
force
Type: Boolean
if set to true force restart.

Return Value

true if succeeded, otherwise false.

Exceptions


ExceptionCondition
ExceptionComputer name must not be empty! or Unable to get DNS host name for computer + computername + ! or Unable to restart computer + computername + because host is unreachable!