Hello,

I am trying to write a script using VBScript that gets a lise of all
active users in Active Directory incl specified attributes 1,2,3..etc
(if possible also specify which users to leave out eg.users in OU x)
and then adds them to a table in a MS SQL database. Table will have
corresponding columns..name, email,samAccountName,Attrib1,Attrib2 etc

And then daily scheduled runs of the script updates the SQL table from
data in AD with any modifications made to the accounts and adds any
new users that were not there before.


Is this possible using VBScript? sorry am restricted to only using
vbscript. If so, any help or hints or ideas would be greatly
appreciated.

Thanks in advance :-)

Yas

Re: Copy Active directory Users to a SQL DB table - Daily by itsmillertime4u

itsmillertime4u
Wed Jun 20 16:39:33 CDT 2007

It is, but really is it necessary. You can connect to AD directly
from SQL as it were a remote SQL server, and to me this makes more
sense.


Re: Copy Active directory Users to a SQL DB table - Daily by Yas

Yas
Thu Jun 21 04:00:53 CDT 2007

On 20 Jun, 23:39, "itsmillertim...@gmail.com"
<itsmillertim...@gmail.com> wrote:
> It is, but really is it necessary. You can connect to AD directly
> from SQL as it were a remote SQL server, and to me this makes more
> sense.

Yes to me too :-) however I'm limited by the 1000 limit of AD and
there are over 2000 users that I need to retrive.


Yas


Re: Copy Active directory Users to a SQL DB table - Daily by Waydaws

Waydaws
Thu Jun 21 11:30:20 CDT 2007

On Jun 21, 2:00 am, Yas <yas...@gmail.com> wrote:
> On 20 Jun, 23:39, "itsmillertim...@gmail.com"
>
> <itsmillertim...@gmail.com> wrote:
> > It is, but really is it necessary. You can connect to AD directly
> > from SQL as it were a remote SQL server, and to me this makes more
> > sense.
>
> Yes to me too :-) however I'm limited by the 1000 limit of AD and
> there are over 2000 users that I need to retrive.
>
> Yas

You're limited to 1000, if you don't specify a page size in your
query. If you the page size, it will return the query results in
pages of whatever size you select. It will pause slightly between
each page (but you won't notice it in the script), and will continue
until no more records that match the query are returned. Yep, you can
even set it to 1000, but not more. Try it; it will work.


Re: Copy Active directory Users to a SQL DB table - Daily by Richard

Richard
Thu Jun 21 12:36:02 CDT 2007


"Waydaws" <wayne_dawson@inventuresolutions.com> wrote in message
news:1182443420.437750.86760@n2g2000hse.googlegroups.com...
> On Jun 21, 2:00 am, Yas <yas...@gmail.com> wrote:
>> On 20 Jun, 23:39, "itsmillertim...@gmail.com"
>>
>> <itsmillertim...@gmail.com> wrote:
>> > It is, but really is it necessary. You can connect to AD directly
>> > from SQL as it were a remote SQL server, and to me this makes more
>> > sense.
>>
>> Yes to me too :-) however I'm limited by the 1000 limit of AD and
>> there are over 2000 users that I need to retrive.
>>
>> Yas
>
> You're limited to 1000, if you don't specify a page size in your
> query. If you the page size, it will return the query results in
> pages of whatever size you select. It will pause slightly between
> each page (but you won't notice it in the script), and will continue
> until no more records that match the query are returned. Yep, you can
> even set it to 1000, but not more. Try it; it will work.
>

In the example script I posted to your question in the
microsoft.public.windows.server.scripting newsgroup I turned on paging by
setting Page Size to 100. This will retrieve all records no matter how many
there are. The max value allowed is 1000. The actual value assigned is not
important (larger values may be less efficient).

--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--