Hassan Agmir Hassan Agmir

Fix Commlink IIS and SQL Server Authentication

Hassan Agmir

Domain credentials validated

Objective: Make Commlink running under IIS on LABOTEST connect to the remote SQL Server INTERCOCINASVR using your existing Windows domain account instead of the computer account INTERCOCINA\LABOTEST$.

1. Initial problem

Your IIS application pool was configured as:

Application Pool: comlink
Identity: ApplicationPoolIdentity

When Commlink connected to the remote SQL Server using Windows Authentication, SQL Server received:

INTERCOCINA\LABOTEST$

SQL Server rejected this login.

2. What we have already configured

On LABOTEST:

  • IIS application pool: comlink

  • Website: comlink

  • 32-bit applications: enabled (True)

  • Sage directory copied to C:\SageData

  • Permissions granted to IIS AppPool\comlink

  • Application directory: C:\inetpub\wwwroot\comlink

Sage files were found at:

C:\Users\ag.hassan\Desktop\Sage\STILEMOBILI

And copied to:

C:\SageData\STILEMOBILI

3. Domain account verification

Your account:

INTERCOCINA\ag.hassan

We tested:

Test

Result

whoami

Success

runas

Launched successfully

ValidateCredentials("INTERCOCINA\ag.hassan", ...)

False

ValidateCredentials("ag.hassan", ...)

True

The important discovery is that Active Directory validates your credentials using:

ag.hassan

4. Final configuration to apply

In IIS Manager:

  1. Application Pools → comlink.

  2. Advanced Settings.

  3. Process Model → Identity → Custom account → Set.

  4. Enter:

Username: ag.hassan
Password: Your Windows domain password

Alternatively, use PowerShell as Administrator:

Import-Module WebAdministration

$cred = Get-Credential "ag.hassan"

Set-ItemProperty IIS:\AppPools\comlink `
    -Name processModel `
    -Value @{
        identityType = 3
        userName = $cred.UserName
        password = $cred.GetNetworkCredential().Password
    }

Restart-WebAppPool -Name "comlink"

Verify:

(Get-ItemProperty IIS:\AppPools\comlink).processModel |
    Select-Object identityType, userName

Expected:

identityType : SpecificUser
userName     : ag.hassan

5. SQL Server permissions

Once IIS successfully accepts your account, connect to SQL Server INTERCOCINASVR using SSMS and execute:

USE master;
GO

CREATE LOGIN [INTERCOCINA\ag.hassan]
FROM WINDOWS;
GO

For the STILEMOBILI database, if this is the database Commlink uses:

USE STILEMOBILI;
GO

CREATE USER [INTERCOCINA\ag.hassan]
FOR LOGIN [INTERCOCINA\ag.hassan];
GO

ALTER ROLE db_datareader
ADD MEMBER [INTERCOCINA\ag.hassan];

ALTER ROLE db_datawriter
ADD MEMBER [INTERCOCINA\ag.hassan];
GO

These are initial permissions; additional Sage permissions may be necessary.

6. Remaining tests

  1. Configure IIS with ag.hassan.

  2. Verify the application pool identity.

  3. Grant your domain account access to the required Sage files.

  4. Grant the necessary SQL Server permissions.

  5. Test Commlink API and Sage COM operations.

  6. If SQL still rejects authentication, investigate Kerberos delegation and SPNs if impersonation or a double-hop is involved.

Important: We have confirmed that your domain credentials validate with the short username ag.hassan, but we have not yet confirmed that IIS accepts them or that the remote SQL connection works.

Do not grant sysadmin or use sa. Also, using your personal account means password changes or account restrictions can interrupt Commlink.

Current status: The next action is to configure the IIS application pool with ag.hassan and verify that it changes to SpecificUser.

Subscribe to my Newsletters

Stay updated with the latest programming tips, tricks, and IT insights! Join my community to receive exclusive content on coding best practices.

© Copyright 2025 by Hassan Agmir . Built with ❤ by Me