Jump to content

Logon VBScript not running for children randomly..


Recommended Posts

Posted

Any ideas?

 

We have recently moved over to server 2008 R2 from server 2003 and everything seems fine... well sort of. One of the niggles at the moment and has only started happening in the last few days. The logon script does not seem to be running for children randomly... But it only seems thus far to be children. However if you restart the machine and they logon everything works and the script runs. It will not run correctly until the machine is restarted. We are running Win Xp Sp3 and everthing was fine before the change..

 

I have set the script not to continue on error and see what happens. There is nothing in the event viewer that suggests and error.

 

Anyone have any ideas?

Posted (edited)

Any chance of posting the script so we can see

 

1. what the script is meant to do or is trying to do ?

2. How is the script assigned in group policy ie logon script or startup script ?

3. When you say it does not run, do any of the actions the script is meant to run get applied or what exactly ?

4. Is it also possible to make the script sleep for about 10 or 15 seconds before running to see if that helps at all ie wscript.sleep 10000

 

1000 = one second ( so have put 10,000 ) without the apostrophe

Edited by mac_shinobi
Posted

Is this on laptops / desktops, hardwired or wireless?

I would look at setting wait for network in you gpo's - although we don't use scripts anymore (you can use 2008 gp to do most things) we did have an issue with gpo applying over the wireless on some machines.

Posted
Any chance of posting the script so we can see

 

1. what the script is meant to do or is trying to do ?

2. How is the script assigned in group policy ie logon script or startup script ?

3. When you say it does not run, do any of the actions the script is meant to run get applied or what exactly ?

4. Is it also possible to make the script sleep for about 10 or 15 seconds before running to see if that helps at all ie wscript.sleep 10000

 

1000 = one second ( so have put 10,000 ) without the apostrophe

 

Logon script to connect drives and printers.

Script is assigned in AD as a logon script

Nope, nothing seems to run. No drives or printers are connected.

Machines are all hardwired

 

I am looking at GPP to do this, but not got around to it. Also the last bit in the script for filling in reg entry of Office. How would I do that on GPP?

 

Here is a copy of the script - I know it calls a couple of batch files... But at the time was the only way to get things working (based on my knowledge of VBScripting)

 

'-------------------------------------------------------

'Monkseaton Middle School

'Pupil Logon Script

'Written By Anthony Jones May 2010

'-------------------------------------------------------

 

Option Explicit

Dim objNetwork, strRemotePath1, strRemotePath2, strRemotePath3

Dim strDriveLetter1, StrDriveLetter2, strDriveLetter3

Dim Command, prntchar, backgr

Dim RegMenu, WshShell, ADSysInfo, objUser, regpath, UsersName, UsersInitials

 

'On Error Resume Next

 

'-------------------------------------------------------

'This section removes and reconnects the network drives

 

strDriveLetter1 = "M:"

strDriveLetter2 = "P:"

strDriveLetter3 = "R:"

strRemotePath1 = "\\xenon\sme"

strRemotePath2 = "\\argon\public"

strRemotePath3 = "\\hydrogen\media"

 

Set objNetwork = CreateObject("WScript.Network")

 

'Section which connects Mapped Drive

 

objNetwork.MapNetworkDrive strDriveLetter1, strRemotePath1

objNetwork.MapNetworkDrive strDriveLetter2, strRemotePath2

objNetwork.MapNetworkDrive strDriveLetter3, strRemotePath3

 

 

'---------------------------------------------------------

 

'Printing Section

 

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

WshShell.run "%comspec% /c \\argon\netlogon\printers.bat",7

Set WshShell = Nothing

 

'---------------------------------------------------------

 

'Creation of custom desktop background using BGInfo

 

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

backgr = "c:\windows\bginfo\bginfo.exe /i""c:\windows\bginfo\students.bgi"" /accepteula /timer:0"

Command.Run (backgr)

 

'---------------------------------------------------------

 

'Start Ranger Print Client software

 

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

prntchar = "\\helium\rangerprint\gpclient.exe data=\\helium\rangerprint\data"

Command.run (prntchar)

 

'---------------------------------------------------------

 

'Remove registry key to keep startmenu alphabetised

 

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

'WshShell.run "%comspec% /c \\argon\netlogon\startmenu.bat",7

'Set WshShell = Nothing

 

'---------------------------------------------------------

 

 

'Add User info into Registry for Office 2007

 

Set ADSysInfo = CreateObject("ADSystemInfo")

Set objUser = GetObject("LDAP://" & ADSysInfo.UserName)

 

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

regpath = "HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\"

UsersName = objUser.givenName & " " & objUser.SN

UsersInitials = Left(objUser.givenName, 1) & Left(objUser.SN, 1)

WshShell.RegWrite regpath & "UserName", UsersName, "REG_SZ"

WshShell.RegWrite regpath & "UserInitials", UsersInitials, "REG_SZ"

 

 

'----------------------------------------------------------

 

WScript.Quit

Posted

You can do all of this from 2008 group policy.

There is a section under User Configuration > Preferences > Windows Settings.

You can add all registry cahnges and map drives there tailored to user groups.

 

As for printers, they can be deployed from the print management option on the print server.

Posted

As for printers, they can be deployed from the print management option on the print server.

 

If you set up printers this way, don't forget to set (under Computer Config>Admin Templates>Printers)

 

When installing drivers for a new connection: Do not show warning or elevation prompt

When updating drivers for an existing connection: Do not show warning or elevation prompt

 

Or your machines will sit there forever.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...