I'm not sure about the Domains & Trusts tool but for the Active Directory Users & Computers GUI from M$, if you go to the View menu and select 'Filter Options...' there is a field at the bottom for max number of items to display per folder, the default is 2000.
btw, Steven's code did the trick in sorting me out and works great, returning well over 2000 objects. ................................ Kind regards Glenn Deans Sr. Systems Engineer Siemens IT Solutions and Services Bellefontaine, OH USA -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kathy Messina Sent: Thursday, February 22, 2007 3:06 PM To: perl-win32-admin@listserv.ActiveState.com Subject: RE: Perl-Win32-Admin Digest, Vol 6, Issue 2 Even the Windows Server 2003 Administration Tools - Active Directory Management tool from Microsoft (Active Directory Domains and Trusts) has that limit. We have over 3000 security groups and when I open that item it says it will only display the first 2000. So there may be an actual limit. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Thursday, February 22, 2007 3:00 PM To: perl-win32-admin@listserv.ActiveState.com Subject: Perl-Win32-Admin Digest, Vol 6, Issue 2 Send Perl-Win32-Admin mailing list submissions to perl-win32-admin@listserv.ActiveState.com To subscribe or unsubscribe via the World Wide Web, visit http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin or, via email, send a message with subject or body 'help' to [EMAIL PROTECTED] You can reach the person managing the list at [EMAIL PROTECTED] When replying, please edit your Subject line so it is more specific than "Re: Contents of Perl-Win32-Admin digest..." Today's Topics: 1. RE: Active Directory query limited to 2000 objects? (Steven Manross) 2. RE: Active Directory query limited to 2000 objects? (Deans, Glenn (SBS US)) ---------------------------------------------------------------------- Message: 1 Date: Wed, 21 Feb 2007 13:51:37 -0700 From: "Steven Manross" <[EMAIL PROTECTED]> Subject: RE: Active Directory query limited to 2000 objects? To: "Deans, Glenn \(SBS US\)" <[EMAIL PROTECTED]>, <perl-win32-admin@listserv.ActiveState.com> Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="us-ascii" Are your computers all in that base OU? Or are they nested? That's a longshot (because the odds of returning exactly 2000 records and this be the problem are somehwat astronomical).. But, it's worth a shot. However, if they are nested, try "subtree" instead of "OneLevel" in your search filter. The "Page Size" property is the correct value to be manipulating.. $objADOcmd->{Properties}->{"Page Size"} = 100; As well, try the: $objADOcmd->{Properties}->{"Sort On"} = "CN"; Just to see that the properties are correctly being set correctly (and read by the objects.. My guess is that this won't change the order of your resultsets based on my next comment). I haven't used your method of executing the connection before.. I do this (error checking omitted): my $string = "<$path>;$filter;$columns;subtree"; my $Com = Win32::OLE->new("ADODB.Command"); my $Conn = Win32::OLE->new("ADODB.Connection"); $Conn->{'Provider'} = "ADsDSOObject"; $Conn->{Open}; $Com->{ActiveConnection} = $Conn; $Com->{CommandText} = $string; #you don't do this.. And this leads up to the the next comment $Com->{Properties}->{"Page Size"} = 99; my $RS = $Com->Execute();#you actually are executing the connection object.. # Where I execute the Command object (which has the Page Size property set). #and may be the problem Cheers! Steven -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Deans, Glenn (SBS US) Sent: Monday, February 19, 2007 11:39 AM To: perl-win32-admin@listserv.ActiveState.com Subject: RE: Active Directory query limited to 2000 objects? Thanks Shawn. I thought it was a limit of 1000 as well, from what I saw @MSDN. But I'm still only getting 2000 objects with that line added in place of the 'Size Limit' line. Regards, Glenn -----Original Message----- From: Shawn Boyle [mailto:[EMAIL PROTECTED] Sent: Monday, February 19, 2007 1:11 PM To: Deans, Glenn (SBS US); perl-win32-admin@listserv.ActiveState.com Subject: RE: Active Directory query limited to 2000 objects? You need to specify a page size for your command object. If you don't you only get back the first set of objects [I thought it was the first 1000, but maybe that changed somewhere] and that's it. Add: $objADOcmd->Properties->{'Page Size'} = 1000; And you should be good. Though I'm not familiar with the Size Limit property so I don't know if that will cap the result set -- you might want to lose it. HTH, -Shawn -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Deans, Glenn (SBS US) Sent: Monday, February 19, 2007 10:36 AM To: perl-win32-admin@listserv.ActiveState.com Subject: Active Directory query limited to 2000 objects? Hi all! I'm running into a problem when I query our domain. I'm trying to enumerate a specific OU for the computers and I can only get 2000 objects back. I can't seem to find a property for this or a way to change the limit. The 'Size Limit' property in line 21 has no effect and I can't find a way to set 'MaxRecords', but I think the default for that is unlimited. It's not a show stopper for this script, but it will be in the future. Am I missing something? _______________________________________________ Perl-Win32-Admin mailing list Perl-Win32-Admin@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ------------------------------ Message: 2 Date: Wed, 21 Feb 2007 13:39:02 -0800 From: "Deans, Glenn \(SBS US\)" <[EMAIL PROTECTED]> Subject: RE: Active Directory query limited to 2000 objects? To: <perl-win32-admin@listserv.ActiveState.com> Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="us-ascii" Thanks Steven! That was it. I knew I had the whole routine mixed up but couldn't get it sorted out properly. I had actually tried querying the entire domain (over 10,000 PCs) and still only got 2000 back. Now I'm back on track and see where I got twisted up. I now get 5800+ PC's returned with the changes you recommended in this modified version that checks a portion of our domain. Thanks again. use strict; use Win32::OLE 'in'; use Win32::OLE::Const 'Active DS Type Library'; $Win32::OLE::Warn = 3; my $domain = "DC=us002,DC=siemens,DC=net"; my $ou = "OU=Cat-Computers,OU=CAT,".$domain; my ($result, $name, $ver, $cnt); my %targets = (); my $path = "LDAP://".$ou; my $filter = "(objectClass=Computer)"; my $columns = "Name,operatingSystem"; my $string = "<$path>;$filter;$columns;subtree"; my $Com = Win32::OLE->new("ADODB.Command"); my $Conn = Win32::OLE->new("ADODB.Connection"); $Conn->{'Provider'} = "ADsDSOObject"; $Conn->{Open}; $Com->{ActiveConnection} = $Conn; $Com->{CommandText} = $string; $Com->{Properties}->{"Page Size"} = 99; my $RS = $Com->Execute();#you actually are executing the connection object.. until ($RS->EOF){ $name = $RS->Fields(0)->{Value}; $ver = $RS->Fields(1)->{Value}; $targets{$name} = $ver; $cnt++; $RS->MoveNext; } $RS->Close; print "Found $cnt objects in $ou\n"; Regards, Glenn -----Original Message----- From: Steven Manross [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 21, 2007 3:52 PM To: Deans, Glenn (SBS US); perl-win32-admin@listserv.ActiveState.com Subject: RE: Active Directory query limited to 2000 objects? Are your computers all in that base OU? Or are they nested? That's a longshot (because the odds of returning exactly 2000 records and this be the problem are somehwat astronomical).. But, it's worth a shot. However, if they are nested, try "subtree" instead of "OneLevel" in your search filter. The "Page Size" property is the correct value to be manipulating.. $objADOcmd->{Properties}->{"Page Size"} = 100; As well, try the: $objADOcmd->{Properties}->{"Sort On"} = "CN"; Just to see that the properties are correctly being set correctly (and read by the objects.. My guess is that this won't change the order of your resultsets based on my next comment). I haven't used your method of executing the connection before.. I do this (error checking omitted): my $string = "<$path>;$filter;$columns;subtree"; my $Com = Win32::OLE->new("ADODB.Command"); my $Conn = Win32::OLE->new("ADODB.Connection"); $Conn->{'Provider'} = "ADsDSOObject"; $Conn->{Open}; $Com->{ActiveConnection} = $Conn; $Com->{CommandText} = $string; #you don't do this.. And this leads up to the the next comment $Com->{Properties}->{"Page Size"} = 99; my $RS = $Com->Execute();#you actually are executing the connection object.. # Where I execute the Command object (which has the Page Size property set). #and may be the problem Cheers! Steven -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Deans, Glenn (SBS US) Sent: Monday, February 19, 2007 11:39 AM To: perl-win32-admin@listserv.ActiveState.com Subject: RE: Active Directory query limited to 2000 objects? Thanks Shawn. I thought it was a limit of 1000 as well, from what I saw @MSDN. But I'm still only getting 2000 objects with that line added in place of the 'Size Limit' line. Regards, Glenn -----Original Message----- From: Shawn Boyle [mailto:[EMAIL PROTECTED] Sent: Monday, February 19, 2007 1:11 PM To: Deans, Glenn (SBS US); perl-win32-admin@listserv.ActiveState.com Subject: RE: Active Directory query limited to 2000 objects? You need to specify a page size for your command object. If you don't you only get back the first set of objects [I thought it was the first 1000, but maybe that changed somewhere] and that's it. Add: $objADOcmd->Properties->{'Page Size'} = 1000; And you should be good. Though I'm not familiar with the Size Limit property so I don't know if that will cap the result set -- you might want to lose it. HTH, -Shawn -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Deans, Glenn (SBS US) Sent: Monday, February 19, 2007 10:36 AM To: perl-win32-admin@listserv.ActiveState.com Subject: Active Directory query limited to 2000 objects? Hi all! I'm running into a problem when I query our domain. I'm trying to enumerate a specific OU for the computers and I can only get 2000 objects back. I can't seem to find a property for this or a way to change the limit. The 'Size Limit' property in line 21 has no effect and I can't find a way to set 'MaxRecords', but I think the default for that is unlimited. It's not a show stopper for this script, but it will be in the future. Am I missing something? _______________________________________________ Perl-Win32-Admin mailing list Perl-Win32-Admin@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ------------------------------ _______________________________________________ Perl-Win32-Admin mailing list Perl-Win32-Admin@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs End of Perl-Win32-Admin Digest, Vol 6, Issue 2 ********************************************** _______________________________________________ Perl-Win32-Admin mailing list Perl-Win32-Admin@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs _______________________________________________ Perl-Win32-Admin mailing list Perl-Win32-Admin@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs