Server.ServiceInstanceId Property
SQL Server 2008 R2
Gets the ID value that uniquely identifies the service instance for this instance of SQL Server.
Assembly: Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)