Showing posts with label directory. Show all posts
Showing posts with label directory. Show all posts

Sunday, March 25, 2012

ActiveX script to grab all users in Active Directory and tranfer to SQL Server.

Hello,

Does anyone has any idea, or information on how to write an ActiveX script to grab all the users from Active Directory and transfer it into a recordset, SQL server, etc..

Really need help.

Thank you very much.

I'm assuming that because this is a SSIS forum you are looking to use the SSIS ActiveX Script Task?

Don't do it. That task is only there for DTS 2000 migrated packages. Use a Script Task instead.

-Jamie|||

I am using SQL Server 2000. So, I do want to use a script task, and that's what I have (code snippet):


Dim con
Dim rs
Dim FileSystem
Set FileSystem = WScript.CreateObject("Scripting.FileSystemObject")
Set OutPutFile = FileSystem.CreateTextFile("marketing.txt", True)

set con = CreateObject("ADODB.connection")
set rs = CreateObject("ADODB.recordset")
con.Provider = "ADsDSOObject"
con.Open "Active Directory Provider"
Set rs = con.Execute("<LDAP://MyServerName/DC=MyDomain>;(objectClass=User);ADsPath;onelevel")


But when I execute I get an error message stating that table does not exist. That happens in the LDAP Provider. Any ides?

Thank you.

|||This isn't a DTS forum. Try microsoft.public.sqlserver.dts on USENET/NNTP/newsgroups/whatever they're call these days.sql

Tuesday, March 20, 2012

Active Directory/ADSI connection problems...Here's the correct syntax

I am having weird problems using ADSI and SQL Server. Our local intranet is ASP with a SQL database on Windows 2003 Server. It uses Active Directory (via ADSI linked server) to get authenicate users, etc.

Every now and then (about once a month) the SQL connection to AD will "crash". The following error is what I see when it has crashed:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC SQL Server Driver][SQL Server]OLE DB error trace [OLE/DB Provider 'ADSDSOObject' ICommandText::Execute returned 0x80040e37].

Sometimes it will come back on its own later, others are solved by a server reboot. Here is how my SQL query looks:

SELECT adspath
FROM OPENQUERY(ADSI,
'<LDAP://DC=servername,DC=net>;(&(objectCategory=Person)(objectClass=user));adspath;subtree')
Rowset_1
WHERE (sn <> '')

Where can I start to get to the bottom of this?Anyone?|||

Is your issue resolved?

Thanks

|||I have the same problem, please if you solve it please help me fix it.|||

Have you gotten anywhere with your problem?

This is what was found in our SQL Error logs: "Failed to obtain TransactionDispenserInterface: Result Code = 0x8004d01b".

Our problem occurs from our weekly reboot - so we see the error toward the top of the log. This error seems to be occuring frequently on our servers lately. It is not only causing outage problems on our ADSI linked servers but we have a new implementation of an application that uses impersonation(Kerberos) from Web & Sharepoint servers to SQL Server that is about to go to production that recently shared in this problem also.

It seems to be due to the fact that MSDTC is not available when SQL Server starts. We are going to be trying a registry key fix to force a dependency that was recommended. We will see after this weekend.

|||

Just to follow-up:

It's been a month now and the fix seems to have worked. The originator of this thread had problems with SQL Server on Windows 2003. But in our systems, the servers affected are SQL Servers on Windows 2000 only, both SQL Server 2000 and 2005.

Add the "MSDTC" to the registry to force SQL Server to be dependent on MSDTC service (where MSSQL is the default instance):

Key: [HKEY_LOCAL_MACHINE\SYSTEM\CURRENTCONTROLSET\SERVICES\MSSQL]

Value Name: DependOnService

Value Type : REG_MULTI_SZ

Value: MSDTC

|||

Almost the whole issue is syntax related.

Linking SQL Server to Active Directory is tricky. and Microsoft support/help isn't very intuitive for this.
Check a few things first...
1. two single quotes not double.
2. Make connection w/out security context.


Follow this syntax:
EXEC master.dbo.sp_addlinkedserver @.server = N'ADSI',
@.srvproduct=N'Active Directory Services', @.provider=N'ADsDSOObject',
@.datasrc=N'Servername.domain.com' --AKA the full computer name of the AD server

Then execute the openquery like this:

select * from openquery
(
ADSI,'SELECT name
FROM ''LDAP://Servername.domain.com''
WHERE objectCategory = ''Person'' AND objectClass = ''user''
')

Active Directory/ADSI connection problems...help!

I am having weird problems using ADSI and SQL Server. Our local intranet is ASP with a SQL database on Windows 2003 Server. It uses Active Directory (via ADSI linked server) to get authenicate users, etc.

Every now and then (about once a month) the SQL connection to AD will "crash". The following error is what I see when it has crashed:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC SQL Server Driver][SQL Server]OLE DB error trace [OLE/DB Provider 'ADSDSOObject' ICommandText::Execute returned 0x80040e37].

Sometimes it will come back on its own later, others are solved by a server reboot. Here is how my SQL query looks:

SELECT adspath
FROM OPENQUERY(ADSI,
'<LDAP://DC=servername,DC=net>;(&(objectCategory=Person)(objectClass=user));adspath;subtree')
Rowset_1
WHERE (sn <> '')

Where can I start to get to the bottom of this?Anyone?|||

Is your issue resolved?

Thanks

|||I have the same problem, please if you solve it please help me fix it.|||

Have you gotten anywhere with your problem?

This is what was found in our SQL Error logs: "Failed to obtain TransactionDispenserInterface: Result Code = 0x8004d01b".

Our problem occurs from our weekly reboot - so we see the error toward the top of the log. This error seems to be occuring frequently on our servers lately. It is not only causing outage problems on our ADSI linked servers but we have a new implementation of an application that uses impersonation(Kerberos) from Web & Sharepoint servers to SQL Server that is about to go to production that recently shared in this problem also.

It seems to be due to the fact that MSDTC is not available when SQL Server starts. We are going to be trying a registry key fix to force a dependency that was recommended. We will see after this weekend.

|||

Just to follow-up:

It's been a month now and the fix seems to have worked. The originator of this thread had problems with SQL Server on Windows 2003. But in our systems, the servers affected are SQL Servers on Windows 2000 only, both SQL Server 2000 and 2005.

Add the "MSDTC" to the registry to force SQL Server to be dependent on MSDTC service (where MSSQL is the default instance):

Key: [HKEY_LOCAL_MACHINE\SYSTEM\CURRENTCONTROLSET\SERVICES\MSSQL]

Value Name: DependOnService

Value Type : REG_MULTI_SZ

Value: MSDTC

|||

Almost the whole issue is syntax related.

Linking SQL Server to Active Directory is tricky. and Microsoft support/help isn't very intuitive for this.
Check a few things first...
1. two single quotes not double.
2. Make connection w/out security context.


Follow this syntax:
EXEC master.dbo.sp_addlinkedserver @.server = N'ADSI',
@.srvproduct=N'Active Directory Services', @.provider=N'ADsDSOObject',
@.datasrc=N'Servername.domain.com' --AKA the full computer name of the AD server

Then execute the openquery like this:

select * from openquery
(
ADSI,'SELECT name
FROM ''LDAP://Servername.domain.com''
WHERE objectCategory = ''Person'' AND objectClass = ''user''
')

Active Directory/ADSI connection problems...help!

I am having weird problems using ADSI and SQL Server. Our local intranet is ASP with a SQL database on Windows 2003 Server. It uses Active Directory (via ADSI linked server) to get authenicate users, etc.

Every now and then (about once a month) the SQL connection to AD will "crash". The following error is what I see when it has crashed:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC SQL Server Driver][SQL Server]OLE DB error trace [OLE/DB Provider 'ADSDSOObject' ICommandText::Execute returned 0x80040e37].

Sometimes it will come back on its own later, others are solved by a server reboot. Here is how my SQL query looks:

SELECT adspath
FROM OPENQUERY(ADSI,
'<LDAP://DC=servername,DC=net>;(&(objectCategory=Person)(objectClass=user));adspath;subtree')
Rowset_1
WHERE (sn <> '')

Where can I start to get to the bottom of this?Anyone?|||

Is your issue resolved?

Thanks

|||I have the same problem, please if you solve it please help me fix it.|||

Have you gotten anywhere with your problem?

This is what was found in our SQL Error logs: "Failed to obtain TransactionDispenserInterface: Result Code = 0x8004d01b".

Our problem occurs from our weekly reboot - so we see the error toward the top of the log. This error seems to be occuring frequently on our servers lately. It is not only causing outage problems on our ADSI linked servers but we have a new implementation of an application that uses impersonation(Kerberos) from Web & Sharepoint servers to SQL Server that is about to go to production that recently shared in this problem also.

It seems to be due to the fact that MSDTC is not available when SQL Server starts. We are going to be trying a registry key fix to force a dependency that was recommended. We will see after this weekend.

|||

Just to follow-up:

It's been a month now and the fix seems to have worked. The originator of this thread had problems with SQL Server on Windows 2003. But in our systems, the servers affected are SQL Servers on Windows 2000 only, both SQL Server 2000 and 2005.

Add the "MSDTC" to the registry to force SQL Server to be dependent on MSDTC service (where MSSQL is the default instance):

Key: [HKEY_LOCAL_MACHINE\SYSTEM\CURRENTCONTROLSET\SERVICES\MSSQL]

Value Name: DependOnService

Value Type : REG_MULTI_SZ

Value: MSDTC

|||

Almost the whole issue is syntax related.

Linking SQL Server to Active Directory is tricky. and Microsoft support/help isn't very intuitive for this.
Check a few things first...
1. two single quotes not double.
2. Make connection w/out security context.


Follow this syntax:
EXEC master.dbo.sp_addlinkedserver @.server = N'ADSI',
@.srvproduct=N'Active Directory Services', @.provider=N'ADsDSOObject',
@.datasrc=N'Servername.domain.com' --AKA the full computer name of the AD server

Then execute the openquery like this:

select * from openquery
(
ADSI,'SELECT name
FROM ''LDAP://Servername.domain.com''
WHERE objectCategory = ''Person'' AND objectClass = ''user''
')

|||

Hi,

Not sure if this is the correct forum but I also need some help on a similar matter. I have connected my Sharpoint Server to ADAM and imported the users and groups into Sharepoint, however I want to display some SQL 2005 data in a web part, how can I get the ADAM user to be recognized by SQL 2005 using the current logged in Sharepoint (ADAM) User.

Jos

Active Directory/ADSI connection problems...help!

I am having weird problems using ADSI and SQL Server. Our local intranet is ASP with a SQL database on Windows 2003 Server. It uses Active Directory (via ADSI linked server) to get authenicate users, etc.

Every now and then (about once a month) the SQL connection to AD will "crash". The following error is what I see when it has crashed:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC SQL Server Driver][SQL Server]OLE DB error trace [OLE/DB Provider 'ADSDSOObject' ICommandText::Execute returned 0x80040e37].

Sometimes it will come back on its own later, others are solved by a server reboot. Here is how my SQL query looks:

SELECT adspath
FROM OPENQUERY(ADSI,
'<LDAP://DC=servername,DC=net>;(&(objectCategory=Person)(objectClass=user));adspath;subtree')
Rowset_1
WHERE (sn <> '')

Where can I start to get to the bottom of this?Anyone?|||

Is your issue resolved?

Thanks

|||I have the same problem, please if you solve it please help me fix it.|||

Have you gotten anywhere with your problem?

This is what was found in our SQL Error logs: "Failed to obtain TransactionDispenserInterface: Result Code = 0x8004d01b".

Our problem occurs from our weekly reboot - so we see the error toward the top of the log. This error seems to be occuring frequently on our servers lately. It is not only causing outage problems on our ADSI linked servers but we have a new implementation of an application that uses impersonation(Kerberos) from Web & Sharepoint servers to SQL Server that is about to go to production that recently shared in this problem also.

It seems to be due to the fact that MSDTC is not available when SQL Server starts. We are going to be trying a registry key fix to force a dependency that was recommended. We will see after this weekend.

|||

Just to follow-up:

It's been a month now and the fix seems to have worked. The originator of this thread had problems with SQL Server on Windows 2003. But in our systems, the servers affected are SQL Servers on Windows 2000 only, both SQL Server 2000 and 2005.

Add the "MSDTC" to the registry to force SQL Server to be dependent on MSDTC service (where MSSQL is the default instance):

Key: [HKEY_LOCAL_MACHINE\SYSTEM\CURRENTCONTROLSET\SERVICES\MSSQL]

Value Name: DependOnService

Value Type : REG_MULTI_SZ

Value: MSDTC

|||

Almost the whole issue is syntax related.

Linking SQL Server to Active Directory is tricky. and Microsoft support/help isn't very intuitive for this.
Check a few things first...
1. two single quotes not double.
2. Make connection w/out security context.


Follow this syntax:
EXEC master.dbo.sp_addlinkedserver @.server = N'ADSI',
@.srvproduct=N'Active Directory Services', @.provider=N'ADsDSOObject',
@.datasrc=N'Servername.domain.com' --AKA the full computer name of the AD server

Then execute the openquery like this:

select * from openquery
(
ADSI,'SELECT name
FROM ''LDAP://Servername.domain.com''
WHERE objectCategory = ''Person'' AND objectClass = ''user''
')

Monday, March 19, 2012

Active Directory/ADSI connection problems...help!

I am having weird problems using ADSI and SQL Server. Our local intranet is ASP with a SQL database on Windows 2003 Server. It uses Active Directory (via ADSI linked server) to get authenicate users, etc.

Every now and then (about once a month) the SQL connection to AD will "crash". The following error is what I see when it has crashed:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC SQL Server Driver][SQL Server]OLE DB error trace [OLE/DB Provider 'ADSDSOObject' ICommandText::Execute returned 0x80040e37].

Sometimes it will come back on its own later, others are solved by a server reboot. Here is how my SQL query looks:

SELECT adspath
FROM OPENQUERY(ADSI,
'<LDAP://DC=servername,DC=net>;(&(objectCategory=Person)(objectClass=user));adspath;subtree')
Rowset_1
WHERE (sn <> '')

Where can I start to get to the bottom of this?Anyone?|||

Is your issue resolved?

Thanks

|||I have the same problem, please if you solve it please help me fix it.|||

Have you gotten anywhere with your problem?

This is what was found in our SQL Error logs: "Failed to obtain TransactionDispenserInterface: Result Code = 0x8004d01b".

Our problem occurs from our weekly reboot - so we see the error toward the top of the log. This error seems to be occuring frequently on our servers lately. It is not only causing outage problems on our ADSI linked servers but we have a new implementation of an application that uses impersonation(Kerberos) from Web & Sharepoint servers to SQL Server that is about to go to production that recently shared in this problem also.

It seems to be due to the fact that MSDTC is not available when SQL Server starts. We are going to be trying a registry key fix to force a dependency that was recommended. We will see after this weekend.

|||

Just to follow-up:

It's been a month now and the fix seems to have worked. The originator of this thread had problems with SQL Server on Windows 2003. But in our systems, the servers affected are SQL Servers on Windows 2000 only, both SQL Server 2000 and 2005.

Add the "MSDTC" to the registry to force SQL Server to be dependent on MSDTC service (where MSSQL is the default instance):

Key: [HKEY_LOCAL_MACHINE\SYSTEM\CURRENTCONTROLSET\SERVICES\MSSQL]

Value Name: DependOnService

Value Type : REG_MULTI_SZ

Value: MSDTC

|||

Almost the whole issue is syntax related.

Linking SQL Server to Active Directory is tricky. and Microsoft support/help isn't very intuitive for this.
Check a few things first...
1. two single quotes not double.
2. Make connection w/out security context.


Follow this syntax:
EXEC master.dbo.sp_addlinkedserver @.server = N'ADSI',
@.srvproduct=N'Active Directory Services', @.provider=N'ADsDSOObject',
@.datasrc=N'Servername.domain.com' --AKA the full computer name of the AD server

Then execute the openquery like this:

select * from openquery
(
ADSI,'SELECT name
FROM ''LDAP://Servername.domain.com''
WHERE objectCategory = ''Person'' AND objectClass = ''user''
')

Active Directory....

Is it possible to use active directory to maintain the login activities of
SQL Server 2K?
Thanks,
Jessy
Hi
AD can be used to authenticate the user (NT Integrated Security), but AD
does no logging itself of access.
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Jessy Martin" <Jessy_Smith79@.hotmail.com> wrote in message
news:uwoIuukZFHA.3280@.TK2MSFTNGP09.phx.gbl...
> Is it possible to use active directory to maintain the login activities of
> SQL Server 2K?
> Thanks,
> Jessy
>
>

Active Directory....

Is it possible to use active directory to maintain the login activities of
SQL Server 2K?
Thanks,
JessyHi
AD can be used to authenticate the user (NT Integrated Security), but AD
does no logging itself of access.
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Jessy Martin" <Jessy_Smith79@.hotmail.com> wrote in message
news:uwoIuukZFHA.3280@.TK2MSFTNGP09.phx.gbl...
> Is it possible to use active directory to maintain the login activities of
> SQL Server 2K?
> Thanks,
> Jessy
>
>

Active Directory....

Is it possible to use active directory to maintain the login activities of
SQL Server 2K?
Thanks,
JessyHi
AD can be used to authenticate the user (NT Integrated Security), but AD
does no logging itself of access.
--
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Jessy Martin" <Jessy_Smith79@.hotmail.com> wrote in message
news:uwoIuukZFHA.3280@.TK2MSFTNGP09.phx.gbl...
> Is it possible to use active directory to maintain the login activities of
> SQL Server 2K?
> Thanks,
> Jessy
>
>

Active Directory, Terminated Employees

Hello, we have scheduled a nightly refresh into an Employees table in a
database, that receives data from Active Directory. AD is the "authority" o
f
who is an active employee and frees us from manual maintenance of the
Employees table in our DB. However, we want to store information on
employees who resign, retire etc. and don't want orphaned records (this is a
training database storing information on what employees take what classes,
with dates and costs). I'd like to set up some kind of append query but
unlike Access, SQL would not let me append duplicate records. The database
has a termination date field also. Any suggestions would be appreciated.
Thanks, Pancho.Do you want only one row per employee, or one for every change in the
employee data?
Are you only updating the termination date from AD, or are you loading all
of the employee data from AD?
Please include DDL and more detail.
(explained here)
http://www.aspfaq.com/etiquette.asp?id=5006
"Pancho" <Pancho@.discussions.microsoft.com> wrote in message
news:4FBC26F2-F086-4734-8A2B-06CC11525F36@.microsoft.com...
> Hello, we have scheduled a nightly refresh into an Employees table in a
> database, that receives data from Active Directory. AD is the "authority"
of
> who is an active employee and frees us from manual maintenance of the
> Employees table in our DB. However, we want to store information on
> employees who resign, retire etc. and don't want orphaned records (this is
a
> training database storing information on what employees take what classes,
> with dates and costs). I'd like to set up some kind of append query but
> unlike Access, SQL would not let me append duplicate records. The
database
> has a termination date field also. Any suggestions would be appreciated.
> Thanks, Pancho.|||Jim,
We only want one row per employee. To the table structure depicted in the
script below I would ideally like to add a date/time column named TermDate.
If empty the employee would be still active.
Thank you for the etiquette link. The programmer kept default length 255's
on varchars. In reality our EmpNumbers are only 3-4 characters, not 50. In
our employee population, we have some employees who leave to go to college
and then return, and we typically preserve their old employee number, and
reactivate it when they return.
if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[Employees]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Employees]
GO
CREATE TABLE [dbo].[Employees] (
[FullName] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[LName] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[FName] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Extension] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Description] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[EmpNumber] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Email] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Company] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Department] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
"Jim Underwood" wrote:

> Do you want only one row per employee, or one for every change in the
> employee data?
> Are you only updating the termination date from AD, or are you loading all
> of the employee data from AD?
> Please include DDL and more detail.
> (explained here)
> http://www.aspfaq.com/etiquette.asp?id=5006
>
> "Pancho" <Pancho@.discussions.microsoft.com> wrote in message
> news:4FBC26F2-F086-4734-8A2B-06CC11525F36@.microsoft.com...
> of
> a
> database
>
>|||OK, so you need to add a column to your table:
alter table [dbo].[Employees]
add TerminationDate datetime;
Then you need to update this table on a periodic basis? I have not worked
much with AD in SQL Server, but lets assume you are connected and querying
AD as you would a table. We'll call the "table" ADEmpData, and assume it
has EmpNumber and TerminationDate as columns. Also assume EmpNumber can be
duplicated in AD, but it is the PK (or at least unique) in the Employees
table. If you can explain how you are connecting to AD, someone may be able
to provide more complete code.
Update Employees as Emp
set Emp.TerminationDate = (
select top 1 AD.TerminationDate
from ADEmpData as AD
Where AD.EmpNumber = Emp.EmpNumber
order by AD.TerminationDate
-- the above added just to give consistent results with TOP
)
and exists (select 1
from ADEmpData as AD
Where AD.EmpNumber = Emp.EmpNumber)
-- exists used to only attempt to update values if the emp
-- exists in AD
Note that AD may store term date as a string, not a date type, so you may
have to do some conversion here.
"Pancho" <Pancho@.discussions.microsoft.com> wrote in message
news:79A765A9-80AE-4B80-BD4F-106AB1CB636C@.microsoft.com...
> Jim,
> We only want one row per employee. To the table structure depicted in the
> script below I would ideally like to add a date/time column named
TermDate.
> If empty the employee would be still active.
> Thank you for the etiquette link. The programmer kept default length
255's
> on varchars. In reality our EmpNumbers are only 3-4 characters, not 50.
In
> our employee population, we have some employees who leave to go to college
> and then return, and we typically preserve their old employee number, and
> reactivate it when they return.
> if exists (select * from dbo.sysobjects where id =
> object_id(N'[dbo].[Employees]') and OBJECTPROPERTY(id, N'IsUserTable') =
1)
> drop table [dbo].[Employees]
> GO
> CREATE TABLE [dbo].[Employees] (
> [FullName] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
> [LName] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [FName] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [Extension] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [Description] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [EmpNumber] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [Email] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [Company] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [Department] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
> ) ON [PRIMARY]
> GO
>
> "Jim Underwood" wrote:
>
all
a
"authority"
(this is
classes,
but
appreciated.|||Jim,
This is good information and I appreciate the detail. This will probably
work here. Have a nice wend! Pancho.
"Jim Underwood" wrote:

> OK, so you need to add a column to your table:
> alter table [dbo].[Employees]
> add TerminationDate datetime;
> Then you need to update this table on a periodic basis? I have not worked
> much with AD in SQL Server, but lets assume you are connected and querying
> AD as you would a table. We'll call the "table" ADEmpData, and assume it
> has EmpNumber and TerminationDate as columns. Also assume EmpNumber can b
e
> duplicated in AD, but it is the PK (or at least unique) in the Employees
> table. If you can explain how you are connecting to AD, someone may be ab
le
> to provide more complete code.
> Update Employees as Emp
> set Emp.TerminationDate = (
> select top 1 AD.TerminationDate
> from ADEmpData as AD
> Where AD.EmpNumber = Emp.EmpNumber
> order by AD.TerminationDate
> -- the above added just to give consistent results with TOP
> )
> and exists (select 1
> from ADEmpData as AD
> Where AD.EmpNumber = Emp.EmpNumber)
> -- exists used to only attempt to update values if the emp
> -- exists in AD
> Note that AD may store term date as a string, not a date type, so you may
> have to do some conversion here.
> "Pancho" <Pancho@.discussions.microsoft.com> wrote in message
> news:79A765A9-80AE-4B80-BD4F-106AB1CB636C@.microsoft.com...
> TermDate.
> 255's
> In
> 1)
> all
> a
> "authority"
> (this is
> classes,
> but
> appreciated.
>
>|||Glad if I could help.
Please remember to post your final solution so others who have a similar
issue will be able to learn from it.
Also, I am interested in seeing how you handle the AD connection. Thus far
I have only done it via VB.Net and have not connected via SQL Server.
"Pancho" <Pancho@.discussions.microsoft.com> wrote in message
news:84DA9C84-4201-4766-9ADC-FD74F3EB5DED@.microsoft.com...
> Jim,
> This is good information and I appreciate the detail. This will probably
> work here. Have a nice wend! Pancho.
> "Jim Underwood" wrote:
>
worked
querying
it
be
able
may
the
50.
college
and
=
NULL ,
,
NULL ,
the
loading
in
the
on
query|||We use a scheduled DTS package to import a .csv file. The .csv file is
exported nightly using a scheduled .bat file that calls a .vbs script that
performs the export from AD. We're not going to implement the TermDate just
yet but I will post the outcome when we do. Thanks again, P.
"Jim Underwood" wrote:

> Glad if I could help.
> Please remember to post your final solution so others who have a similar
> issue will be able to learn from it.
> Also, I am interested in seeing how you handle the AD connection. Thus fa
r
> I have only done it via VB.Net and have not connected via SQL Server.
>
> "Pancho" <Pancho@.discussions.microsoft.com> wrote in message
> news:84DA9C84-4201-4766-9ADC-FD74F3EB5DED@.microsoft.com...
> worked
> querying
> it
> be
> able
> may
> the
> 50.
> college
> and
> =
> NULL ,
> ,
> NULL ,
> the
> loading
> in
> the
> on
> query
>
>|||You might check out microsoft.public.active.directory.interfaces to see if
you can use a more direct approach. I believe SQL Server allows you to
query AD directly, which could eliminate the need for the VBS, BAT, CSV,
etc. I do not know how much is implemented in 2000 VS 2005, but I think I
have seen some examples in this forum.
"Pancho" <Pancho@.discussions.microsoft.com> wrote in message
news:931B3577-C055-4184-AEF5-AC0D22D9652E@.microsoft.com...
> We use a scheduled DTS package to import a .csv file. The .csv file is
> exported nightly using a scheduled .bat file that calls a .vbs script that
> performs the export from AD. We're not going to implement the TermDate
just
> yet but I will post the outcome when we do. Thanks again, P.
> "Jim Underwood" wrote:
>
far
probably
assume
can
Employees
be
you
depicted in
length
not
number,
N'IsUserTable')
NOT
,
,
NULL
NULL ,
,
NULL ,
NULL
in
table
of
information
records
what
The

active directory with sqll 2005

Hello,
I have an active directoy controller with microsoft SQL 2005 installed
in the same windows 2003 machine.
is there a way to grant a domain user to start/stop sql server without
domain admin privilege?
Many thanks for the help in advance.The local admin on the server would do the trick. Thats what I have on all
SQL servers I manage.
Mohit K. Gupta
B.Sc. CS, Minor Japanese
MCTS: SQL Server 2005
"one2001boy@.yahoo.com" wrote:

> Hello,
> I have an active directoy controller with microsoft SQL 2005 installed
> in the same windows 2003 machine.
> is there a way to grant a domain user to start/stop sql server without
> domain admin privilege?
> Many thanks for the help in advance.
>|||Mohit K. Gupta wrote:
> The local admin on the server would do the trick. Thats what I have on al
l
> SQL servers I manage.
>
For the domain controller on Win 2003, there is no local admin. Your SQL
server must not be on domain controller.
thanks for your help anyway.|||Yeap. Sorry my bad, I wouldn't want SQL Server to be on PDC. The network
guys would make my life a living hell.
Not server guy, but if the service is set to start under set of credentials.
Can those credentials start/stop the service?
Mohit K. Gupta
B.Sc. CS, Minor Japanese
MCTS: SQL Server 2005
"one2001boy@.yahoo.com" wrote:

> Mohit K. Gupta wrote:
> For the domain controller on Win 2003, there is no local admin. Your SQL
> server must not be on domain controller.
> thanks for your help anyway.
>

Active Directory Users Synch with SQL2K table

Hello,
Would anyone know of/recommend a product/site that would be able to
help in a synchronization between the contents of the Active Directory
Users into an SQL table?
Has there been anything written for this?
Thank,
Scott
Scott,
See if this helps..
'OLE DB Provider for Microsoft Directory Services'
http://msdn.microsoft.com/library/en...asp?frame=true
Dinesh
SQL Server MVP
--
SQL Server FAQ at
http://www.tkdinesh.com
"Scott" <shammer125@.hotmail.com> wrote in message
news:f1a31f2.0405210708.543f364b@.posting.google.co m...
> Hello,
> Would anyone know of/recommend a product/site that would be able to
> help in a synchronization between the contents of the Active Directory
> Users into an SQL table?
> Has there been anything written for this?
> Thank,
> Scott

Active Directory Users Synch with SQL2K table

Hello,
Would anyone know of/recommend a product/site that would be able to
help in a synchronization between the contents of the Active Directory
Users into an SQL table?
Has there been anything written for this?
Thank,
ScottScott,
See if this helps..
'OLE DB Provider for Microsoft Directory Services'
]
Dinesh
SQL Server MVP
--
--
SQL Server FAQ at
[url]http://www.tkdinesh.com" target="_blank">http://msdn.microsoft.com/library/e...ww.tkdinesh.com
"Scott" <shammer125@.hotmail.com> wrote in message
news:f1a31f2.0405210708.543f364b@.posting.google.com...
> Hello,
> Would anyone know of/recommend a product/site that would be able to
> help in a synchronization between the contents of the Active Directory
> Users into an SQL table?
> Has there been anything written for this?
> Thank,
> Scott

Active Directory Users Synch with SQL2K table

Hello,
Would anyone know of/recommend a product/site that would be able to
help in a synchronization between the contents of the Active Directory
Users into an SQL table?
Has there been anything written for this?
Thank,
ScottScott,
See if this helps..
'OLE DB Provider for Microsoft Directory Services'
http://msdn.microsoft.com/library/en-us/acdata/ac_8_qd_12_94fn.asp?frame=true
--
Dinesh
SQL Server MVP
--
--
SQL Server FAQ at
http://www.tkdinesh.com
"Scott" <shammer125@.hotmail.com> wrote in message
news:f1a31f2.0405210708.543f364b@.posting.google.com...
> Hello,
> Would anyone know of/recommend a product/site that would be able to
> help in a synchronization between the contents of the Active Directory
> Users into an SQL table?
> Has there been anything written for this?
> Thank,
> Scott

Active Directory User's Member Groups from SQL Server 2000

I can create a Linked Server for ADSI sucessfully but cannot retrieve group
membership for an indivdual user.
I've seen some examples of syntax but can't get it to work.
Does anyone have an example of some code I could use
LindaOLE DB provider for Directory Services does not support multi-valued
attributes such as: members and memberOf. sorry...
"Linda Lou" wrote:

> I can create a Linked Server for ADSI sucessfully but cannot retrieve grou
p
> membership for an indivdual user.
> I've seen some examples of syntax but can't get it to work.
> Does anyone have an example of some code I could use
> Linda

Active Directory User Data

Hi. I'm new to SQL Reporting Services and totally self taught so far.
I am trying to find out if there is a way from within a report to find
out the Active Directory user name or possibly other data from AD about
the user running the report from the web. I want to be able to look at
the user and rstrict the data they are allowed to see based on AD
characteristics. This is for a school district and I want teachers to
be able to go to the web page, run a report, but return only data fro
their students. Thanks in advance for any help.You get the AD username by from the global constant User!UserID. It returns
the username in the form of domain\username.
If you store the AD username of each teacher and a reference to what
students belong to them, you can use this for a query to only return the
data from their students.
I've never tried to query data in the Active Directory through Reporting
Services, but if you look at SQL tutorials, you might find something on how
to query AD data from the usual SQL server tools.
You need to check for information on ADSI
Here are a few links. I haven't tried them myself, but it might give you a
start
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q299410
http://www.databasejournal.com/features/mssql/article.php/2176561
Kaisa M. Lindahl Lervik
<jwilloz@.paplv.esu3.org> wrote in message
news:1161810778.724236.40460@.k70g2000cwa.googlegroups.com...
> Hi. I'm new to SQL Reporting Services and totally self taught so far.
> I am trying to find out if there is a way from within a report to find
> out the Active Directory user name or possibly other data from AD about
> the user running the report from the web. I want to be able to look at
> the user and rstrict the data they are allowed to see based on AD
> characteristics. This is for a school district and I want teachers to
> be able to go to the web page, run a report, but return only data fro
> their students. Thanks in advance for any help.
>

Active Directory Upgrade and SQL

Would upgrading to Active Directory from a NT4 domain have any effect
on SQL Server 2000 SP3a?
After our upgrade we started having connectivity issues with another
server that it pulls data from over the internet going through ISA
Server 2000. The AD upgrade was done on Sunday and the problem did
not surface until Tuesday morning. Monday it seemed to work just
fine. We get timeout errors. The server it connects to is SQL 2000
as well. Google and Microsoft searches have turned up nothing for me
so far. Any ideas?Assuming these are connection timeouts (as opposed to query timeouts), I
would guess that your domain controller is slow to authenticate your
logins. I would suggest checking other connectivity and see if there are
delays in authenticating when you create/access shares and other such
activity.
Cindy Gross, MCDBA, MCSE
http://cindygross.tripod.com
This posting is provided "AS IS" with no warranties, and confers no rights.

Active directory Update

Hi!
I want to write a trigger that add a new computer account in my active directory when I do an Insert in my MSSQL table.

I know how to use SELECTstatements using LDAP but I want to do a INSERT statement. Is that even possible?
Can you write vb code directly in SP i mssql 2000?

What I think I have to do is to have a vbscript that does the adding then call the script using exetended SP cmd execute passing the name to the script.

If someone has a another solutions please let me know!

Regards..I've written simple ActiveX out-of-process OLE servers using VB. This is not hard to do. But I think you're going from the wrong direction. I'd rather add a computer account using LDAP from my VB code and then fire a stored procedure to update whatever you want to update. The other way around is possible too, but it doesn't make it easier, not does it make it right either.

Active Directory Sql Servers

Hi everyone,

how to retrieve programatically the list of the AD's Sql Servers?

You've been looking at SMO classes but it seems that it depends of your own workstation.

Thanks in advance

Hi,

what about using the

SmoApplication.EnumAvailableSqlServers()

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||

Your best bet is to do something like an LDAP query specifying the OU (Organizational Unit) the servers were defined with. The EnumAvailableServers method will scout the SQL Server browsers on your network and bring back everything that responds to a ping, whether the server was defined in AD or not. (Joe Developer may have SQL Server Dev Ed running on his laptop, and you're probably not interested in that server.) Here's a starting point for you:

Dim mySearcher As DirectorySearcher
Dim resEnt As SearchResult
Dim colResults As SearchResultCollection
'Note : microsoft is the name of my domain for testing purposes.
Dim enTry As DirectoryEntry = New DirectoryEntry("LDAP://yourdomain")
mySearcher = New DirectorySearcher(enTry)
mySearcher.Filter = ("(objectClass=*)")
colResults = mySearcher.FindAll
For Each resEnt In colResults
Console.WriteLine(resEnt.GetDirectoryEntry().Name.ToString())
Console.WriteLine(resEnt.GetDirectoryEntry().Path.ToString())
Console.WriteLine(resEnt.GetDirectoryEntry().NativeGuid.ToString())
Console.WriteLine("===========================================")
Next

|||

Thanks a lot to both. I'll check that tomorrow.

Happy coding!

Active Directory Service And IIS Problem

I have a ASP.Net Project to read active directory usernames.

Its working fine when running thru asp development server.

But while running thru IIS Server. It displays the following error

"An exception of type 'System.DirectoryServices.DirectoryServicesCOMException' occurred in System.DirectoryServices.dll but was not handled in user code
Additional information: Logon failure: unknown user name or bad password."

This is my Code :

Public Function readADSusers()
Dim enTry As DirectoryEntry = New DirectoryEntry("LDAP://spiretek.local")
Dim mySearcher As DirectorySearcher = New DirectorySearcher(enTry)
mySearcher.Filter = ("(objectClass=user)")
Dim resEnt As SearchResult
For Each resEnt In mySearcher.FindAll()
Select Case myKey
Case "samaccountname"
TextBox1.Text += myResultPropColl(myKey)(0)
End Select
Next
End Function

Please Help Me......This is not the right forum for this, but you will have to provide network credentials (either the current the process is running with or custom ones) to access the active directory.

Jens K. Suessmeyer.

http://www.sqlserver2005.de