Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Could not find server 'ADSI' in sys.servers

Author  Topic 

Liat001
Starting Member

17 Posts

Posted - 2010-05-31 : 09:11:27
Hi all,
I have a problem with running SP which connect to the active directory.
I wrote:

ALTER PROCEDURE [...System_CreateActiveDirectoryUserTable] AS

BEGIN
IF NOT EXISTS (SELECT srv.name FROM sys.servers srv WHERE srv.server_id != 0 AND srv.name = N'ADSI')
BEGIN
EXEC master.dbo.sp_addlinkedserver
@server = N'ADSI'
,@srvproduct=N'Active Directory Service Interfaces'
,@provider=N'ADSDSOObject'
,@datasrc=N'adsdatasource'
EXEC master.dbo.sp_addlinkedsrvlogin
@rmtsrvname=N'ADSI'
,@useself=N'False'
,@locallogin=NULL
,@rmtuser=N'****'
,@rmtpassword=****
END

/************/
..
.. (some code)
..
And then I try to do F5 and I got this message:

Could not find server 'ADSI' in sys.servers. Verify that the correct server name was specified. If necessary, execute the stored procedure sp_addlinkedserver to add the server to sys.servers.

but when I running the Code I wrote to you Manualy and then the other code its work.
what could be the reason?
thanks
liat.
   

- Advertisement -