myITforum and Windows IT Pro Forums

 VBscript to locate closest DP?

Author Message
finbom

  • Total Posts : 31
  • Scores: 0
  • Reward points : 6240
  • Joined: 1/15/2009
  • Status: offline
VBscript to locate closest DP? Wednesday, May 27, 2009 7:02 AM (permalink)
0
Hi!
 
Does anyone know how to locate closest distribution point from a VB-script?
I asume it can be done with a WMI-query or maybe so simple as somewhere in the registry, but I cant find anything myself.
 
Kind regards, Magnus Finbom
 
#1
    skissinger

    • Total Posts : 4972
    • Scores: 481
    • Reward points : 141420
    • Joined: 9/13/2001
    • Location: Sherry Kissinger
    • Status: offline
    RE: VBscript to locate closest DP? Wednesday, May 27, 2009 7:34 AM (permalink)
    0
    It's more complicated than that; for any particular package, the client checks what DPs have that package, and then based on boundaries checks if a DP is local or remote, and then uses the 'closest' DP it is allowed to use based on the advertisement. It's a lot of checks.... I don't think I'd want to try to figure that out myself with a vbscript.

    What's the end goal? Why do you need this information in a vbscript?
    mofmaster@myitforum.com
    My Blog
    Microsoft MVP - ConfigMgr
     
    #2
      jsandys

      • Total Posts : 1438
      • Scores: 131
      • Reward points : 71080
      • Joined: 3/24/2005
      • Location: San Antonio, TX
      • Status: offline
      RE: VBscript to locate closest DP? Wednesday, May 27, 2009 9:54 AM (permalink)
      0
      Here's a flowchart that describes this process: http://technet.microsoft.com/en-us/library/bb932150.aspx . As Sherry says, it's not a simple thing.
      Jason
      Configuration Manager MVP
      My Blog
      Twitter @JasonSandys
       
      #3
        finbom

        • Total Posts : 31
        • Scores: 0
        • Reward points : 6240
        • Joined: 1/15/2009
        • Status: offline
        RE: VBscript to locate closest DP? Monday, June 01, 2009 3:21 AM (permalink)
        0
        Hi!
         
        Thanks both of you. I assumed that the locate process would be rather advanced.
         
        For the curious ones... What I want to do is to call some packages from logon-scripts.. (for example. the antivoris application is installed distributed to all DP's, and we do use an SMS advertisement to install it, but We see that fail sometimes so we are building the startup skripts to verify/repair/install if missing)
        Currently DP's are hardcoded into the vb-script, but I hoped that some kind of query could locate the closest one.. Well, hope you get what I mean.
         
        Kinda regards, Magnus Finbom
         
        #4
          skissinger

          • Total Posts : 4972
          • Scores: 481
          • Reward points : 141420
          • Joined: 9/13/2001
          • Location: Sherry Kissinger
          • Status: offline
          RE: VBscript to locate closest DP? Tuesday, June 02, 2009 10:11 AM (permalink)
          0
          Sounds like over-engineering to me.
           
          If you feel you must do that via login script; why not just trigger a re-run of the SMS package instead?  Let SMS do the work.
           
          Or... upgrade to Configuration Manager, and then start leveraging DCM Baselines to find out-of-compliance boxes for antivirus, and use out of compliance collections to trigger remediation?
          mofmaster@myitforum.com
          My Blog
          Microsoft MVP - ConfigMgr
           
          #5
            finbom

            • Total Posts : 31
            • Scores: 0
            • Reward points : 6240
            • Joined: 1/15/2009
            • Status: offline
            RE: VBscript to locate closest DP? Wednesday, June 03, 2009 2:57 AM (permalink)
            0
            Yeah.. SCCM would be nice... when we deploy it in the future.. :) Our global organization has started a big project, but it will take long time until we get that tool..
             
            The enviroment I am administrating was designed like this when I came here. I have started to organize as much as I can. And this point could be another to take care of.
             
            off-topic...
            But Skissinger, you mentioned one thing there that got me curious.. How can I trigger a run/re-run of a package from a script?
            I have been looking for how to do that but found nothing. Doing that would solve many other issues we live with.
             
            Regards, Magnus Finbom
             
            #6
              skissinger

              • Total Posts : 4972
              • Scores: 481
              • Reward points : 141420
              • Joined: 9/13/2001
              • Location: Sherry Kissinger
              • Status: offline
              RE: VBscript to locate closest DP? Wednesday, June 03, 2009 7:27 AM (permalink)
              0
              Check this: http://www.myitforum.com/articles/8/view.asp?id=6841

              Assuming it's a machine-based target in the collection. Targetting users or usergroups that contain users it doesn't work (there's a way around it but it's not simple). Or you could get smssend.vbs (Cory Becht's right click tools, or Stuart Watret's right click tools, in %windir% after you install), and leverage smssend.vbs RERUNADVERTISEMENT <some paramaters but I think editing the .vbs is needed to pass in the advertid>
              <message edited by skissinger on Wednesday, June 03, 2009 7:28 AM>
              mofmaster@myitforum.com
              My Blog
              Microsoft MVP - ConfigMgr
               
              #7
                swyck

                • Total Posts : 319
                • Scores: 5
                • Reward points : 32780
                • Joined: 5/30/2008
                • Status: offline
                RE: VBscript to locate closest DP? Wednesday, June 03, 2009 7:51 AM (permalink)
                5
                Me, I find logon scripts useful but I'd rather do things like this through SMS adverts.  May be because I've never been the logon script guy. :)

                You can use SMS reports to find which clients have not installed the application correctly.  If they report a failed advertisement you can get that list and use it to create a collection and target that with a new advertisement.  Or you can look at inventory for add remove programs or files to see who does not have the correct data, and again use that as a target for a new advertisement.  For antivirus you may also be able to check the product console for data on non-compliant devices.

                A major consideration here is why they failed the original advertisement in the first place.  Re-running the advertisement may not do any good without some research on the client end.
                 
                #8
                  finbom

                  • Total Posts : 31
                  • Scores: 0
                  • Reward points : 6240
                  • Joined: 1/15/2009
                  • Status: offline
                  RE: VBscript to locate closest DP? Wednesday, June 03, 2009 2:41 PM (permalink)
                  0
                  Hi.
                   
                  Wow. lots of good help there! Thank's!
                  Well the runadvert-script will be very usefull. I am the kind of script-loving guy so I simply must write a scipt whenever possible... ;)
                  Regarding why I need to do this is simple.. Our organisation is global with about 80.000 clients. And the SMS collection updates are only run once every 24 hour.
                  And we have a policy that no clients are allowed on the network without an updated antivirus protection.. So we need to deploy the antivirus during os-install.. otherwise a client could be online too long with no protection.
                  So during a current upgrade of all antivirus software we use sms to deploy to existing clients and the startup script take care of new installed machines.
                  I know, there are several ways of doing this. But this is how the designers on my company done the configuration..
                   
                  Kind regards, Magnus Finbom
                   
                   
                   
                  #9
                    mad_v

                    • Total Posts : 10
                    • Scores: 0
                    • Reward points : 0
                    • Joined: 3/11/2009
                    • Status: offline
                    RE: VBscript to locate closest DP? Monday, June 08, 2009 7:03 AM (permalink)
                    0
                    Why don't you think about the protected DP.
                    MAD_V
                    A Group of Friends
                     
                    #10
                      finbom

                      • Total Posts : 31
                      • Scores: 0
                      • Reward points : 6240
                      • Joined: 1/15/2009
                      • Status: offline
                      RE: VBscript to locate closest DP? Monday, June 08, 2009 10:54 AM (permalink)
                      0

                      ORIGINAL: mad_v

                      Why don't you think about the protected DP.

                       
                      Sorry mad_v, what do you mean?
                       
                      regards, Magnus Finbom
                       
                      #11
                        mad_v

                        • Total Posts : 10
                        • Scores: 0
                        • Reward points : 0
                        • Joined: 3/11/2009
                        • Status: offline
                        RE: VBscript to locate closest DP? Tuesday, June 09, 2009 7:02 AM (permalink)
                        0
                        Protected DP is where you can decide which all subnet or site systems should access that DP for package download. 
                        MAD_V
                        A Group of Friends
                         
                        #12
                          Online Bookmarks Sharing: Share/Bookmark

                          Jump to:

                          Current active users

                          There are 0 members and 1 guests.

                          Icon Legend and Permission

                          • New Messages
                          • No New Messages
                          • Hot Topic w/ New Messages
                          • Hot Topic w/o New Messages
                          • Locked w/ New Messages
                          • Locked w/o New Messages
                          • Read Message
                          • Post New Thread
                          • Reply to message
                          • Post New Poll
                          • Submit Vote
                          • Post reward post
                          • Delete my own posts
                          • Delete my own threads
                          • Rate post

                          2000-2014 ASPPlayground.NET Forum Version 3.9