Re: Vista Logon Script

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Either the mapping gets disconnected, which doesn't seem likely, or the
logon script is running with different credentials so the mapping is not for
the user. For example, if a Startup script maps a drive, the user won't see
it because Startup scripts run as System. Sounds crazy, but that's the only
way I can think the mapping would not error and the user not have the
mapping. Almost like setting an environment variable that only lasts as long
as the command session.

Seems this must be documented somewhere.

--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net

"randyh@xxxxxxxxxxxxxxxxx"
<randyhnewsgroupsnospam@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:578ACB08-14A7-49EF-8B67-7BA582794219@xxxxxxxxxxxxxxxx
The scripts don't error out. Sorry, I forgot to mention that.

I just tried mapping to the same drive twice and the second time I map to
it
I get an error stating that the device is already in use. Does that mean
the
drives are mapping but for some reason getting disconnected after the
script
runs?

"Richard Mueller" wrote:

Sorry, I haven't worked with Vista yet. Maybe others have. Does it help
if
you use?

Set WSHNetwork = CreateObject("WScript.Network")

Perhaps the Wscript object is not allowed. Also, you might try to trap
the
error and code something to indicate the error. Perhaps:
=============
On Error Resume Next
Set WSHNetwork = CreateObject("WScript.Network")
If (Err.Number <> 0) Then
Call MsgBox("Error number: " & Err.Number _
"Description: " & Err.Description _
"Source: " & Err.Source)
End If
Err.Clear
WSHNetwork.MapNetworkDrive "G:", "\\SERVER\SHARE"
If (Err.Number <> 0) Then
Call MsgBox("Error number: " & Err.Number _
"Description: " & Err.Description _
"Source: " & Err.Source)
End If
On Error GoTo 0
=========
At least this will give you a clue as to which statement is the problem,
and
what the error message might be. The person logging on should see the
message boxes.

--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net

"randyh@xxxxxxxxxxxxxxxxx"
<randyhnewsgroupsnospam@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:DCE09B17-D6DF-48DD-A44C-E4E12F5E7E58@xxxxxxxxxxxxxxxx
These scripts work fine with XP. Here is a sample of what doesn't work:

Set WSHNetwork = WScript.CreateObject("WScript.Network")
WSHNetwork.MapNetworkDrive "G:", "\\SERVER\SHARE"

As I said previously the scripts work if I run them after logging on,
just
not when run from a logon script.

Thanks,
Randy

"Richard Mueller" wrote:

I am working with the RTM release of Vista trying to get my
organization's
logon/logoff scripts working. I have found one problem that I need
some
assistance with.

One of our logon scripts maps drives based on group membership. It
works
fine in Vista if it is ran once a user is fully logged in but does
not
work
when ran via the logon script. I have tried the following things:

- Map the drive using WScript.Network.MapNetworkDrive.
- Map the drive using "net use".
- Making the script sleep for 30 seconds before mapping the drives.

Can you post a snippet of your script that duplicates the problem?
Also,
does the script run correctly as a logon script on XP or W2k clients?

--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net








.



Relevant Pages

  • Re: Script Mapping all Drives
    ... I put the script together quickly, ... trap the error and then remove the existing mapping. ... Should code be added to remove all drives, ... Dim intIndex, objList, objGroup ...
    (microsoft.public.scripting.vbscript)
  • Re: MapNetworkDrive not working during first logon
    ... is mapped automatically as part of the users profile. ... if I open a command prompt and switch to one of the mapped drives I ... script runs I get the popup message ... No path is specified for the logon script itself. ...
    (microsoft.public.scripting.vbscript)
  • RE: Drive map issues after SP1
    ... There was never a /persistent:yes in the script - I had to add the ... the logon script will try to map the drive again. ... > before the map drive command to delete all the mapped drives: ...
    (microsoft.public.windows.server.sbs)
  • Re: Need help
    ... According to the description, you want a logon script to map drive letters ... Migration of Novell to MicrosoftTo boil down if you need to ... Scripts/Mapped Drives: Every Novell environment I have ever ... ...
    (microsoft.public.windows.server.migration)
  • Re: User Scripts
    ... users will not have their shared drives, ... dont have any others, try a basic script, maybe adding a printer, to see ... Also one other fix is to reboot the machine 3 ... then add the bat file name to the logon script text field. ...
    (microsoft.public.windows.server.active_directory)