Re: Login Script

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



We don't run our logon script from GPO, but set our user accounts to run a
logon script. What is actually launched is a batch file, which proceeds to
run the vbscript part with a command like:

wscript.exe //nologo "%~dpn.vbs"

the status is shown in the command prompt window by wscript.echo statements
from within the vbscript.

/Al

"Nigel Yardley [MCSE]" <NigelYardleyMCSE@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:B67499BF-82CC-4B04-AC07-9A0E1EDEEC04@xxxxxxxxxxxxxxxx
Hi,

I've created a login script a sample of is shown below...
I have two versions of this. One used IE to display the status of the
login
script. This works fine on newer machines but on some older machines the
wscript process hangs causing the machine to freeze. To get around this I
have removed the IE components and just run the script from GPO.

The problem I have is there is NO visible sign to the users this is being
run.
Is there a way of it stating 'Logging onto network, and/or mapping network
drives' where it says applying computer settings after users login, or in
an
applet (VB) style box that can launch during the script running. Basically
something that is not IE based as I am sure it is this that has caused
problems on older systems.


On Error Resume Next
Dim WshNetwork, asdPath, User
Dim strMappedDrives, strStatus
Dim objNetwork, objShell, strUNCPrinter1, strUNCPrinter2
Dim strDriveLetter, strDriveLetter1, strDriveLetter2, strDriveLetter3,
strDriveLetter4, strRemotePath, strRemotePath1, strRemotePath2,
strRemotePath3, strUserName
Dim IE
Const ADS_READONLY_SERVER = 4
' Display IE status window
Call CreateIE()
strStatus = "Logon Script v2.0 " & Date()
ie.document.all.wstatus.InnerText = strMsg3
' Get the User ID
Set WSHNetwork = WScript.CreateObject("WScript.Network")
strUser = ""
While strUser = ""
strUser = WSHNetwork.UserName
Wend
ie.document.all.Msg1.InnerText = strUser
call main()
strStatus = strStatus & vbCRLF & "Network Logon Complete..."
ie.document.all.wstatus.InnerText = strStatus
Wscript.Sleep 2000
' Close IE status window
If not ie.document.all.holdit.checked then
ie.quit()
End if
' End of logon script
Public Sub Main()

I can e-mail the full script if requested.
Not I am not a computer programmer by any means and this login script was
tireless up together using source samples so any recommendations would
have
to be very easy to follow through.

Any help or suggestions would be much appreciated.

Regards


.



Relevant Pages

  • RE: Hot to Re Map a folder
    ... objNetwork.RemoveNetworkDrive strDriveLetter, True ... objNetwork.MapNetworkDrive strDriveLetter, strHomeServer, strProfile, strUser, strPassword ... > here is my script: ...
    (microsoft.public.scripting.wsh)
  • Re: Local account creation
    ... What I want to do is to use the script in a startup GPO so that there a generic local admin account on all computers for the helpdesk staff to logon to and perform troubleshooting/etc. ... Dim objNetwork, strComputer, strUser ... ' Specify name of local user account to be created. ...
    (microsoft.public.windows.server.scripting)
  • Re: Login Script
    ... The script is a vbs file so running it as described shouldn't be a problem. ... Dim strDriveLetter, strDriveLetter1, strDriveLetter2, strDriveLetter3, ... strDriveLetter4, strRemotePath, strRemotePath1, strRemotePath2, ... While strUser = "" ...
    (microsoft.public.scripting.wsh)
  • Re: Login Script
    ... Do you know if you can set it to display without ... What the script is actually doing, well you have already written that, have ... Dim strDriveLetter, strDriveLetter1, strDriveLetter2, strDriveLetter3, ... While strUser = "" ...
    (microsoft.public.scripting.wsh)
  • Re: Local account creation
    ... While this script works fine for my 2003 environment, ... use the script in a startup GPO so that there a generic local admin account ... Dim objNetwork, strComputer, strUser ...
    (microsoft.public.windows.server.scripting)