![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | 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 Specs![]() |
| | #2 (permalink) |
| | 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 Specs![]() |
| | #3 (permalink) |
| | 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 Specs![]() |
| | #4 (permalink) |
| | 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 Specs![]() |
| | #5 (permalink) |
| | 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? > 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 Specs![]() |
| | #6 (permalink) |
| | 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 Specs![]() |
| | #7 (permalink) |
| | 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 Specs![]() |
![]() |
| 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 | |||