Login | |
|
 |
Re: ADSI Script to check Computer name and Domain - 3/10/2005 5:18:35 AM
|
|
 |
|
| |
aek
Posts: 29
Score: 0
Joined: 2/24/2005
From:
Status: offline
|
I am just following further on the DC_Name in the query: cmd.commandtext = "<LDAP://DC_Name/dc=subdomain,dc=mydomain,dc=com>;(&(objectcategory=computer)(objectclass=computer)(cn=" & host & "));cn;subtree" The need to find out which DC to contact is essential because I need to use it in the query. If I use the same DC_name to query machines in AD on all my sites, then the search will not be efficient. Eg. If before building a new machine, the person in Thailand needs to search in AD for the presence of the computername that he is building, will it not be be efficient if he searches on the Domain Controller AD box in Thailand, rather than searching the DC AD box based in NJ. This is rather silly, but I guess in my VB SCript for the Win PE environment, I can add select case options based on all the options that the user can chose during the build process. Case <If user choses domain=a.com> NameofDC = "DCinADomain" Case <If user choses domain=b.com> NameofDC = "DCinBDomain" ..So forth and then I can use the NameofDC string in my query: cmd.commandtext = "<LDAP://NameofDC/dc=subdomain,dc=mydomain,dc=com>;(&(objectcategory=computer)(objectclass=computer)(cn=" & host & "));cn;subtree" Any thoughts?
|
|
| |
|
|
|
 |
RE: Re: ADSI Script to check Computer name and Domain - 12/14/2005 12:05:55 AM
|
|
 |
|
| |
mbouchard
Posts: 1804
Score: 12
Joined: 5/15/2003
From: USA
Status: online
|
While I haven't done this so am not positive, have you enabled ADSI in PE? Also, post your script and I can try to test it on my PE disk. But please start a new thread, include your original question.
_____________________________
Mike For useful Scripting links see the Read Me First stickey! Always remember Search is your friend.
|
|
| |
|
|
|
|
|