This project is read-only.
1
Vote

Login failure when I EXEC SetADProperty

description

Where does SQL obtain the security permission to modify the AD properties when we create the procedure? I assume that my security account cannot modify the directory.

/ Set Active Directory property value /
CREATE PROCEDURE SetADProperty (@domain sysname, @userName sysname, @password sysname, @property sysname, @value sysname)
AS EXTERNAL NAME [ADL].[ADLibrary.ADLibraryClass].[SetADProperty]
GO


QUERY:

DECLARE @domain SYSNAME, @user SYSNAME
EXEC MASTER..xp_regread @rootkey = N'HKEY_LOCAL_MACHINE',
@key = N'SYSTEM\ControlSet001\Services\Tcpip\Parameters\',
@value_name = N'Domain',
@value = @domain OUTPUT

--Set Active Directory property value

EXEC SetADProperty @domain, N'someuser', N'*******', N'mailNickname', N'newvalue'

MESSAGES:

Logon failure: unknown user name or bad password.

comments