Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - RE: Export from AD to excel filter by group

Reply
 
Old 04-02-2009   #1 (permalink)
Oli M


 
 

RE: Export from AD to excel filter by group

The last login part isn't that important.

If anyone knows how I can just filter the results so that it only shows
users that are not in this one specific group it would be most appreciated.

Thanks

My System SpecsSystem Spec
Old 04-02-2009   #2 (permalink)
Oli M


 
 

Re: Export from AD to excel filter by group

Richard

Thank you for that, that is brilliant.

I have incorporated the group filter part and it is working exactly how I
need.

I actually have already read your last login scipt recently, but am unsure
how I can incorporate that into my existing script.

I would like this current script to query all of the DCS compare the
restults for the lastlogin stamp and then record the latest one for each user
in the outputted excel results.

Sorry if I am asking a bit much and thank you for the help
My System SpecsSystem Spec
Old 04-02-2009   #3 (permalink)
Oli M


 
 

Re: Export from AD to excel filter by group


Or would it be easier to edit your last logon script to include the other
information that i require to be exported into an excel file with the filter
on user by group?
My System SpecsSystem Spec
Old 04-03-2009   #4 (permalink)
Oli M


 
 

Re: Export from AD to excel filter by group

I have looked into combining my script with your ADO last login version but
obviously the syntax is different. So I'm a bit stuck.

Any ideas or pointers please?

My System SpecsSystem Spec
Old 04-03-2009   #5 (permalink)
Richard Mueller [MVP]


 
 

Re: Export from AD to excel filter by group


"Oli M" <OliM@xxxxxx> wrote in message
news:BA6BAC90-069C-4B2B-B211-3006CD108F2A@xxxxxx
Quote:

>I have looked into combining my script with your ADO last login version but
> obviously the syntax is different. So I'm a bit stuck.
>
> Any ideas or pointers please?
>
The best solution is to retrieve the lastLogonTimeStamp attribute, if your
domain is at Windows Server 2003 functional level. If your domain is not at
this functional level, it is difficult to add lastLogon to your script. The
best solution I can think of is as follows:
=======
Use the LastLogon.vbs script, but skip the last step that loops through all
users and displays the results. That is, remove the following:
=======
' Output latest lastLogon date for each user.
For Each strUser In objList.Keys
Wscript.Echo strUser & " ; " & objList.Item(strUser)
Next
=======
You now have the dictionary object objList with the last logon date/time for
all users, specified by the user Distinguished Names. Then, add your code
that enumerates all users, but outputs only members of the specified group.
In Sub enumMembers in place of the following:

LastLogin = objMember.LastLogin

instead use the following to retrieve the last logon date/time for the user
with the given Distinguished Name:

LastLogin = objList.Item(objMember.distinguishedName)

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--


My System SpecsSystem Spec
Old 04-03-2009   #6 (permalink)
Oli M


 
 

Re: Export from AD to excel filter by group

Richard I have tried doing what you have said but am getting an error
Variable is undefined Objrange

Can you show me how you think the whole script should now look so I can see
where I can have gone wrong.

Many Thanks

"Richard Mueller [MVP]" wrote:
Quote:

>
> "Oli M" <OliM@xxxxxx> wrote in message
> news:BA6BAC90-069C-4B2B-B211-3006CD108F2A@xxxxxx
Quote:

> >I have looked into combining my script with your ADO last login version but
> > obviously the syntax is different. So I'm a bit stuck.
> >
> > Any ideas or pointers please?
> >
>
> The best solution is to retrieve the lastLogonTimeStamp attribute, if your
> domain is at Windows Server 2003 functional level. If your domain is not at
> this functional level, it is difficult to add lastLogon to your script. The
> best solution I can think of is as follows:
> =======
> Use the LastLogon.vbs script, but skip the last step that loops through all
> users and displays the results. That is, remove the following:
> =======
> ' Output latest lastLogon date for each user.
> For Each strUser In objList.Keys
> Wscript.Echo strUser & " ; " & objList.Item(strUser)
> Next
> =======
> You now have the dictionary object objList with the last logon date/time for
> all users, specified by the user Distinguished Names. Then, add your code
> that enumerates all users, but outputs only members of the specified group.
> In Sub enumMembers in place of the following:
>
> LastLogin = objMember.LastLogin
>
> instead use the following to retrieve the last logon date/time for the user
> with the given Distinguished Name:
>
> LastLogin = objList.Item(objMember.distinguishedName)
>
> --
> Richard Mueller
> MVP Directory Services
> Hilltop Lab - http://www.rlmueller.net
> --
>
>
>
My System SpecsSystem Spec
Old 04-03-2009   #7 (permalink)
Oli M


 
 

Re: Export from AD to excel filter by group

Richard

It didn't work if I amended your script, but I amended mine to include yours
and it is now working perfectly.

Many Many Thanks for all of your help

Regards

Oli

"Richard Mueller [MVP]" wrote:
Quote:

>
> "Oli M" <OliM@xxxxxx> wrote in message
> news:BA6BAC90-069C-4B2B-B211-3006CD108F2A@xxxxxx
Quote:

> >I have looked into combining my script with your ADO last login version but
> > obviously the syntax is different. So I'm a bit stuck.
> >
> > Any ideas or pointers please?
> >
>
> The best solution is to retrieve the lastLogonTimeStamp attribute, if your
> domain is at Windows Server 2003 functional level. If your domain is not at
> this functional level, it is difficult to add lastLogon to your script. The
> best solution I can think of is as follows:
> =======
> Use the LastLogon.vbs script, but skip the last step that loops through all
> users and displays the results. That is, remove the following:
> =======
> ' Output latest lastLogon date for each user.
> For Each strUser In objList.Keys
> Wscript.Echo strUser & " ; " & objList.Item(strUser)
> Next
> =======
> You now have the dictionary object objList with the last logon date/time for
> all users, specified by the user Distinguished Names. Then, add your code
> that enumerates all users, but outputs only members of the specified group.
> In Sub enumMembers in place of the following:
>
> LastLogin = objMember.LastLogin
>
> instead use the following to retrieve the last logon date/time for the user
> with the given Distinguished Name:
>
> LastLogin = objList.Item(objMember.distinguishedName)
>
> --
> Richard Mueller
> MVP Directory Services
> Hilltop Lab - http://www.rlmueller.net
> --
>
>
>
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
VB.NET: export query directly to Excel .NET General
VB :Export datagrid to excel .NET General
export grid to excel .NET General
Export to Excel truncates numbers .NET General
Export a report to Excel missing Page Header .NET General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46