How to create a branch Distribution Point using de SDK
I have this script to create a Distribution Point. Anyone Knows what I have to add to create a Branch Distribution? Also I would like to make the BDP protected.
Any Idea?
Dim objSWbemLocator
Dim objSWbemServices
Dim ProviderLoc
Dim Location
Dim objSWbemContext
Dim SCI_SysResUseComponent
Dim SCI_SysResUseComponentSet
Dim sitecodeDim siteserver
Dim username
Dim password
Dim objNewShare
Dim lasterr
Dim NALPath
Dim clsNALMethods
sitecode="C00"
NomBranchDP="ServidorTest4"
'Connect to the Site SMS provider
Wscript.echo "Connect to the Site SMS provider"
Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objSWbemServices = objSWbemLocator.ConnectServer( , "root\sms\site_" & sitecode )
'Open the Site Control File
Wscript.echo "Open the Site Control File"
Set objSWbemContext = CreateObject("WbemScripting.SWbemNamedValueSet")
objSWbemContext.Add "SessionHandle",ObjSWbemServices.ExecMethod("SMS_SiteControlFile", "GetSessionHandle").SessionHandle
objSWbemServices.ExecMethod "SMS_SiteControlFile.Filetype=1,Sitecode=""" & sitecode & """", "Refresh", , , objSWbemContextWscript.echo "Creating New DP..."
Set clsNALMethods = objSWbemServices.Get("SMS_NAL_Methods")
clsNALMethods.PackNALPath Array("Display=\\"& NomBranchDP &""), "MSWNET", "\\"& NomBranchDP &"", Array("SMS_SITE=SITECODE"), NALPathSet objNewShare = objSWbemServices.Get("SMS_SCI_SysResUse").SpawnInstance_()
objNewShare.NetworkOSPath=Null
objNewShare.Props=Null
objNewShare.SiteCode=sitecodeobjNewShare.NALPath=NALPath
'objNewShare.NALType="Windows NT Share"
objNewShare.NALType="MSWNET"
objNewShare.RoleName="SMS Site System"objNewShare.Put_ , objSWbemContext
objNewShare.RoleName="SMS Distribution Point"
objNewShare.Put_ , objSWbemContextIf Err <> 0 Then
set lasterr = CreateObject("WbemScripting.SWbemLastError")
Wscript.echo "Error in: " & lasterr.Operation
End If
'Commit the changes and release control file
Wscript.echo "Commit the changes and release control file"
objSWbemServices.ExecMethod "SMS_SiteControlFile.Filetype=1,Sitecode=""" & sitecode & """", "Commit", , , objSWbemContext
objSWbemServices.Get("SMS_SiteControlFile").ReleaseSessionHandle objSWbemContext.Item("SessionHandle").Value
Wscript.echo "The End"
Answers
I've written a tool to do this in C#. Its written like a script.
You can download the tool and the source code for free from here-->http://codeplex.com/bdpadd
I haven't tested it extensively, but it worked for me in small test cases. Of course, use at your own risk.
Feel free to provide any comments, suggestions, or feedback. Also, since the source code is there you can make your own enhancments/modifications if you like.
Thanks,
David Delgado
All Replies
Hi Cristian,
We don't have anything in the Configuration Manager 2007 SDK beta. In general, we haven't written any updated site system installation scripts for the Configuration Manager SDK yet, but I may be able to look at this next week when I return from vacation. No promises for a quick fix though ... some of the new site systems are bit complex and I'm not sure how much work the SMS Provider does to set up the branch distribution point.
Hopefully, someone else is a little further along than I am. I'll watch the thread and do some quick investigation next week, if there's no update.
Thanks,
Jim Bradbury
Hi Cristian,
Sorry, I have NOT looked at this yet, as I'm still playing catch up after being out last week.
However, I was rereading this and it occurred to me that there are some properties that aren't in the site control file that define a Branch Distribution Point. Specifically, the IsPeerDP of the SMS_DistributionPoint class. For a Branch Distribution Point, the IsPeerDP property is set to true. The IsProtected property is also a member of the SMS_DistributionPoint class.
Anyway, I thought I'd pass this along, just in case it helps.
Thanks,
Jim
Here's a tip for others that might be reading the thread ... to create a list of existing Branch Distribution Points, it's probably easiest to list all the instances of the SMS_DistributionPoint class where the IsPeerDP property is set to true, instead of using the SMS_SCI_SysResUse class.
Jim or anyone else..
Could you please help me more?
Thank you
- Any news to this? Could be very useful for me too...have to create about 200 BDPs, it's really not techsexy installing it manually

I have much need for this as well. We just switched to SCCM from SMS. I have 950 bdps to install.
Thanks!
Hey Folks,
I will start looking at configuring site roles on Monday. I started setting up a new test environment yesterday, but didn't quite finish (and I'm out of the office today).
Assuming all goes well, I should be able to post something later next week.
[edit / update] It looks like this will drag on another week, I'm fighting some hardware problems this week.
Thanks for keeping the thread alive!
Jim Bradbury- Anything new recently? I'm interested in seeing this functionality in the SDK.
Hi,
I don't know about anyone else, but I'm working on a script ... or will, now that my nice clean site is setup with separate DC, member server and multiple clients (I swear I was jinxed last week ... couldn't get anything to work).
While this isn't my top priority, it is 'up there' and I hope to have something posted here late this week or early next week. If someone beats me to it, I'll happily by them a beer at TechEd (or around here, if they happen to be in town sometime).
I'm actually starting to work on site systems in general, but I'll start with a script for the branch distribution point, because everyone has been asking for it.
Anyway, just a quick update from me.
Jim Bradbury
- That part of the script should help you getting started: http://www.visualbasicscript.com/m_59460/mpage_1/key_/tm.htm#59460
I've written a tool to do this in C#. Its written like a script.
You can download the tool and the source code for free from here-->http://codeplex.com/bdpadd
I haven't tested it extensively, but it worked for me in small test cases. Of course, use at your own risk.
Feel free to provide any comments, suggestions, or feedback. Also, since the source code is there you can make your own enhancments/modifications if you like.
Thanks,
David Delgado
Hi David,
I have done any testing, but on a quick skim through the code, it looks like a nice solution!
A pretty good bit of work there !!!
Thanks for sharing your solution!
FYI: We're trying to establish a CodePlex site to post various solutions that we've come up with in house ... only 5-6 more hoops to jump through
Again, thanks for sharing.
Jim Bradbury
Thanks, Jim. The SDK and the SDK documentation help a lot. I hope it comes in handy for someone else or maybe someone else will enhance it.
Cool about CodePlex, can't wait to see what you guys post.
CodePlex is a cool site.
I just threw up another tool there for adding site boundaries. --> http://www.codeplex.com/sitebound
Thanks,
David Delgado
I've written a tool to do this in C#. Its written like a script.
You can download the tool and the source code for free from here--> http://codeplex.com/bdpadd
I haven't tested it extensively, but it worked for me in small test cases. Of course, use at your own risk.
Feel free to provide any comments, suggestions, or feedback. Also, since the source code is there you can make your own enhancments/modifications if you like.
Thanks,
David Delgado
Not sure what I'm not doing right, but I can't get this to work. I only have a Primary Site at this time, and guess I'm not sure what I'm suppose to use for the /s Central Site Server name
The error I get when I run it is:
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at BDPAdd.Program.Main(String[] args)
My command line is:
C:\Documents and Settings\dshaw\Desktop\BDPadd>bdpadd /s EAGLESMS1 /file C:\Documents and Settings\dshaw\Desktop\BDPadd\boundries.xls /log c:\
I know you don't 'support' this, but I was wondering if someone could help me out. I have about 80 BDPs to add, and doing them all by hand wouldn't be fun.
Thanks,
Danny
- Hi Danny,
A couple of things. You probably need to surrountd the path you are providing for the excel spreadsheet with quotes since it contains spaces and also you need to provide the name of the log file. So using your example the command line should be something like this:
bdpadd.exe /s EAGLESMS1 /file "C:\Documents and Settings\dshaw\Desktop\BDPadd\boundries.xls" /log c:\bdpadd.log
If you only have a primary site, then that is your central site. The central site is simply the primary site at the top of your hierarchy. So you need to specify the host name of that server with the /s parameter.
Thanks,
David - Hi
I tried this utility. It doesn't seem to accept a server name after /s with a dash eg. server01-bl23. Any work around?
thank you - Hi mate, having the following issue... Not sure if im missing something. But .Net 2.0 is on and I have tried running from a couple of different machines.
13/11/2009 11:06:13 AM [ERROR] - The Microsoft Jet database engine could not find the object 'List$'. Make sure the object exists and that you spell its name and the path name correctly.
Help is appreciated!
Cheers - Hi,
Yeah, I think the Regular Expression I used to parse out that parameter didn't allow for dashes. Oops!
Quickest workaround I could think of would be to try to create an alias without dashes for that server name, maybe in the hosts file of system you run the utility from.
I don't know if I'll ever get time to make any updates to the code. The source code is available though, if you know C#, you could make the change.
Thanks,
David - Hi Miksta,
A couple of things I can think of off the top of my head. The system you run the tool on has to have Office installed, when I wrote it I was using Office 2003. Also, the spreadsheet, must be in the format provided in the example. This includes column names and worksheet names.
Finally, I'm not sure if its appropriate to be having support issues for this tool discussed in this forum. If not, you can email me directly.
G'day,
David

