Page 2 of 2 <12
Topic Options
#190825 - 2008-12-04 08:39 AM Re: Glenn help! You the man! [Re: Gargoyle]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
The way I posted it doesn't need to be changed
Except for the OU strings.
 Code:
$Branch1 = fnLDAPQuery('Name','LDAP://ou=Computer,ou=4th,dc=microsoft,dc=fabrikon,dc=com','(&(objectClass=Computer)(Name=*))')
$Branch2 = fnLDAPQuery('Name','LDAP://ou=Computer,ou=8th,dc=microsoft,dc=fabrikon,dc=com','(&(objectClass=Computer)(Name=*))')
$Branch3 = fnLDAPQuery('Name','LDAP://ou=Computer,ou=plov,dc=microsoft,dc=fabrikon,dc=com','(&(objectClass=Computer)(Name=*))')
$Branch4 = fnLDAPQuery('Name','LDAP://ou=Computer,ou=Stevens,dc=microsoft,dc=fabrikon,dc=com','(&(objectClass=Computer)(Name=*))')

'Name' is the name of the computer. (Don't change this to srv-01, it wont work, leave it as 'Name')
'LDAP://" is the OU string where to get the computers from
'(&(objectClass=Computer)(Name=*))' is the filter to apply, so the array won't contain OU names or any other objects except computers.

So only change the OU string to match that of your AD and it will work as I posted in my last post.

Top
#190845 - 2008-12-04 04:43 PM Re: Glenn help! You the man! [Re: Arend_]
itdaddy Offline
Starting to like KiXtart

Registered: 2006-12-19
Posts: 145
Loc: Wisconsin
apronk

this is exactly what I have expect for the fake FQDN I have fake here.
but yeah, This is what I have. no errors but no display??
I am sure it is something to do with this? sorry for the hassle
but I know I am almost there it must be something small. can you see it??
thanks.........in place of dc=microsoft should i have dc=srv-dc1 ??name
of domain controller and not microsoft?
robert

 Code:
Dim $Branch1, $Branch2, $Branch3, $Branch4
;fnLDAPQuery(WHAT, Optional FROM, Optional FILTER, Optional ORDER BY, Optional SCOPE, Optional USER, Optional PASSWORD)
$Branch1 = fnLDAPQuery('Name','LDAP://ou=Computers,ou=ForthAve,ou=funnycu,dc=microsoft,dc=funnycu,dc=priv','(&(objectClass=Computers)(Name=*))')
$Branch2 = fnLDAPQuery('Name','LDAP://ou=Computers,ou=EighthSt,ou=funnycu,dc=microsoft,dc=funnycu,dc=priv','(&(objectClass=Computers)(Name=*))')
$Branch3 = fnLDAPQuery('Name','LDAP://ou=Computers,ou=PostRd,ou=funnycu,dc=microsoft,dc=funnycu,dc=priv','(&(objectClass=Computers)(Name=*))')
$Branch4 = fnLDAPQuery('Name','LDAP://ou=Computers,ou=ParkDr,ou=funnycu,dc=microsoft,dc=funnycu,dc=priv','(&(objectClass=Computers)(Name=*))')
 


Edited by itdaddy (2008-12-04 04:54 PM)
_________________________
Robert
A+, CCNA, MCP
Network Admin
Credit Union Wisconsin

Top
#190847 - 2008-12-04 04:58 PM Re: Glenn help! You the man! [Re: itdaddy]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
itdaddy, this is correct. Only change the LDAP string to what it really is. I've tested this on 3 domains now and it works fine.
Top
#190848 - 2008-12-04 05:04 PM Re: Glenn help! You the man! [Re: Arend_]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
For instance mine is like 'LDAP://OU=Laptops,OU=Computers,DC=gnr,DC=local'
Top
#190850 - 2008-12-04 05:19 PM Re: Glenn help! You the man! [Re: Gargoyle]
itdaddy Offline
Starting to like KiXtart

Registered: 2006-12-19
Posts: 145
Loc: Wisconsin
Gargoyle
I think i have the LDAP statement wrong or wrong order
our hierarchy is as follows
srv-dc1.funnycu.priv
funnycu.priv (root)
funnycu (ou)
ForthAve (ou)
Computers (ou)
------------------------------------
this is one branch so if I can get one going I am sure I can get the rest going. I am not sure what order to put it in on the LDAP query line?
All the repecitve pcnames are in each OU called computers under each branch name ie ForthAve so how exactly would you put the statement>?
and do I put the actuall DC name in dc=srv-dc1 vs the name dc=microsoft?
almost there.
robert
_________________________
Robert
A+, CCNA, MCP
Network Admin
Credit Union Wisconsin

Top
#190851 - 2008-12-04 05:21 PM Re: Glenn help! You the man! [Re: Arend_]
itdaddy Offline
Starting to like KiXtart

Registered: 2006-12-19
Posts: 145
Loc: Wisconsin
going to try right now..will post it when it works
_________________________
Robert
A+, CCNA, MCP
Network Admin
Credit Union Wisconsin

Top
#190852 - 2008-12-04 05:23 PM Re: Glenn help! You the man! [Re: itdaddy]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
Try this 'GC://OU=Computers,OU=ForthAve,OU=FunnyCU,DC=FunnyCU,DC=priv'

No server names are neccesary.
Basically you only have to remove the "DC=Microsoft" part.


Edited by apronk (2008-12-04 05:25 PM)
Edit Reason: added explanantion

Top
#190857 - 2008-12-04 05:41 PM Re: Glenn help! You the man! [Re: Arend_]
itdaddy Offline
Starting to like KiXtart

Registered: 2006-12-19
Posts: 145
Loc: Wisconsin
apronk
it must be my LDAP path
okay scenario I am on srv-dc1 (actaul name) it is a DC. I am logged in as Domain ADmin. AD hierarchy for one branch is this
funnycu.priv
funnycu (ou)
ForthAve (ou)
Computers (ou)
-------------------------------
Let us do one line at a time and I bet the other lines the same.
--------------------------------------------------------------

 Code:
 Dim $Branch1, $Branch2, $Branch3, $Branch4
;fnLDAPQuery(WHAT, Optional FROM, Optional FILTER, Optional ORDER BY, Optional SCOPE, Optional USER, Optional PASSWORD)
$Branch1 = fnLDAPQuery('Name','LDAP://ou=Computers,ou=ForthAve,dc=srv-dc1,dc=local','(&(objectClass=Computer)(Name=*))')


do I have the names exact for what they are like the filter "Computer" or ou name Computers?
Name I leave alone right as name.
where the computers are stored for ForthAve are in the last OU called Computers each branch office has a name ie ForthAve and then another OU called Computers where their respective computers are store the names of each PC in that branch office. that is it..so can you write the correct synatax of one branch LDAP and so I can see you have the scenario I just gave you to better help you see what I have and I have given you actaul names..we are almost there. it doenst come up i know my LDAP path is wrong.
_________________________
Robert
A+, CCNA, MCP
Network Admin
Credit Union Wisconsin

Top
#190858 - 2008-12-04 06:02 PM Re: Glenn help! You the man! [Re: itdaddy]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
It should be this
 Code:
$Branch1 = fnLDAPQuery('Name','LDAP://OU=Computers,OU=ForthAve,OU=FunnyCU,DC=FunnyCU,DC=priv','(&(objectClass=Computer)(Name=*))')

Top
#190860 - 2008-12-04 06:18 PM Re: Glenn help! You the man! [Re: Arend_]
itdaddy Offline
Starting to like KiXtart

Registered: 2006-12-19
Posts: 145
Loc: Wisconsin
 Code:
 $Branch1 = fnLDAPQuery('Name','GC://OU=Computers,OU=ForthAve,OU=funnycu,dc=funnycu,dc=priv','(&(objectClass=Computer)(Name=*))')


apronk
dude you are pure genius! it worked like a charm man ! this is the
this the exact line that pulled those bad boys right up
wow I wish i was a smart as you. i am getting ther ewow!
thanks so much! it works now woowowoowoowow
robert
_________________________
Robert
A+, CCNA, MCP
Network Admin
Credit Union Wisconsin

Top
#190861 - 2008-12-04 06:24 PM Re: Glenn help! You the man! [Re: itdaddy]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
We all had to start somewhere, you'll get there soon enough \:\)
Glad it works now \:\)

Top
#190862 - 2008-12-04 06:53 PM Re: Glenn help! You the man! [Re: Arend_]
itdaddy Offline
Starting to like KiXtart

Registered: 2006-12-19
Posts: 145
Loc: Wisconsin
apronk!
thanks ;\) okay boy genius!
say I have some PCs I dont want their names included in the array list?
how can I exclude/filter out cert names? is that possible?
and hey love your avatar but what does apronk mean? can i ask?
_________________________
Robert
A+, CCNA, MCP
Network Admin
Credit Union Wisconsin

Top
#190863 - 2008-12-04 08:29 PM Re: Glenn help! You the man! [Re: itdaddy]
itdaddy Offline
Starting to like KiXtart

Registered: 2006-12-19
Posts: 145
Loc: Wisconsin
i guess i can make a new array but just thought i could filter them out
as they fill the array when pulled...i can figure maybe thatmuch
thanks so much just to get this working this is so key to not havingto udate any pc list i have made wow this is fantastic.
robert
I appreciate all you help thanks guys! ;\)
_________________________
Robert
A+, CCNA, MCP
Network Admin
Credit Union Wisconsin

Top
#190867 - 2008-12-05 12:24 AM Re: Glenn help! You the man! [Re: itdaddy]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
Just about anything is possible - How much work it might take is another issue.

For the computers that you do not want to include, is there a commonality among them that is not common to the others? Is it a static list?

Basically how are you going to define what to not look at.

Then you can adjust your code as such

 Code:
For each $Computername in $Batch
  If AScan($Skip,$ComputerName) = -1
   ?$ComputerName
  EndIf
Next


Where $Skip would equal a list of computers that you do not want to run against.

 Code:
$Skip = "Server01","PrintServer01","FileServer01"


Edited by Gargoyle (2008-12-05 01:31 AM)
Edit Reason: had the wrong function in there
_________________________
Today is the tomorrow you worried about yesterday.

Top
#190869 - 2008-12-05 01:16 AM Re: Glenn help! You the man! [Re: itdaddy]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
A simple way to filter your data is to enumerate your array. As you read each value, check it for certain attributes using one or more IF statements. Test for exceptions, not inclusions. If any IF is true, set the value to a null string. Now your array only contains the values you want, mixed with blank values.

As you enumerate your array to process the data, you can simply enclose your logic in a simple IF test to verify the data is not blank.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#190876 - 2008-12-05 04:15 PM Re: Glenn help! You the man! [Re: Glenn Barnas]
itdaddy Offline
Starting to like KiXtart

Registered: 2006-12-19
Posts: 145
Loc: Wisconsin
THANKs

GARGOYLE

and Thank GLenn sound goood ;\)
_________________________
Robert
A+, CCNA, MCP
Network Admin
Credit Union Wisconsin

Top
#190880 - 2008-12-06 01:42 AM Re: Glenn help! You the man! [Re: itdaddy]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Might want to take a look at using this cool little KiXforms app that Chris wrote to make copying those paths easy.

KiXforms - Active Directory Browser Version 2

Top
#190883 - 2008-12-06 04:28 PM Re: Glenn help! You the man! [Re: NTDOC]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
To answer your "other" question, "apronk" is an abbrevation of my full name, which is Arend Pronk, Arend was already taken \:\)
Top
Page 2 of 2 <12


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 611 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.071 seconds in which 0.025 seconds were spent on a total of 14 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org