This documentation is archived and is not being maintained.

ServiceController.MachineName Property

Gets or sets the name of the computer on which this service resides.

[Visual Basic]
Public Property MachineName As String
public string MachineName {get; set;}
public: __property String* get_MachineName();
public: __property void set_MachineName(String*);
public function get MachineName() : String;
public function set MachineName(String);

Property Value

The name of the computer that is running the service associated with this ServiceController instance. The default is the local computer (".").


Exception Type Condition
ArgumentException The MachineName syntax is invalid.


The computer name is the name of the server that is running this service, without the preceding backslash characters (\\).


Platforms: Windows NT Server 4.0, Windows NT Workstation 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

ServiceController Class | ServiceController Members | System.ServiceProcess Namespace