Problem with Signing Keys API for BES 8.0 on Windows Server 2008 R2

(imported topic written by vuppal91)

Operating Env:

BigFix Version: 8.0.584

BES API Version: 8.0.584

BES API client OS: Windows Server 2008, R2, 64 bit. With latest updates.

BigFix server and BES API are installed on different machines.

I am attempting to do a very simple thing, Validate the user credentials.

The below code works as expected on Windows Server 2003 32 bit.

This code does not work and does not provide any diagnostic information on Windows Server 2008 R2, 64 bit.

VB Script code is

Set sk = CreateObject(“BESAPI.SigningKeys”)

Trace “Setting SigningKey properties.”

sk.SetDSN dsn

sk.SetPrivateKeyPath username, keypath

sk.SetPublisherCertPath username, pubcertpath

sk.SetLicenseCertPath username, liccertpath

Trace “Asking if signing keys are valid.”

havecred = sk.AreSigningKeysValid(username, password)

If havecred 1 Then

trace “Could not verify credentials. Error given was:”

trace sk.DiagnosticMessage

ValidateUserCredentials = False

Set sk = Nothing

Else

trace "Credentials were valid. Continuing. "

End If

Your help is appreciated.

One of our customers is stuck.

Our product integration with bigFix is not functional because they are using Windows Server 2008 R2, 64 bit as their operating environment.

(imported comment written by BenKus)

It is possible that there might be a problem with the x64 vs. 32-bit file access… Here is something I found online… Not sure if it will help:

http://blogs.msdn.com/b/joshpoley/archive/2008/09/18/running-32bit-dependent-scripts-in-a-64bit-world.aspx

Ben

(imported comment written by vuppal91)

Was able to resolve the issue.

The above article was a good starting spot.

Issue: BES API is a 32 bit COM object. ODBC DSN created should use 32 bit SQL Server driver and should be created using 32 bit odbc tools.

Earlier versions of BES API used to create an odbc DSN bes_EnterpriseServer.

BES API 8.0 does not create this DSN. This has to be created manually after installing the API.

On a 32 bit system I create this DSN and everything worked.

On 64 bit system, I created this DSN and API was failing.

  • The default SQL Server driver on 64 bit OS is a 64 bit driver.

  • The default tools used to create the DSN are 64 bit tools.

To fix this issue I had to do the following

  1. Register a 32 bit SQL Server driver with ODBC

  2. Create a DSN using this 32 bit SQL Server driver using 32 bit odbc tools.

  3. Register a 32 bit SQL Server driver with ODBC

Under the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBCINST.INI\ODBC Drivers

Create a new string value “Custom SQL Server 32” = Installed

Under the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBCINST.INI

Create a new Key = Custom SQL Server 32

Under “Custom SQL Server 32” key create two string values

Driver = “c:\windows\syswow64\SQLSRV32.dll”

Setup = “c:\windows\syswow64\SQLSRV32.dll”

  1. Create a DSN using this 32 bit SQL Server driver using 32 bit odbc tools.

Open command prompt

cd C:\Windows\SysWOW64

Run odbcad32.exe

System DSN

Add a new DSN

driver = Custom SQL Server 2

name = bes_EnterpriseServer

Use SQL Server authentication

Give the name / password of BigFix user

Fill the rest of the details etc.

Test the data source

Use the above DSN in BES API.

Since the API needs a DSN it should create one on its own as the pre 8.0 version used to do. And the new DSN should be created using 32 bit libraries and tools as specified above.