Below is how the translator establishes a database connection.
It basically builds a SQL connection string based on the information passed in by the notify.vbs and builds a connection string based on that information. The currently logged on credentials are use (Translator by default runs as the local system account just like SMS exec).
[Intel vPro Expert Center Moderator added: Any user submitted code or materials posted on this blog is supplied under license from the submitter, and should be used or downloaded in accordance with any license terms specified. Intel is not responsible for user submitted code nor warrants that it will work correctly. If no license is provided, you should contact the submitter. Notify.vbs is provided by Intel under the license included with the Intel Setup and Configuration Service (Intel SCS) download package.]
Hope this helps identify how to connect to your database.
using System.Data.SqlClient;
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();CimItem inputItem = context.GetItem();
string fqdName = (string)inputItem.GetProperty("Name");
string siteCode = (string)inputItem.GetProperty("Site");
string serverName = (string)inputItem.GetProperty("Server");
string resId = (string)inputItem.GetProperty("ResourceId");
builder.UserID="default";builder.Password"default";builder.ConnectTimeout = 30;
builder.Add"server", serverName);builder.Add("database", siteCode);builder.Add("Trusted_Connection", "yes");
CimContext.TraceInformati("Conneting to " + serverName); SqlConnection connection= new SqlConnection(builder.ToString());
Hope this helps identify how to connect to your database.