Jump to content

logon script error message


Recommended Posts

Guest khuizhang
Posted

Hi guys,

Some users have an inconsistent "access denied" error message popping up

when they logon. I have done the following:

1) under user logon, acess sysvol and run the script manually. it works,

which means user permission is fine.

2) checked time service and it is working fine.

I have the script below:

 

Set WshNetwork = Wscript.CreateObject("WScript.Network")

Set WshShell = WScript.CreateObject("WScript.Shell")

Set FileSysObj = CreateObject("Scripting.FileSystemObject")

 

userName = WshNetwork.UserName

 

' Map drives

if FileSysObj.DriveExists("y:") = true then wshNetwork.RemoveNetworkDrive

"y:"

if FileSysObj.DriveExists("g:") = true then wshNetwork.RemoveNetworkDrive

"g:"

if FileSysObj.DriveExists("h:") = true then wshNetwork.RemoveNetworkDrive

"h:"

 

wshNetwork.MapNetworkDrive "g:", "\\fileserver\common02", false

wshNetwork.MapNetworkDrive "h:", "\\sbsserver\users\" & userName, false

 

'Map Shared network printers

WshNetwork.AddWindowsPrinterConnection "\\library\hp_north"

 

 

The error message refers to the line mapping h: drive.

 

Could any one kindly help me out?

TIA,

  • Replies 6
  • Created
  • Last Reply
Guest Pegasus \(MVP\)
Posted

Re: logon script error message

 

 

"khuizhang" <khuizhang@discussions.microsoft.com> wrote in message

news:08B3CF5F-0138-4E7B-BB17-CFE7D68532B8@microsoft.com...

> Hi guys,

> Some users have an inconsistent "access denied" error message popping up

> when they logon. I have done the following:

> 1) under user logon, acess sysvol and run the script manually. it works,

> which means user permission is fine.

> 2) checked time service and it is working fine.

> I have the script below:

>

> Set WshNetwork = Wscript.CreateObject("WScript.Network")

> Set WshShell = WScript.CreateObject("WScript.Shell")

> Set FileSysObj = CreateObject("Scripting.FileSystemObject")

>

> userName = WshNetwork.UserName

>

> ' Map drives

> if FileSysObj.DriveExists("y:") = true then wshNetwork.RemoveNetworkDrive

> "y:"

> if FileSysObj.DriveExists("g:") = true then wshNetwork.RemoveNetworkDrive

> "g:"

> if FileSysObj.DriveExists("h:") = true then wshNetwork.RemoveNetworkDrive

> "h:"

>

> wshNetwork.MapNetworkDrive "g:", "\\fileserver\common02", false

> wshNetwork.MapNetworkDrive "h:", "\\sbsserver\users\" & userName, false

>

> 'Map Shared network printers

> WshNetwork.AddWindowsPrinterConnection "\\library\hp_north"

>

>

> The error message refers to the line mapping h: drive.

>

> Could any one kindly help me out?

> TIA,

>

 

Maybe the variable userName is incorrect or undefined. Add the line

wscript.echo "User Name=" & userName

underneath the problem line so that you can see what it is.

Guest khuizhang
Posted

Re: logon script error message

 

username is intended to be the one logged on. I am sure it every user has its

own folder. and the problem is the message is inconsistent and cannot be

reproduced.In this script:

userName = WshNetwork.UserName

 

"Pegasus (MVP)" wrote:

>

> "khuizhang" <khuizhang@discussions.microsoft.com> wrote in message

> news:08B3CF5F-0138-4E7B-BB17-CFE7D68532B8@microsoft.com...

> > Hi guys,

> > Some users have an inconsistent "access denied" error message popping up

> > when they logon. I have done the following:

> > 1) under user logon, acess sysvol and run the script manually. it works,

> > which means user permission is fine.

> > 2) checked time service and it is working fine.

> > I have the script below:

> >

> > Set WshNetwork = Wscript.CreateObject("WScript.Network")

> > Set WshShell = WScript.CreateObject("WScript.Shell")

> > Set FileSysObj = CreateObject("Scripting.FileSystemObject")

> >

> > userName = WshNetwork.UserName

> >

> > ' Map drives

> > if FileSysObj.DriveExists("y:") = true then wshNetwork.RemoveNetworkDrive

> > "y:"

> > if FileSysObj.DriveExists("g:") = true then wshNetwork.RemoveNetworkDrive

> > "g:"

> > if FileSysObj.DriveExists("h:") = true then wshNetwork.RemoveNetworkDrive

> > "h:"

> >

> > wshNetwork.MapNetworkDrive "g:", "\\fileserver\common02", false

> > wshNetwork.MapNetworkDrive "h:", "\\sbsserver\users\" & userName, false

> >

> > 'Map Shared network printers

> > WshNetwork.AddWindowsPrinterConnection "\\library\hp_north"

> >

> >

> > The error message refers to the line mapping h: drive.

> >

> > Could any one kindly help me out?

> > TIA,

> >

>

> Maybe the variable userName is incorrect or undefined. Add the line

> wscript.echo "User Name=" & userName

> underneath the problem line so that you can see what it is.

>

>

>

Guest Pegasus \(MVP\)
Posted

Re: logon script error message

 

Being sure is not enough. Since you have a problem, you

must consider all possibilities, even the one of an incorrect

or missing user name. That's what trouble-shooting is all

about.

 

 

"khuizhang" <khuizhang@discussions.microsoft.com> wrote in message

news:666342B0-B3EB-4682-9C59-70945A872B67@microsoft.com...

> username is intended to be the one logged on. I am sure it every user has

> its

> own folder. and the problem is the message is inconsistent and cannot be

> reproduced.In this script:

> userName = WshNetwork.UserName

>

> "Pegasus (MVP)" wrote:

>

>>

>> "khuizhang" <khuizhang@discussions.microsoft.com> wrote in message

>> news:08B3CF5F-0138-4E7B-BB17-CFE7D68532B8@microsoft.com...

>> > Hi guys,

>> > Some users have an inconsistent "access denied" error message popping

>> > up

>> > when they logon. I have done the following:

>> > 1) under user logon, acess sysvol and run the script manually. it

>> > works,

>> > which means user permission is fine.

>> > 2) checked time service and it is working fine.

>> > I have the script below:

>> >

>> > Set WshNetwork = Wscript.CreateObject("WScript.Network")

>> > Set WshShell = WScript.CreateObject("WScript.Shell")

>> > Set FileSysObj = CreateObject("Scripting.FileSystemObject")

>> >

>> > userName = WshNetwork.UserName

>> >

>> > ' Map drives

>> > if FileSysObj.DriveExists("y:") = true then

>> > wshNetwork.RemoveNetworkDrive

>> > "y:"

>> > if FileSysObj.DriveExists("g:") = true then

>> > wshNetwork.RemoveNetworkDrive

>> > "g:"

>> > if FileSysObj.DriveExists("h:") = true then

>> > wshNetwork.RemoveNetworkDrive

>> > "h:"

>> >

>> > wshNetwork.MapNetworkDrive "g:", "\\fileserver\common02", false

>> > wshNetwork.MapNetworkDrive "h:", "\\sbsserver\users\" & userName,

>> > false

>> >

>> > 'Map Shared network printers

>> > WshNetwork.AddWindowsPrinterConnection "\\library\hp_north"

>> >

>> >

>> > The error message refers to the line mapping h: drive.

>> >

>> > Could any one kindly help me out?

>> > TIA,

>> >

>>

>> Maybe the variable userName is incorrect or undefined. Add the line

>> wscript.echo "User Name=" & userName

>> underneath the problem line so that you can see what it is.

>>

>>

>>

Guest khuizhang
Posted

Re: logon script error message

 

Thanks i will try that on some test users first.

 

"Pegasus (MVP)" wrote:

> Being sure is not enough. Since you have a problem, you

> must consider all possibilities, even the one of an incorrect

> or missing user name. That's what trouble-shooting is all

> about.

>

>

> "khuizhang" <khuizhang@discussions.microsoft.com> wrote in message

> news:666342B0-B3EB-4682-9C59-70945A872B67@microsoft.com...

> > username is intended to be the one logged on. I am sure it every user has

> > its

> > own folder. and the problem is the message is inconsistent and cannot be

> > reproduced.In this script:

> > userName = WshNetwork.UserName

> >

> > "Pegasus (MVP)" wrote:

> >

> >>

> >> "khuizhang" <khuizhang@discussions.microsoft.com> wrote in message

> >> news:08B3CF5F-0138-4E7B-BB17-CFE7D68532B8@microsoft.com...

> >> > Hi guys,

> >> > Some users have an inconsistent "access denied" error message popping

> >> > up

> >> > when they logon. I have done the following:

> >> > 1) under user logon, acess sysvol and run the script manually. it

> >> > works,

> >> > which means user permission is fine.

> >> > 2) checked time service and it is working fine.

> >> > I have the script below:

> >> >

> >> > Set WshNetwork = Wscript.CreateObject("WScript.Network")

> >> > Set WshShell = WScript.CreateObject("WScript.Shell")

> >> > Set FileSysObj = CreateObject("Scripting.FileSystemObject")

> >> >

> >> > userName = WshNetwork.UserName

> >> >

> >> > ' Map drives

> >> > if FileSysObj.DriveExists("y:") = true then

> >> > wshNetwork.RemoveNetworkDrive

> >> > "y:"

> >> > if FileSysObj.DriveExists("g:") = true then

> >> > wshNetwork.RemoveNetworkDrive

> >> > "g:"

> >> > if FileSysObj.DriveExists("h:") = true then

> >> > wshNetwork.RemoveNetworkDrive

> >> > "h:"

> >> >

> >> > wshNetwork.MapNetworkDrive "g:", "\\fileserver\common02", false

> >> > wshNetwork.MapNetworkDrive "h:", "\\sbsserver\users\" & userName,

> >> > false

> >> >

> >> > 'Map Shared network printers

> >> > WshNetwork.AddWindowsPrinterConnection "\\library\hp_north"

> >> >

> >> >

> >> > The error message refers to the line mapping h: drive.

> >> >

> >> > Could any one kindly help me out?

> >> > TIA,

> >> >

> >>

> >> Maybe the variable userName is incorrect or undefined. Add the line

> >> wscript.echo "User Name=" & userName

> >> underneath the problem line so that you can see what it is.

> >>

> >>

> >>

>

>

>

Guest Ryan Hanisco
Posted

Re: logon script error message

 

Is this broken across the board, or is it for just some users -- more to the

point, is it consistently broken for those users or does it ever work for

them?

--

Ryan Hanisco

MCSE, MCTS: SQL 2005, Project+

http://www.techsterity.com

Chicago, IL

 

Remember: Marking helpful answers helps everyone find the info they need

quickly.

 

 

"khuizhang" wrote:

> Thanks i will try that on some test users first.

>

> "Pegasus (MVP)" wrote:

>

> > Being sure is not enough. Since you have a problem, you

> > must consider all possibilities, even the one of an incorrect

> > or missing user name. That's what trouble-shooting is all

> > about.

> >

> >

> > "khuizhang" <khuizhang@discussions.microsoft.com> wrote in message

> > news:666342B0-B3EB-4682-9C59-70945A872B67@microsoft.com...

> > > username is intended to be the one logged on. I am sure it every user has

> > > its

> > > own folder. and the problem is the message is inconsistent and cannot be

> > > reproduced.In this script:

> > > userName = WshNetwork.UserName

> > >

> > > "Pegasus (MVP)" wrote:

> > >

> > >>

> > >> "khuizhang" <khuizhang@discussions.microsoft.com> wrote in message

> > >> news:08B3CF5F-0138-4E7B-BB17-CFE7D68532B8@microsoft.com...

> > >> > Hi guys,

> > >> > Some users have an inconsistent "access denied" error message popping

> > >> > up

> > >> > when they logon. I have done the following:

> > >> > 1) under user logon, acess sysvol and run the script manually. it

> > >> > works,

> > >> > which means user permission is fine.

> > >> > 2) checked time service and it is working fine.

> > >> > I have the script below:

> > >> >

> > >> > Set WshNetwork = Wscript.CreateObject("WScript.Network")

> > >> > Set WshShell = WScript.CreateObject("WScript.Shell")

> > >> > Set FileSysObj = CreateObject("Scripting.FileSystemObject")

> > >> >

> > >> > userName = WshNetwork.UserName

> > >> >

> > >> > ' Map drives

> > >> > if FileSysObj.DriveExists("y:") = true then

> > >> > wshNetwork.RemoveNetworkDrive

> > >> > "y:"

> > >> > if FileSysObj.DriveExists("g:") = true then

> > >> > wshNetwork.RemoveNetworkDrive

> > >> > "g:"

> > >> > if FileSysObj.DriveExists("h:") = true then

> > >> > wshNetwork.RemoveNetworkDrive

> > >> > "h:"

> > >> >

> > >> > wshNetwork.MapNetworkDrive "g:", "\\fileserver\common02", false

> > >> > wshNetwork.MapNetworkDrive "h:", "\\sbsserver\users\" & userName,

> > >> > false

> > >> >

> > >> > 'Map Shared network printers

> > >> > WshNetwork.AddWindowsPrinterConnection "\\library\hp_north"

> > >> >

> > >> >

> > >> > The error message refers to the line mapping h: drive.

> > >> >

> > >> > Could any one kindly help me out?

> > >> > TIA,

> > >> >

> > >>

> > >> Maybe the variable userName is incorrect or undefined. Add the line

> > >> wscript.echo "User Name=" & userName

> > >> underneath the problem line so that you can see what it is.

> > >>

> > >>

> > >>

> >

> >

> >

Guest khuizhang
Posted

Re: logon script error message

 

Thanks for asking.

It is inconsistent. Most of time, the script works fine for all users, but

occasionally it will give an error message to some user. I cannot find a way

to reproduce it.

 

"Ryan Hanisco" wrote:

> Is this broken across the board, or is it for just some users -- more to the

> point, is it consistently broken for those users or does it ever work for

> them?

> --

> Ryan Hanisco

> MCSE, MCTS: SQL 2005, Project+

> http://www.techsterity.com

> Chicago, IL

>

> Remember: Marking helpful answers helps everyone find the info they need

> quickly.

>

>

> "khuizhang" wrote:

>

> > Thanks i will try that on some test users first.

> >

> > "Pegasus (MVP)" wrote:

> >

> > > Being sure is not enough. Since you have a problem, you

> > > must consider all possibilities, even the one of an incorrect

> > > or missing user name. That's what trouble-shooting is all

> > > about.

> > >

> > >

> > > "khuizhang" <khuizhang@discussions.microsoft.com> wrote in message

> > > news:666342B0-B3EB-4682-9C59-70945A872B67@microsoft.com...

> > > > username is intended to be the one logged on. I am sure it every user has

> > > > its

> > > > own folder. and the problem is the message is inconsistent and cannot be

> > > > reproduced.In this script:

> > > > userName = WshNetwork.UserName

> > > >

> > > > "Pegasus (MVP)" wrote:

> > > >

> > > >>

> > > >> "khuizhang" <khuizhang@discussions.microsoft.com> wrote in message

> > > >> news:08B3CF5F-0138-4E7B-BB17-CFE7D68532B8@microsoft.com...

> > > >> > Hi guys,

> > > >> > Some users have an inconsistent "access denied" error message popping

> > > >> > up

> > > >> > when they logon. I have done the following:

> > > >> > 1) under user logon, acess sysvol and run the script manually. it

> > > >> > works,

> > > >> > which means user permission is fine.

> > > >> > 2) checked time service and it is working fine.

> > > >> > I have the script below:

> > > >> >

> > > >> > Set WshNetwork = Wscript.CreateObject("WScript.Network")

> > > >> > Set WshShell = WScript.CreateObject("WScript.Shell")

> > > >> > Set FileSysObj = CreateObject("Scripting.FileSystemObject")

> > > >> >

> > > >> > userName = WshNetwork.UserName

> > > >> >

> > > >> > ' Map drives

> > > >> > if FileSysObj.DriveExists("y:") = true then

> > > >> > wshNetwork.RemoveNetworkDrive

> > > >> > "y:"

> > > >> > if FileSysObj.DriveExists("g:") = true then

> > > >> > wshNetwork.RemoveNetworkDrive

> > > >> > "g:"

> > > >> > if FileSysObj.DriveExists("h:") = true then

> > > >> > wshNetwork.RemoveNetworkDrive

> > > >> > "h:"

> > > >> >

> > > >> > wshNetwork.MapNetworkDrive "g:", "\\fileserver\common02", false

> > > >> > wshNetwork.MapNetworkDrive "h:", "\\sbsserver\users\" & userName,

> > > >> > false

> > > >> >

> > > >> > 'Map Shared network printers

> > > >> > WshNetwork.AddWindowsPrinterConnection "\\library\hp_north"

> > > >> >

> > > >> >

> > > >> > The error message refers to the line mapping h: drive.

> > > >> >

> > > >> > Could any one kindly help me out?

> > > >> > TIA,

> > > >> >

> > > >>

> > > >> Maybe the variable userName is incorrect or undefined. Add the line

> > > >> wscript.echo "User Name=" & userName

> > > >> underneath the problem line so that you can see what it is.

> > > >>

> > > >>

> > > >>

> > >

> > >

> > >


×
×
  • Create New...