Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Logon script

1 view
Skip to first unread message

Owe Armandt

unread,
Jan 10, 2003, 10:09:34 AM1/10/03
to

1.
I'm trying to create a logon script to do various things,
like mapping drives and creating shortcuts on the desktop.
I would also like to create the users Outlook Exchange
profile and set that into the users roaming profile - how
can I do that??

2.
To map a drive in the script is not a problem but how can
I create a "network place" for the user to have in "My
network places" - this is to a local resource.


Owe

PH

unread,
Jan 10, 2003, 4:03:41 PM1/10/03
to
"Owe Armandt" <o...@armandt.se> wrote in news:O2K3ApLuCHA.2448@TK2MSFTNGP09:

>
> 1.
> I'm trying to create a logon script to do various things,
> like mapping drives and creating shortcuts on the desktop.
> I would also like to create the users Outlook Exchange
> profile and set that into the users roaming profile - how
> can I do that??

Depending on which version of Outlook you're using, there's an excellent
tool at http://www.redfox.co.uk/olclient/default.asp which will allow to you
to do this. I don't think it works with Outlook 2002, though.

> 2.
> To map a drive in the script is not a problem but how can
> I create a "network place" for the user to have in "My
> network places" - this is to a local resource.
>

Don't quite know what you're trying to do here. "My network places" allows
users to browse for servers and other workstations on a network. It will
also remember a list of recently accessed locations. As far as I know,
there's no way to automate the creation of items within it. If you're trying
to setup a 'home directory' for your users to save files into, then you need
to look at the properties page of the user accounts on your server. You can
set a home directory in here and map a drive letter to it as well. If you
have a Windows2000 server, you could also look into "My Documents" folder
redirection which is another way of doing it.

Owe Armandt

unread,
Jan 11, 2003, 4:13:10 AM1/11/03
to
Sorry, forgot to say that it's about Outlook 2000.

You can create shortcuts to server resources in "My Network Places" without
having to map a drive to it. Ther is an "Add network place" wizard in there
by wich you specify the UNC path and a name to use for it and that will
become what is called a "Folder Shortcut" - thata is what I'm trying to set
up for the users. I want all of them to have the same set of shortcuts to
various resources on the server.

Owe


"PH" <peter_jhar...@hotmail.com> wrote in message
news:Xns92FFD5B8B...@130.133.1.4...

PH

unread,
Jan 11, 2003, 8:49:26 AM1/11/03
to
"Owe Armandt" <o...@armandt.se> wrote in
news:Ojq1gGVuCHA.1132@TK2MSFTNGP12:

> Sorry, forgot to say that it's about Outlook 2000.
>
> You can create shortcuts to server resources in "My Network Places"
> without having to map a drive to it. Ther is an "Add network place"
> wizard in there by wich you specify the UNC path and a name to use for
> it and that will become what is called a "Folder Shortcut" - thata is
> what I'm trying to set up for the users. I want all of them to have the
> same set of shortcuts to various resources on the server.
>
>
>
> Owe

OK, sorry for the misunderstanding. What you need to do is to create
shortcuts to network paths and place them in My Network Places. I will
assume that your clients are Win2K or WinXP.

The items in My Network Places are actually stored in your users' profiles.
The path to these is c:\documents and settings\<username>\nethood.

What we can do is to create shorcuts in this folder which will then show up
in My Network Places. The easiest way to do this is with a little VBScript.
The following is a VBScript routine that will do this:

Call AddNetworkPlace ("\\servername\applications","Applications on Server")
wscript.quit

Sub AddNetworkPlace (strUNCPath,strDescription)
'
'Create a shortcut to a UNC path in My Network Places
'
'strUNCPath: UNC path to the network resource
'strDescription: Description of the shortcut that will
' appear in My Network Places
'
on error resume next
Set shell=CreateObject("Wscript.Shell")
Set objShortcut=Shell.CreateShortcut(Shell.SpecialFolders("Nethood") _
& "\" & strDescription & ".lnk")
With objShortcut
.TargetPath=strUNCPath
.Description=strDescription
.Save()
End With
set Shell=nothing
set objShortcut=nothing
End Sub


What this does is as follows:

1. Look in the SpecialFolders collection of the WshShell object to get the
location of the current users' NetHood folder. This will vary from user to
user if they each have their own userprofile.

2. Call the CreateShortcut method of the WshShell object to create a
shortcut in this folder according to the supplied parameters.

To use the routine, copy the above code into a text file and save it with a
.vbs extension.

Next, modify the parameters of the first line ("Call AddNetworkPlace...") to
point to your desired network location. The first parameter (shown as
"\\servername\applications" in the code above) is the UNC path to your
shared resource. The second parameter is the descriptive name that will
appear in My Network Places. You should change both of these as required.
You can call the subroutine AddNetworkPlace as many times as you like if you
need to add multiple items.

Once you have done this, you will need to have this script run when a user
logs in. The easiest way to do this is from a login script. If you already
have a VBScript login script of some kind, then you can just add the above
code into it. If you have a batch file login script (.bat) then you can call
the above routine using the following line (assumes that you have called
your VBscript file 'addfolders.vbs')

wscript addfolders.vbs

Obviously you will need to ensure that addfolders.vbs is readable by your
users when they login, the best place for it is in your server's NETLOGON
share if you're running Win2K or NT server.

Do post back if you have any further questions.

Owe Armandt

unread,
Jan 12, 2003, 11:16:21 AM1/12/03
to

Great, thank you - that did it. I tried thois before without success,
obviously I did something wrong soemwhere.

Owe

"PH" <peter_jhar...@hotmail.com> wrote in message

news:Xns93008C185...@130.133.1.4...

0 new messages