Login script - Script running before user logs on. 
Author Message
 Login script - Script running before user logs on.

I am trying to use WSH (cscript.exe) to run login scripts for Win95 clients
on NT4 server.  The problem I seem to be having is that I can't create a
User object in the script as the script runs before the user is logged on.

eg, strUserID = WSHNetwork.UserName

When I look at the value of strUserID in the de{*filter*} it is always nil.

The script runs fine if I execute it when already logged on, and I can see a
value for strUserID in the de{*filter*}.

I am using a batch file nominated in the user profile to start "cscript
loginfile.wsh"

I remember seeing a reference to this issue in Andrew Clinicks' slide show,
but is there any resolution?

BTW I have tried;

 Do
  strUserID = WSHNetwork.UserName
 Loop Until strUserID <> ""

Which I found in someone else's login script but it doesn't seem to help.

Any suggestion would be appreciated.

Ken Douglas



Sun, 16 Dec 2001 03:00:00 GMT  
 Login script - Script running before user logs on.
You need to run the VBScript file with wscript because the login procedure waits
for csript to finish before actually logging the user in, where as if you use
wscript the logon procedure will not hang around waiting for the script to
finish. So once the user is properly logged in the VBScript will come out of the
While...Wend loop and continue processing your logon script.

Mark Percival

Quote:

> I am trying to use WSH (cscript.exe) to run login scripts for Win95 clients
> on NT4 server.  The problem I seem to be having is that I can't create a
> User object in the script as the script runs before the user is logged on.

> eg, strUserID = WSHNetwork.UserName

> When I look at the value of strUserID in the de{*filter*} it is always nil.

> The script runs fine if I execute it when already logged on, and I can see a
> value for strUserID in the de{*filter*}.

> I am using a batch file nominated in the user profile to start "cscript
> loginfile.wsh"

> I remember seeing a reference to this issue in Andrew Clinicks' slide show,
> but is there any resolution?

> BTW I have tried;

>  Do
>   strUserID = WSHNetwork.UserName
>  Loop Until strUserID <> ""

> Which I found in someone else's login script but it doesn't seem to help.

> Any suggestion would be appreciated.

> Ken Douglas




Sun, 16 Dec 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Login script - Script running before user logs on.

2. User Groups in Login Scripts

3. Script for logging users on through VPN connection

4. Users login script = variable?

5. Specify Login Script In User Manager in NT4 Domain

6. Detecting a remote dialup user in a login script

7. Check the User Name in Login script

8. Users full name i login script

9. WHS Login Script - Deployment and User Information

10. Domain Login-Script / regarding user′s groups

11. NT Command Script - log in user

12. Newbie: Script to setup users Exchange account on login

 

 
Powered by phpBB® Forum Software