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!

My patient is running out in Scripting!!!!

Status
Not open for further replies.

TonyChung

IS-IT--Management
Aug 9, 2001
11
CA
Hi:

i have been trying to work on this
directory mapping for weeks. And
i just can't get it done under
win2000. i posted quesiton before
and have done serveral checks
regards to settings in group policy.

Can someone have mercy on me either
email me or proceurilze how i can
do to create a successful log on
script under Win2000 Adv. Server?

Tks for your time!

tony
 
You can do an easy script that runs very fast in VB. W2K will run VBS without any special DLL's like NT4 needed.
Here is an example:

'---------
'login.vbs
'---------
on error resume next
Set WshNetwork = WScript.CreateObject("WScript.Network")
'-------------------------
'Remove old drive mappings
'-------------------------
WshNetwork.RemoveNetworkdrive "G:"
WshNetwork.RemoveNetworkdrive "H:"
'----------------------
'Make new dive mappings
'----------------------
WshNetwork.MapNetworkDrive "G:", "\\servername\sharename"
WshNetwork.MapNetworkDrive "H:", "\\servername\" + WshNetwork.UserName + "$"
'--------
'Clean up
'--------
set objShell = nothing
Wscript.Quit


The drive mapping for "H:" shows how to map a dir that is the users log in name (such as jsmith) that is hidden.

Hope this helps. :)
 
Oops. The last 2 lines before


'--------
'Clean up
'--------


should be one continuous line.
 
i think there's something with my settings.
i tested my script locally. It runs fine.
But when i merged it with GP, nothing
happens. Would you provide me some insight
regards where to store them or AD settings?

Thank you for your time!

tony
 
I think I am misunderstanding. What is GP?

We have our scripts stored on a DC under the NETLOGON share. I will try and find out exactly where you tell W2K to look for a log-in script as default.

In AD Users and Computers you double-click on the user and go to the "Profile" tab. Put your script name in the field marked "Login script:" You might even be able to put a complete path, including server and share, there.
 
Thank you Al, i have finally got my job done.

By the way, what i meant "GP" is group policy.

OK, 2nd round here ^^, i know i can
do mapping and some manipulation with user
interfaces.. but... any more???

The question is what are some standards that
any of you put into practice as to logon script?

Also, i found that if i made my netlog folder hidden,
there'll some error happens, but i don't want
to expose the folder where i'll store scripts or
templates.

Any suggestion?

Thank you for your time!

tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top