Re: Vista Logon Script
- From: "Richard Mueller" <rlmueller-NOSPAM@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 22 Nov 2006 12:31:02 -0600
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
.
- Follow-Ups:
- Re: Vista Logon Script
- From: Richard Mueller
- Re: Vista Logon Script
- References:
- Re: Vista Logon Script
- From: Richard Mueller
- Re: Vista Logon Script
- From: Richard Mueller
- Re: Vista Logon Script
- From: randyh@newsgroups.nospam
- Re: Vista Logon Script
- Prev by Date: Unable to throw exception from method in encoded JS
- Next by Date: Re: Vista Logon Script
- Previous by thread: Re: Vista Logon Script
- Next by thread: Re: Vista Logon Script
- Index(es):
Relevant Pages
|