Questions on running my Logon scriptwith Novell Cleint 
Author Message
 Questions on running my Logon scriptwith Novell Cleint

First, I would suggest turning error handling back on
after your While/Wend loop. "On error resume next" stops
error handling until you turn it back on, so you only need
it once. The statement to turn it back on is:

On Error Goto 0

It's been a while since I worked with Novell (and it was
version 4), but I seem to remember NetWare having a
problem with UNC names - like it was real slow. I don't
know why.

Richard

Quote:
>-----Original Message-----
>Dear All,

>Now, I solved my problem on determine the next-available
drive and map
>drives in my logon script. However, my user said that if
he logged onto
>Novell Client and my Domain together, my script seems

running very slow in
Quote:
>terms of the speed of mapping my network shares, but
works fine without
>using Novell Client.

>I have attached my complete script here and appreciate if
some Pro. can
>help.



Sun, 04 Jul 2004 13:15:58 GMT  
 Questions on running my Logon scriptwith Novell Cleint
I think your speed problem is related to NetWare, but I do
see some ways to make your script more efficient. Just
suggestions, of course.

1. Turn error handling off before the While loop and turn
it on after.
2. If there is an error, clear it.
3. Create and destroy the WSHNetwork object outside the
loop. I've found it can loop over 100,000 times on a slow
machine! (I log the count)
4. Instead of checking every member of every group to see
if the current user is among them, check just the groups
that the current user belongs to. Fewer loops and checks.
5. I didn't create the adsGroup object. I used adsUser
instead. I also didn't use objFS.
6. I don't see where coldrives is used.
7. My method could map the drives in a different order. If
that matters, you can hard code drive letters.
8. Your MapDrive sub got cut off, but I figured it out.
---------------------------------
Set WSHNetwork = CreateObject("Wscript.Network")
On Error Resume Next

UserName = ""
While UserName = ""
  UserName = UCase(WSHNetwork.UserName)
  If Err.Number <> 0 Then
    Err.Clear
  End If
WEnd
On Error Goto 0

Letter = Asc("I")
Set adsUser = GetObject("WinNT://MyDomain/" & UserName)

For Each Group In adsUser.Groups
  If UCase(Group.Name) = "DOMAIN ADMINS" Then MapDrive Chr
(Letter) + ":", "\\MyDomain\X$"
  If UCase(Group.Name) + "GROUPA" Then MapDrive Chr
(Letter) + ":", \\MyDomain\A$"
  etc..... for Group B,C,D,E,F
Next

Set WSHNetwork = Nothing
Wscript.Quit(0)

Sub MapDrive(DriveLetter, UNCString)
  WSHNetwork.MapNetworkDrive DriveLetter, UNCString
  Letter = Letter + 1
End Sub

Richard

Quote:
>-----Original Message-----
>First, I would suggest turning error handling back on
>after your While/Wend loop. "On error resume next" stops
>error handling until you turn it back on, so you only
need
>it once. The statement to turn it back on is:

>On Error Goto 0

>It's been a while since I worked with Novell (and it was
>version 4), but I seem to remember NetWare having a
>problem with UNC names - like it was real slow. I don't
>know why.

>Richard
>>-----Original Message-----
>>Dear All,

>>Now, I solved my problem on determine the next-available
>drive and map
>>drives in my logon script. However, my user said that if
>he logged onto
>>Novell Client and my Domain together, my script seems
>running very slow in
>>terms of the speed of mapping my network shares, but
>works fine without
>>using Novell Client.

>>I have attached my complete script here and appreciate
if
>some Pro. can
>>help.

>.



Mon, 05 Jul 2004 07:02:04 GMT  
 Questions on running my Logon scriptwith Novell Cleint
Many Thx Richard, I am appreciated for your detail suggestion, THX!

Simon


Quote:
> I think your speed problem is related to NetWare, but I do
> see some ways to make your script more efficient. Just
> suggestions, of course.

> 1. Turn error handling off before the While loop and turn
> it on after.
> 2. If there is an error, clear it.
> 3. Create and destroy the WSHNetwork object outside the
> loop. I've found it can loop over 100,000 times on a slow
> machine! (I log the count)
> 4. Instead of checking every member of every group to see
> if the current user is among them, check just the groups
> that the current user belongs to. Fewer loops and checks.
> 5. I didn't create the adsGroup object. I used adsUser
> instead. I also didn't use objFS.
> 6. I don't see where coldrives is used.
> 7. My method could map the drives in a different order. If
> that matters, you can hard code drive letters.
> 8. Your MapDrive sub got cut off, but I figured it out.
> ---------------------------------
> Set WSHNetwork = CreateObject("Wscript.Network")
> On Error Resume Next

> UserName = ""
> While UserName = ""
>   UserName = UCase(WSHNetwork.UserName)
>   If Err.Number <> 0 Then
>     Err.Clear
>   End If
> WEnd
> On Error Goto 0

> Letter = Asc("I")
> Set adsUser = GetObject("WinNT://MyDomain/" & UserName)

> For Each Group In adsUser.Groups
>   If UCase(Group.Name) = "DOMAIN ADMINS" Then MapDrive Chr
> (Letter) + ":", "\\MyDomain\X$"
>   If UCase(Group.Name) + "GROUPA" Then MapDrive Chr
> (Letter) + ":", \\MyDomain\A$"
>   etc..... for Group B,C,D,E,F
> Next

> Set WSHNetwork = Nothing
> Wscript.Quit(0)

> Sub MapDrive(DriveLetter, UNCString)
>   WSHNetwork.MapNetworkDrive DriveLetter, UNCString
>   Letter = Letter + 1
> End Sub

> Richard
> >-----Original Message-----
> >First, I would suggest turning error handling back on
> >after your While/Wend loop. "On error resume next" stops
> >error handling until you turn it back on, so you only
> need
> >it once. The statement to turn it back on is:

> >On Error Goto 0

> >It's been a while since I worked with Novell (and it was
> >version 4), but I seem to remember NetWare having a
> >problem with UNC names - like it was real slow. I don't
> >know why.

> >Richard
> >>-----Original Message-----
> >>Dear All,

> >>Now, I solved my problem on determine the next-available
> >drive and map
> >>drives in my logon script. However, my user said that if
> >he logged onto
> >>Novell Client and my Domain together, my script seems
> >running very slow in
> >>terms of the speed of mapping my network shares, but
> >works fine without
> >>using Novell Client.

> >>I have attached my complete script here and appreciate
> if
> >some Pro. can
> >>help.

> >.



Mon, 05 Jul 2004 09:00:02 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Auto NT4 server logon with Logon to Novell server(4.11)

2. Logon to Novell upon bootup

3. Changing a Script from the Cleint to the Server (ASP)

4. hiding javascript code using asp or cleint side scripting

5. Instantiating IE instance in XP with Cleint-Side VBScript Hangs

6. how to encode ASP with cleint script?

7. Running a Visual Basic Script During Logon

8. Logon Date/Time Script Won't Run

9. How do I run a .vbs file a NT logon script

10. Running replicated WSH logon scripts

11. Error running logon script

12. OT: Running logon script

 

 
Powered by phpBB® Forum Software