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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBS Script for Notes 6.5.3 Via Script HELP

Status
Not open for further replies.

lc2978

IS-IT--Management
Dec 11, 2006
5
0
0
HI,

I have created a script that allows users to connec to lotus notes 6.5.3

The issue I am having is that I need to modify the script and add environmental variable so everytime a different user logs in it works for that particular user. All users.

I have the following:

Set net = WScript.CreateObject("WScript.Network")
Set sh = WScript.CreateObject("WScript.shell")

on error resume next

net.MapNetworkDrive "X:", "\\NOVELL1\DATA\USERS\userx\Mydocs\mail"

sh.run "C:\Lotus\notes\notes.exe =g:\notes.ini", 1, true

on error goto 0

I am trying to add a variable that works for all users: This one goes under "userx" like %username%. I have tried different ways but I cannot get this working for all users.

The script should map the drive for each different users that logs in.

All the rest works correctly since once the user logs in Novell from citrix, he/she does not need to provide additional credentials for the drive mapping. So all i need is to have a drive mapping script that works for all scenarios (users logging in).

Can someone give me some ideas.

Thanks

MarkL
 
Something like this ?
net.MapNetworkDrive "X:", "\\NOVELL1\DATA\USERS\" & net.UserName & "\Mydocs\mail"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks Much,

It worked perfectly but I am having an issue now with the Novell server location. There are multiple branches and differen novell servers.

net.MapNetworkDrive "X:", "\\NOVELL1\DATA\USERS\userx\Mydocs\mail"
net.MapNetworkDrive "X:", "\\NOVELL2\DATA\USERS\userx\Mydocs\mail"

NOVELL1 is hardcoded in the script so it can only server users under NOVELL1. Is it possible to replace NOVELL server depending from what branch the user is loggin in. I think it is complicated since we are hardcoding the path. The path for all other branches is the same but the server name is different so this becomes an issue. Let me know if you have an idea. Thanks Alot....

MarkL
 
i've long been trying to get some help w/ connecting to Notes, would you share your approach(es)?

[yinyang] Tranpkp [pc2]
 
Why not create some security groups in AD, call them Novell1, Novell2, Novell3 or what ever. Add the users to the proper group then use a case statement in your login script. Something like this:

Code:
ON ERROR RESUME NEXT

Dim WSHShell, WSHNetwork, objDomain, DomainString, UserString, UserObj

Set WSHShell = CreateObject("WScript.Shell")
Set WSHNetwork = CreateObject("WScript.Network")

'Find the domain name
Set objDomain = getObject("LDAP://rootDse")
DomainString = objDomain.Get("dnsHostName")

'Get user name
UserString = WSHNetwork.UserName

'Check for group memberships
Set UserObj = GetObject("WinNT://" & DomainString & "/" & UserString)

'Map Drives by Group Membership
For Each GroupObj In UserObj.Groups
  Select Case GroupObj.Name
    Case "Novell1"
	WSHNetwork.MapNetworkDrive "X:", "\\NOVELL1\DATA\USERS\userx\Mydocs\mail",False
    Case "Novell2"
	WSHNetwork.MapNetworkDrive "X:", "\\NOVELL2\DATA\USERS\userx\Mydocs\mail",False
    Case "Novell3"
	WSHNetwork.MapNetworkDrive "Z:", "\\NOVELL3\DATA\USERS\userx\Mydocs\mail",False
  End Select
Next

'Clean up memory used
set UserObj = Nothing
set GroupObj = Nothing
set WSHNetwork = Nothing
set DomainString = Nothing
set WSHShell = Nothing
set UserString = Nothing

'Quit the Script
wscript.quit



RoadKi11

"This apparent fear reaction is typical, rather than try to solve technical problems technically, policy solutions are often chosen." - Fred Cohen
 
Thanks, Im still batteling trying to get this done. We do not have AD. We have Novell , Users\Servers are under an OU called US-->MIA, SEA, DEN, etc. Each novell servers and users are under that ou.

This provided by PHV works fine for dynamic users:

net.MapNetworkDrive "X:", "\\NOVELL1\DATA\USERS\" & net.UserName & "\Mydocs\mail"

Im trying to write a script that also replaces novell server dynamically based on what branch the user is in. for example if the user is at MIA.. then map the following

net.MapNetworkDrive "X:", "\\MIA\DATA\USERS\" & net.UserName & "\Mydocs\mail"

If the user is from SEA, then map the following:

net.MapNetworkDrive "X:", "\\SEA\DATA\USERS\" & net.UserName & "\Mydocs\mail"

The idea is to have a variable so it is dynamic. just like " & net.UserName & "

Any ideas to work this out.

Thanks




 
Everyone a Novell user? All your Novell servers in the same tree? Each location have a Novell server? Instead of vbs why not use the Novell login script?



RoadKi11

"This apparent fear reaction is typical, rather than try to solve technical problems technically, policy solutions are often chosen." - Fred Cohen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top