Site management tool for ADAM?
 




IT Certification FAQ

 
|
Home
|
Microsoft
|
CISCO
|
CompTIA
|
Exam/Study FAQ
|
Employment FAQ
| Links  | Forums  |
Book Reviews


FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  RegisterRegister  ProfileProfile  Log in to check your private messagesPrivate messages  Log inLog in

Site management tool for ADAM?

 
Post new topic   Reply to topic    Forum Index -> microsoft.public.windows.server.active_directory
Author Message
compurhythms@gmail.com
Guest





PostPosted: Mon May 15, 2006 8:33 pm    Post subject: Site management tool for ADAM? Reply with quote

Are there any tools out there (free or commercial) for managing sites
in ADAM? Specifically I mean creating the site and server objects in
the configuration schema and getting all the NTDS settings correct.
This seems to be a huge hole in the current ADAM toolset.

If there are no tools to do this, are there any good places to go on
what attributes need to be set when creating site, subnet, server, and
site-link objects manually? I can set a lot of the obvious ones
through ADAM ADSI-Edit (schedule, subnet name, site-link members, etc),
but I'm worried that I'll miss something important.

Mike
Back to top
Lee Flight
Guest





PostPosted: Tue May 16, 2006 2:10 am    Post subject: Re: Site management tool for ADAM? Reply with quote

Hi

yes site management in ADAM is difficult. There have been hints
that this might improve in the longhorn timeframe...I don't
know of any other tools.

There's quite a bit of information on sites in the ADAM Help
file. Building a set of ldf files is probably the way to go, the
ldf examples in the O'Reilly AD Cookbook would be a good
starting point, see Chapter 11:

http://www.rallenhome.com/books/adcookbook/code.html

however for ADAM some settings e.g. replInterval on siteLink
objects do not appear to be documented but have the behavior
you would expect in the testing I have done.

If you have problems post back.

Lee Flight

<compurhythms@gmail.com> wrote in message
news:1147710797.036660.230370@y43g2000cwc.googlegroups.com...
Quote:
Are there any tools out there (free or commercial) for managing sites
in ADAM? Specifically I mean creating the site and server objects in
the configuration schema and getting all the NTDS settings correct.
This seems to be a huge hole in the current ADAM toolset.

If there are no tools to do this, are there any good places to go on
what attributes need to be set when creating site, subnet, server, and
site-link objects manually? I can set a lot of the obvious ones
through ADAM ADSI-Edit (schedule, subnet name, site-link members, etc),
but I'm worried that I'll miss something important.

Mike
Back to top
Paul Williams [MVP]
Guest





PostPosted: Tue May 16, 2006 10:27 am    Post subject: Re: Site management tool for ADAM? Reply with quote

The following script works for both AD and ADAM (as I test all my code in
ADAM these days). You'll have to modify the bind strings, but the rest is
fine. For specifics, see the cookbook, as mentioned by Lee.

Be careful of the line wrap and look at the input CSV syntax carefully.
This is building a hub-and-spoke topology, which is why there's the need for
a so called central site.

' ***************************************************************
' createSitesSubnetsAndSiteLinks.vbs *
' *
' Written by Paul Williams, msresource.net, December 2005. *
' *
' *
' Script reads bulk information from a CSV file and creates the *
' site, subnet and siteLink objects in the default active *
' directory. *
' *
' CSV file is formatted as Site Name,Subnet,Site Link Name, *
' Central site, where subnet looks like 192.168.0.0/24 and *
' central site is the name of the central site that the new *
' site is connected to via the new site link. For example, *
' we have sites A and B and are creating C. A would be passed *
' as the central site for the relationship AC. *
' *
' Author: Paul Williams *
' Written: 11-12-2005 *
' Version: 1.1.2. *
' Last updated: 07-05-2006 *
' Last updated by: Paul Williams *
' *
' *
' Changes: *
' *
' 1.1.1 : Original script. *
' 1.1.2 : Improved logging and added more comments *
' *
' *
' Input: *
' *
' The following is an example of how the input file, called *
' createSitesSubnetsAndSiteLinks__IN.csv by default, should *
' look. Note there is no heading line. *
' *
' Cardiff,192.168.45.0/24,CDF-LON,London *
' Edinburgh,192.168.46.0/24,EDN-LON,London *
' Belfast,192.168.47.0/24,BLF-LLON,London *
' Paris,192.168.48.0/24,PRS-LON,London *
' Swansea,192.168.49.0/24,SWN-CDF,Cardiff *
' *
' ***************************************************************
Option explicit


' bTestFlag is a boolean flag used for development
' and troubleshooting. When the value is true,
' verbose echo's are enabled and logging is enabled;
' when the value is false, verbose echo's and
' logging are disabled. This should only be TRUE
' when debugging (or initially writing) this script.
Const bDebugFlag = True

' Taken from ADS_PROPERTY_OPERATION_ENUM:
' http://msdn.microsoft.com/library/default.asp?url=/library/en-
' us/adsi/adsi/ads_property_operation_enum.asp
Const ADS_PROPERTY_UPDATE = 2


' SiteLink object constanst
Const SITE_LINK_COST = 100
Const SITE_LINK_REPL_INT = 180

' File System object constants (open type
' and file names
Const FOR_READING = 1
Const FILE_NAME = "createSitesSubnetsAndSiteLinks__IN.csv"
Const LOG_FILE_NAME = "createSitesSubnetsAndSiteLinksLOG.txt"

' read info. from file
Dim oFso, oFileIn, logf

Set oFso=createObject("Scripting.FileSystemObject")
Set logf=oFso.createTextFile(LOG_FILE_NAME,True)
Set oFileIn=oFso.openTextFile(FILE_NAME,FOR_READING)

' file doesn't exist. Echo error and quit
If(err.number <> 0)Then
err.clear
echo"File does not exist."
wscript.quit(-1)
End If

' read contents of file into memory

' init variants
Dim str, arr(), j

j = 0

' iterate file and read each line into array
Do While oFileIn.atEndOfLine <> True
reDim preserve arr(j)
str=oFileIn.readLine
arr(j)=str
j=j+1
Loop

' creates sites based on info. read

' init variants
Dim a,i
Dim sSiteName, sSubnet, sSiteLink, sCentralSite

i = 0

' iterate array and split each record (line)
' into a temporary array and assign values to
' variants to pass to sub createSiteObjects(...)
For Each i In arr
a = Split(i,",")

sSiteName = a(0)
sSubnet = a(1)
sSiteLink = a(2)
sCentralSite = a(3)

createSiteObjects sSiteName, sSubnet, _
sSiteLink, sCentralSite
Next

debug"Finished adding sites. Terminating script."
wscript.echo"Script complete."



' ***********************************************
' createSiteObjects(sSiteName, sSubnet, _
' sSiteLink, sCentralSite)
'
' Sub routine creates a new site object, a new
' subnet object and a new site link object. The
' site and subnet are then associated and then
' the new site is added to the new site link.
'
' ***********************************************
Private Sub createSiteObjects(sSiteName, sSubnet, _
sSiteLink, sCentralSite)

Dim oRootDse,oBase,oSite,oSubnet,oSiteLink

' get local configuration NC
' Set oRootDse = GetObject("LDAP://RootDSE")
' Set oBase = GetObject("LDAP://CN=sites," & _
' oRootDse.get("configurationNamingContext"))

' ############################################################
'
' DEVELOPMENT CODE ONLY. REMOVE WHEN COMPLETE.
'
' OVERRIDES DEFAULT DOMAIN AND USES LOCAL ADAM INSTANCE.
'
' ############################################################
Set oBase=GetObject("LDAP://localhost:389/CN=Sites,CN=Configuration," & _
"CN={F24F59EF-26BF-4AD5-B44B-0B82901A1DD6}")
' ############################################################

' get the dn for the sites container
sSiteContainer = oBase.get("distinguishedName")

' create the site object
debug"Creating site ""CN=" & sSiteName & "," & sSiteContainer & """"
Set oSite = oBase.create("site","cn=" & sSiteName)
oSite.setInfo

' create the site's mandatory child objects
Dim oLicensing,oNtdsSiteSettings,oServers

' licensing settings object
debug"Creating licensingSiteSettings ""CN=Licencing Site Settings," &
sSiteContainer & """"
Set oLicensing = oSite.create("licensingSiteSettings", _
"cn=Licencing Site Settings")
oLicensing.setInfo

' ntds site settings object
debug"Creating nTDSSiteSettings ""CN=NTDS Site Settings," & sSiteContainer
& """"
Set oNtdsSiteSettings = oSite.create("nTDSSiteSettings", _
"cn=NTDS Site Settings")
oNtdsSiteSettings.setInfo

' servers container
debug"Creating serversContainer ""CN=Servers," & sSiteContainer & """"
Set oServers = oSite.create("serversContainer", "cn=Servers")
oServers.setInfo

' write debug/ logging info
debug"Site """ & sSiteName & """ created successfully."

' get subnet DN as a string
Dim sSite,sSiteContainer
sSite = oSite.get("distinguishedName")
debug"Creating subnet..."""&sSubnet&""" (associating with site
"""&sSite&")"""

' set new base for subnet objects
' Set oBase = GetObject("LDAP://cn=subnets,cn=sites," & _
' oRootDse.get("configurationNamingContext"))

' ############################################################
'
' DEVELOPMENT CODE ONLY. REMOVE WHEN COMPLETE.
'
' OVERRIDES DEFAULT DOMAIN AND USES LOCAL ADAM INSTANCE.
'
' ############################################################
Set oBase=GetObject("LDAP://localhost:389/CN=Subnets,CN=Sites," & _
"CN=Configuration,CN={F24F59EF-26BF-4AD5-B44B-0B82901A1DD6}")
' ############################################################

' create subnet object
Set oSubnet = oBase.create("subnet", "cn=" & sSubnet)
oSubnet.put"siteObject", sSite
oSubnet.setInfo

debug"Subnet """ & sSubnet & """ created successfully."

' create new site link and add new site and central
' site to this new link

' define new base
' Set oBase = GetObject("LDAP://cn=IP,cn=inter-site transports," & _
' "cn=sites," & oRootDse.get("configurationNamingContext"))

' ############################################################
'
' DEVELOPMENT CODE ONLY. REMOVE WHEN COMPLETE.
'
' OVERRIDES DEFAULT DOMAIN AND USES LOCAL ADAM INSTANCE.
'
' ############################################################
Set oBase=GetObject("LDAP://localhost:389/CN=IP,CN=Inter-site Transports,"
& _
"CN=Sites,CN=Configuration,CN={F24F59EF-26BF-4AD5-B44B-0B82901A1DD6}")
' ############################################################

' create site link
Set oSiteLink = oBase.create("siteLink", "cn=" & sSiteLink)
debug"Creating site-link """ & sSiteLink & """ as CN=" & sSiteLink & _
"," & oBase.get("distinguishedName")

' set "members"
sCentralSite = "CN=" & sCentralSite & "," & sSiteContainer
oSiteLink.putEx ADS_PROPERTY_UPDATE, "siteList", _
Array(sSite,sCentralSite)
debug"Adding """ & sSite & """ and """ & sCentralSite & """ as members"

' set cost
oSiteLink.put"cost", SITE_LINK_COST

' set replication interval
oSiteLink.put"replInterval", SITE_LINK_REPL_INT
oSiteLink.setInfo

' write debugging/ logging information
debug"Site """ & sSiteLink & """ created successfully."
debug"Sites: """ & sSite & " and """ & sCentralSite & _
" added to link."
debug"Initial cost of " & SITE_LINK_COST & " defined."
debug"Initial cost of " & SITE_LINK_REPL_INT & " defined."
End Sub



' ***********************************************
' debug(string messageToEcho)
'
' Sub echos the passed string.
'
' Sub used for outputting all debugging
' information to the screen/ console.
'
' bDebugFlag is a constant. Set to true for
' debugging info. Set to false when in
' production.
'
' ***********************************************
Private Sub debug(sMessage)
if(bDebugFlag)then
wscript.echo sMessage
logf.writeLine(date&vbTab&time&vbTab&sMessage)
end if
End Sub


--
Paul Williams
Microsoft MVP - Windows Server - Directory Services
http://www.msresource.net | http://forums.msresource.net
Back to top
compurhythms@gmail.com
Guest





PostPosted: Thu May 18, 2006 8:13 pm    Post subject: Re: Site management tool for ADAM? Reply with quote

Thanks. This information helps. It basically reflects the same
objects and attributes I was going to configure. Here's the hard part
though, is there any information out there are on the format of the
"schedule" attribute for an NTDS object and how to modify it
programatically?

Mike
Back to top
Lee Flight
Guest





PostPosted: Fri May 19, 2006 4:43 am    Post subject: Re: Site management tool for ADAM? Reply with quote

Hi

the schedule attribute is

http://msdn.microsoft.com/library/en-us/ad/ad/schedule.asp

I do not know of any code examples. IIRC there is a schedule class in
..Net2.0 S.DS.ActiveDirectory., try asking over on adsi.general NG.

I generally use ldf for this kind of thing, if you use the UI in ADSIEdit
to create the schedules you want you can then export them using
ldifde and use those as templates to apply to the siteLink objects you
create.

Lee Flight

<compurhythms@gmail.com> wrote in message
news:1147968788.446655.219240@j73g2000cwa.googlegroups.com...
Quote:
Thanks. This information helps. It basically reflects the same
objects and attributes I was going to configure. Here's the hard part
though, is there any information out there are on the format of the
"schedule" attribute for an NTDS object and how to modify it
programatically?

Mike
Back to top
compurhythms@gmail.com
Guest





PostPosted: Fri May 19, 2006 5:08 am    Post subject: Re: Site management tool for ADAM? Reply with quote

Sweet. Thanks for the DS.AD pointer. Here's just what I need:

http://msdn2.microsoft.com/en-us/system.directoryservices.activedirectory.activedirectoryschedule.aspx

I know LDF files will do the trick, but I'm trying to create a tool
that our field service people can use to configure sites and subnets.
If I don't do that I'll be on the hook for creating LDF files for every
customer and I've got other fish to fry.

Thanks for everyone's responses, they've been a big help.

Mike
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> microsoft.public.windows.server.active_directory All times are GMT
Page 1 of 1

 

Copyright © 2002-2006 Web-S-Sense Pty. Ltd. All rights reserved.

Powered by phpBB
Advertising | Policies/Disclaimers | Contact us | Link to us


Featured Sites: Free Antivirus and Antispyware Info | Free PC Support | MCSE Directory