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

login scripts in 2000 1

Status
Not open for further replies.

loperita1

IS-IT--Management
Oct 24, 2001
2
US
do you have a sample login script?
where do I put them?

Thanks
 
Logon scripts go into your domain controllers NETLOGON folder. check out kix32 scripts.

Sample Script:

use n: "\\nybdc\nysys"
use s: "\\ctpdc\sys"
IF INGROUP("Domain Admins")
ENDIF

IF INGROUP("DEVELOPMENT")
USE T: "\\CICWEBSERVER\TEST$$"
USE P: "\\CICWEBSERVER\PRODUCTION$$"
USE V: "\\CICSILVER\DEVELOPMENT"
USE w: "\\CICSILVER\ENDIF
IF INGROUP("CORP")
use H: "\\CTPDC\corp$$"
ENDIF
IF INGROUP("TRADING")
use T: "\\CTPDC\TRADING$$"
ENDIF
IF INGROUP("UKUSERS")
use L: "\\CIC-UKDC1\UKSYS$$"
ENDIF

IF INGROUP("Antares")
use x: "\\CICANTARES\SSC"
ENDIF
IF INGROUP("BACKOFFICE")
use r: "\\CTPDC\bkoffice$$"
ENDIF

IF INGROUP("LEGAL")
use l: "\\CTPDC\LEGAL$$"
ENDIF

IF INGROUP("LEGALHUMANRESOURCES")
use l: "\\CTPDC\LEGAL$$"
use p: "\\HRSQL\ADP$$"
ENDIF

IF INGROUP("Marketing")
use M: "\\NYBDC\Marketing$$"
ENDIF

IF INGROUP ("SFMarketing")
use M: "\\NYBDC\SFMarketing$$"
ENDIF

IF INGROUP("HEDGWARE")
use f: "\\HWSVR\hedge$$"
use q: "\\HWSVR\hedge2$$"
ENDIF

IF INGROUP("TAX")
use t: "\\CTPDC\TAX$$"
ENDIF

IF INGROUP("Eze TC users")
use O: "\\ECAPP\EZE"
ENDIF

IF INGROUP("Administrators")
USE x: "\\cicantares\ssc"
use y: "\\BESSERVER\Kits"
ENDIF

USE U: "@HOMESHR$"

01110000
 
Do you have a sample small script to "say a message" everytime a user logs on?

with like a close button so after they read it they can close it?

Thanks
Chance~

 
I think if you use a "net send" command, it will work.

Iolair MacWalter
 
I am REALLY new... how would I do that then?

net send "message text"??

thanks
 
iolair (IS/IT--Manageme) - net send would def bring up the closeable pop up window, but how would you script that? what host would send the msg?

01110000
 
I think the actual syntax goes like this, assuming you have a user named John, and you wanted to send the message, "Good Morning"

net send John Good Morning

John would get a dialog box that says
Message from Server
Good Morning

And then the OK check box. Oh, yes, the server will replace Server above with its name. For example, server1 would say from server1.

Iolair MacWalter
 
Yes, but I'm curious of how that might be scripted? if you were to simply write "net send John Good Morning" and add it to a script, everyone in the domain would get johns good morning message. unless there could be "net send %user% Good Morning"?

01110000
 
Forget the net send.You are then making your server do more work than it needs to when every user is logging on in the morning. Plus you are then relying on the fact that the user has the Messenger service runningand if thye have been plagued with pop-ups it may not be.

You can use a simple VBScript to do it.

Set WSHNetwork = CreateObject("WScript.Network")
UserString = WSHNetwork.UserName
MsgBox "Hello " & UserString & " you have successfully logged on. Have a great day."
Set WSHNetwork = Nothing

Just pop the above text into a text file, give it a VBS extension and add it to your GPO under login scripts.

Here is a more detailed login script that I use. It will check group memberships, map drives and printers and can synchronize computers with the server time.

'==========================================================================
'
' NAME: LogonScript
'
' AUTHOR: Mark D. MacLachlan, The Spider's Parlor
' URL : ' DATE : 4/10/2003
'
' COMMENT: Enumerates current users' group memberships in given domain.
'
'==========================================================================


ON ERROR RESUME NEXT

Set WSHShell = CreateObject("WScript.Shell")
Set WSHNetwork = CreateObject("WScript.Network")
DomainString = "DomainName"
UserString = WSHNetwork.UserName

Set UserObj = GetObject("WinNT://" & DomainString & "/" & UserString)

'Synchronizes the time with Server our NTP Server
'WSHShell.Run "NET TIME \\Server /set /y"


WSHNetwork.RemoveNetworkDrive "F:"

wscript.sleep 300

'Maps drives needed by all
WSHNetwork.MapNetworkDrive "U:", "\\server\users",True
WSHNetwork.MapNetworkDrive "X:", "\\server\executables",True

'Now check for group memberships and map appropriate drives
For Each GroupObj In UserObj.Groups

Select Case GroupObj.Name
'Check for group memberships and take needed action
Case "Admin"
WSHNetwork.MapNetworkDrive "w:", "\\Server\Admin Stuff",True
Case "WorkerB"
WSHNetwork.MapNetworkDrive "w:", "\\Server\Shared Documents",True

End Select

Next


'Install Printers

WSHNetwork.AddWindowsPrinterConnection "\\Server\HP5si"



set UserObj = Nothing
set GroupObj = Nothing
set WSHNetwork = Nothing
set DomainString = Nothing
set WSHSHell = Nothing

wscript.quit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top