Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Network Drive Assignment (Drive Mappings)

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,38759
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Network Drive Assignment (Drive Mappings)
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Network Drive Assignment (Drive Mappings) - 10/16/2006 7:32:16 PM   
  takeda kozo

 

Posts: 83
Score: 0
Joined: 11/9/2005
Status: offline
Does anyone know a way to connect to Novell via VBS (I am guessing that LDAP can be used for this, but have never worked with Novell before) and retrieve:

- the groups that a user is a member of
- the network drives that a user will be assigned when logging into the domain

I've just completed a script which can be used for Active Directory, but I also need one for our Novell users as it's a mixed domain

If anyone can help me out, then fantastic. If nobody can, then at least I hope someone can benefit from the AD version :)

'_____________________________________________________________________________

On Error Resume Next
strDom = "YOUR_DOMAIN_NAME"
strUser = strSID ' This value is returned from a previous section (domain logon name)
strUser = strDom & "\" & strUser
const ADS_NAME_TYPE_NT4 = 3
const ADS_NAME_TYPE_1779 = 1
const ADS_NAME_INITTYPE_DOMAIN = 1

Dim Trans

Set Trans = CreateObject("NameTranslate")
Trans.Init ADS_NAME_INITTYPE_DOMAIN, strDom
Trans.Set ADS_NAME_TYPE_NT4, strUser
LdapDN = Trans.Get(ADS_NAME_INITTYPE_DOMAIN)

Set objUser = GetObject("LDAP://" & LdapDN)

For Each strGroup in objUser.MemberOf
  strGroupPath = "LDAP://" & strGroup
  Set objGroup = GetObject(strGroupPath)
  If InStr(objGroup.CN,"JPDRV") Then                    ' <======================= (you will need to modify this line, depending on how your groups are named)
      DriveArrayLine = Split(objGroup.CN,"--")         ' <======================= (you will need to modify this line, depending on how your groups are named)
      If Lcase(DriveArrayLine(3)) = "%username%" Then DriveArrayLine(3) = strSID
      FullPath = "\\" & DriveArrayLine(2) & "\" & DriveArrayLine(3)
      Wscript.Echo "Drive Letter: " & DriveArrayLine(1)
      Wscript.Echo "Drive Path: " & FullPath
  End If
Next

'____________________________________________________________________________

Maybe this won't work for everyone, as I am new to LDAP. But at least it will give some people an idea.

Cheers ~

< Message edited by takeda kozo -- 10/16/2006 7:35:46 PM >
 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Network Drive Assignment (Drive Mappings) Page: [1]
Jump to:





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
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts