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

New to login scripts

Status
Not open for further replies.

McCisco

Technical User
Oct 29, 2006
81
0
0
US
New to login scripts

Can anyone direct me to a "beginners" guide to login scripts.

Thanks,
 
ok,
heres the problem.

W2K server:
~ I created a login script called login2.vbs
~~~~
Const test123_GROUP = "cn=test123"


Set wshNetwork = CreateObject("WScript.Network")
wshNetwork.MapNetworkDrive "h:",
"\\trixnite\home\" & wshNetwork.UserName

Set ADSystemInfo = CreateObject("delos")
Set CurrentUser = GetObject("LDAP://" &
delos.UserName)
strGroups = LCase(Join(CurrentUser.MemberOf))

If InStr(strGroups, test123_GROUP) Then

wshNetwork.MapNetworkDrive "s:",
"\\trixnite\temp\"
wshNetwork.AddWindowsPrinterConnection
"\\trixnite\laserjet4"

End If
~~~~
~ I placed in \\trixnite\script, I gave the everyone group read access to it.
~ I created the path to in the login path for the user in properties inder the profile tap\login script
~ When I login as that user I don't see the script run and it does not map the drive or add the printer.

~ Sorry it this seems stupid, I am new to microsoft scripts.
Thoughts?
Thanks,
 
Just from what you posted what I see are syntax errors.
For example:
wshNetwork.MapNetworkDrive "s:",
"\\trixnite\temp\"
wshNetwork.AddWindowsPrinterConnection
"\\trixnite\laserjet4"
This should actually be two lines not four.
Should look like:
Code:
wshNetwork.MapNetworkDrive "s:", "\\trixnite\temp\"
wshNetwork.AddWindowsPrinterConnection "\\trixnite\laserjet4"
 
Sorry accidently hit post...
If the lines are long and you want to break them up, you need to use the underscore character to tell the scripting engine that the line continues. Like the following:
Code:
wshNetwork.MapNetworkDrive "s:", _
"\\trixnite\temp\"
wshNetwork.AddWindowsPrinterConnection _
"\\trixnite\lasterjet4"
Here is where I see other syntax errors, with regard to line breaks that shouldn't be there:
wshNetwork.MapNetworkDrive "h:",
"\\trixnite\home\" & wshNetwork.UserName
Set CurrentUser = GetObject("LDAP://" &
delos.UserName)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top