Intel vPro® Platform
Intel Manageability Forum for Intel® EMA, AMT, SCS & Manageability Commander
2835 Discussions

Notify.vbs + SCCM + Remote Database doesn't work

idata
Employee
1,185 Views

Hi,

I'm trying to get the new host based configuration to work with SCCM, but the provided notify.vbs script doesn't seem to work when the site database is not hosted on the configuration manager server. As far as I can see, Notify.vbs blindly adds the sccmSiteServer address as the SQL server:

'Invoke string with arugments for SiteCode,SQLServer Name,

 

'Resource Name (FQDN of AMT machine),

 

'ResourceID returned from ImportComputers

 

'This code uses the translator to work around and SCCM AMT import bug

strInput="

" &_

 

"

" & "SMS_" & sitecode & "

" &_

 

"

" & sccmSiteServer & "

" &_

 

"

" & fqdn & "

" &_

 

"

" & ResourceID & "

" &_

 

""

But changing it to my real database server does not seem to work, because wsman translator tries to connect using named pipes (should try TCP for remote database). I had a look at the wstrans source but didn't find any reference to SQL.

Any idea how to fix this?

Thanks.

0 Kudos
1 Reply
idata
Employee
345 Views

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);

SqlConnect...

0 Kudos
Reply