Ask a questionAsk a question
 

AnswerHow to create a branch Distribution Point using de SDK

  • Tuesday, November 20, 2007 3:16 PMCristian Vidal Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    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 sitecode

     

    Dim 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", , , objSWbemContext

    Wscript.echo "Creating New DP..."
    Set clsNALMethods = objSWbemServices.Get("SMS_NAL_Methods")
    clsNALMethods.PackNALPath Array("Display=\\"& NomBranchDP &""), "MSWNET", "\\"& NomBranchDP &"", Array("SMS_SITE=SITECODE"), NALPath

    Set objNewShare = objSWbemServices.Get("SMS_SCI_SysResUse").SpawnInstance_()


    objNewShare.NetworkOSPath=Null
    objNewShare.Props=Null
    objNewShare.SiteCode=sitecode

    objNewShare.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_ , objSWbemContext

    If 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

  • Friday, June 06, 2008 6:00 PMDouble D Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    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

  • Wednesday, November 21, 2007 2:09 AMJim Bradbury [MSFT]MSFTUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    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

  • Tuesday, November 27, 2007 5:03 AMJim Bradbury [MSFT]MSFTUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    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.

  • Monday, December 10, 2007 2:20 PMCristian Vidal Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Jim or anyone else..

     

    Could you please help me more?

     

    Thank you

     

  • Monday, March 17, 2008 10:31 PMStefan Ringler Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    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 Wink
  • Friday, March 21, 2008 12:25 PMMarcusM Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

     

    I have much need for this as well.  We just switched to SCCM from SMS.  I have 950 bdps to install.

     

    Thanks!

  • Friday, March 21, 2008 3:20 PMJim Bradbury [MSFT]MSFTUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    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
  • Wednesday, April 02, 2008 12:04 AMpcgeek86 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Anything new recently? I'm interested in seeing this functionality in the SDK.
  • Wednesday, April 02, 2008 1:19 AMJim Bradbury [MSFT]MSFTUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    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

  • Monday, May 05, 2008 12:48 PMTorsten [MVP]MVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    That part of the script should help you getting started: http://www.visualbasicscript.com/m_59460/mpage_1/key_/tm.htm#59460

     

  • Friday, June 06, 2008 6:00 PMDouble D Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    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

     

  • Friday, June 06, 2008 7:11 PMJim Bradbury [MSFT]MSFTUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    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

  • Friday, June 06, 2008 7:41 PMDouble D Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    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

  • Wednesday, July 08, 2009 6:25 PMdshaw66 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    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

  • Thursday, August 13, 2009 5:29 AMD D Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    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
  • Wednesday, October 21, 2009 5:42 PMVisible name 23 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    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
  • Friday, November 13, 2009 12:08 AMMiksta_AU Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    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
  • Friday, November 20, 2009 6:08 AMD D Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    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
  • Friday, November 20, 2009 6:12 AMD D Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    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