Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Vbscript not recognizing groupnesting

Status
Not open for further replies.

felix27

Technical User
Jul 22, 2004
23
AT
I have changed my logonscript to vbscript.

i use the following statements to map groups and it works fine.

Sub Logon_Script_Gruppen

On Error Resume Next

For each prop in adsobj.groups

Select case prop.name

Case "DPW"
oWshNetwork.RemoveNetworkDrive "V:", True, True
oWshNetwork.MapNetworkDrive "V:", "\\servA\v8_prg"


If the group does not contain the userobject itself, but some other groups, this won´t work.

I have no idea how i could implement the case for nested groups.

may somebody has solved this issue bevor.

kind regards,

felix
 
Try this:

Sub Logon_Script_Gruppen

On Error Resume Next

For each prop in adsobj.groups

Select case prop.name

Case "DPW"
oWshNetwork.RemoveNetworkDrive "V:", True, True
oWshNetwork.MapNetworkDrive "V:", "\\servA\v8_prg"
NEXT

Joseph L. Poandl
MCSE 2003

If your company is in need of experts to examine technical problems/solutions, please check out (Sales@njcomputernetworks.com)
 
Unfortunately just the NEXT-Statement did not change something.

here is the complete vb-code for those drive mappings from my script.

Set oWshNetwork = CreateObject("WScript.Network")
strUserName = oWshNetwork.Username
strUserDomain = oWshNetwork.UserDomain
strComputerName = oWshNetwork.Computername
strHomeDir = strUserhome & "\" & strUserName
adspath = "WinNT://" & strUserDomain & "/" & strUserName
Set adsobj = getobject (adspath)

Call Logon_Script_Gruppen

Sub Logon_Script_Gruppen

On Error Resume Next

For each prop in adsobj.groups

Select case prop.name

Case "DPW"
oWshNetwork.RemoveNetworkDrive "V:", True, True
oWshNetwork.MapNetworkDrive "V:", "\\servA\v8_prg"

Case "_MaWi"
oWshNetwork.RemoveNetworkDrive "V:", True, True
oWshNetwork.MapNetworkDrive "V:", "\\servA\abt"

Case "SAP ALL"
oWshNetwork.RemoveNetworkDrive "K:", True, True
oWshNetwork.MapNetworkDrive "K:", "\\servA\sap_trans"

Felix
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top