mbt masai
 
Welcome !
         

                                
After experiencing a lot of down time, We decided to move this site to CrystalTech.com. CrystalTech.com is powered by only the finest Windows servers providing the best performance, reliability, and value anywhere.

 Netlogon.vbs

Author Message
erratum

  • Total Posts : 33
  • Scores: 0
  • Reward points : 0
  • Joined: 2/23/2010
  • Status: offline
Netlogon.vbs Monday, September 06, 2010 12:55 AM (permalink)
0
Hey Folks,

Got a little Problem in here.
The Point is, that I'm optimising our netlogon.cmd. I wanted to displace the old slow ifmember function with a fast vbs-script.
Everything works great so far, but:

I don't realy get the point, how to do the groupsearch recursivly (hope, this is the right word).

But let's see what I've got so far:

Getting the Membership and running the mapping function:
 Set Nutzer = GetObject("LDAP://" & CreateObject("ADSystemInfo").Username)
 arrMemberOf = Nutzer.GetEx("memberof")
 laufwerke_mappen(arrMemberOf)


The mapping function:
 function laufwerke_mappen(arrmemberof)
     
     On error resume next
     For Each Group in arrMemberOf
         Select Case Mid(Group,4,Instr(Group,",")-4)
             case [membership]
                 [map]
          end select
     On error goto 0
 end function
 


I've tried a little bit arround with:
    case else
        subgroups = GetObject("LDAP://" & group).GetEx("memberof")
        if not(err.number = E_ADS_PROPERTY_NOT_FOUND) then
             laufwerke_mappen(subgroups)
        end if
 

(the E_ADS_PROPERTY_NOT_FOUND variable contains the err.number of a not set property)

But everytime I'm trying to read the "memberof" Attribute of a Group I get "Property not set" (even if the Property is set).
Do I have the right approach or am i going totally wrong? Anyone who can tell me why this error appears?

wbr Erratum


p.s.: I would appreciate it if someone of the "native english speakers" could assess my english :p
#1
    ginolard

    • Total Posts : 1347
    • Scores: 23
    • Reward points : 0
    • Joined: 8/11/2005
    • Status: offline
    Re:Netlogon.vbs Monday, September 06, 2010 3:21 AM (permalink)
    0
    I prefer to get the user's group membership the once and store it in a dictionary object for use throughout the script.

    Also, take a look at my XML-based method for mapping drives in a logon script  http://www.visualbasicscript.com/m52191.aspx
    <message edited by ginolard on Monday, September 06, 2010 3:23 AM>
    Author of ManagePC - http://managepc.net

    #2
      erratum

      • Total Posts : 33
      • Scores: 0
      • Reward points : 0
      • Joined: 2/23/2010
      • Status: offline
      Re:Netlogon.vbs Monday, September 06, 2010 4:21 PM (permalink)
      0
      Short before going home, I'd managed the problem (I'm gonna post the whole script later that day).
      Hm...the XML Style seems to be pretty cool. I'm gonna have a second look at it, maybe I can use that thing :)

      wbr erratum
      #3
        erratum

        • Total Posts : 33
        • Scores: 0
        • Reward points : 0
        • Joined: 2/23/2010
        • Status: offline
        Re:Netlogon.vbs Tuesday, September 07, 2010 5:54 PM (permalink)
        0
        Are there any limitations with posting code?
        I wanted to up my netlogon.vbs (anonymous) but it tell's me that it wouldnt work, cause the "document" was empty...
        <message edited by erratum on Tuesday, September 07, 2010 5:56 PM>
        #4
          ginolard

          • Total Posts : 1347
          • Scores: 23
          • Reward points : 0
          • Joined: 8/11/2005
          • Status: offline
          Re:Netlogon.vbs Tuesday, September 07, 2010 8:40 PM (permalink)
          0
          Just copy and paste the code and put it between CODE tags
          Author of ManagePC - http://managepc.net

          #5

            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-2012 ASPPlayground.NET Forum Version 3.8
            mbt shoes www.wileywilson.com