Re: Login Script
- From: "Al Dunbar [MS-MVP]" <alan-no-drub-spam@xxxxxxxxxxx>
- Date: Wed, 17 Jan 2007 00:12:12 -0700
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,login
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
script. This works fine on newer machines but on some older machines therun.
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
Is there a way of it stating 'Logging onto network, and/or mapping networkan
drives' where it says applying computer settings after users login, or in
applet (VB) style box that can launch during the script running. Basicallyhave
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
to be very easy to follow through.
Any help or suggestions would be much appreciated.
Regards
.
- Follow-Ups:
- Re: Login Script
- From: Bill Stewart
- Re: Login Script
- From: Nigel Yardley [MCSE]
- Re: Login Script
- Prev by Date: Re: arguments when running as a Scheduled Task
- Next by Date: Re: Login Script
- Previous by thread: convert key=value to sgml
- Next by thread: Re: Login Script
- Index(es):
Relevant Pages
|