Jump to content

Recommended Posts

Posted

Hello,

 

I have this problem of not running logon scripts, I have come up with the problem being that to many people log on at one time causesing it to get skipped, how can I stop this? I am wanting it to only be on the one server, so all users can access it and if it needs to get updated it is easy to do. It seems to only affect the Windows 7 machines. Though sometimes XP machine do it too.

 

I do have this code in it, should I make it so it randomly makes and number between 100 and 200 and then run it?

 

-->

 

'Wait until the user is really logged in

strUserName = ""

While strUserName = ""

WScript.Sleep 100 ' Wait 1 second

strUserName = WSHNetwork.UserName

Wend

 

strUserDomain = WSHNetwork.UserDomain

 

<--

 

Thank you, C3sium

Posted

I think scripting on windows 7 is different because when I have been looking at wmi and other examples on the ms website or else where it states which operating systems support which ever methods you are using, also in the script example I did not see the creation of the network object ie

 

Set WshNetwork = CreateObject("Wscript.Network")

 

Or

 

Set WshNetwork = Wscript.CreateObject("Wscript.Network")

 

Also 1000 ms is one second , not 100 or 200.

 

Other then that I don't have much time to look into it now but will come back to this later unless srochford or someone else can assist you in the mean time.

Posted

Hello,

 

The script runs fine when one at a time, but it is when it runs at the same time... it fails

 

Also I did not write the script, or setup the GP. :)

 

I will have a look at that tomorrow cookie, and report back.

 

C3sium

Posted
Hello,

 

The script runs fine when one at a time, but it is when it runs at the same time... it fails

 

Also I did not write the script, or setup the GP. :)

 

I will have a look at that tomorrow cookie, and report back.

 

C3sium

 

 

 

I've had issues with scripts becoming unreliable when there's load on the servers as well but setting those two settings has always solved the problems.

Posted

Hello,

 

I have found both of those commands in the GP and have enabled both of them.

Looks like I have found a new job, Looking through the GP :( and testing....

 

I will give that a go today, see how they go over the course of the day and report back.

 

Thank you Jamie.

Posted

Hello,

 

After a few periods of testing, it has reduced the number of computers affected but not completly.

Any more ideas?

 

Thank you, C3sium

Posted

Hello,

We have 2 domain controllers, and they mirror each other.

Anyone got any ideas?? I had to run the script 10 times last period, very over it!

C3sium

Posted
Hello,

 

After a few periods of testing, it has reduced the number of computers affected but not completly.

Any more ideas?

 

Thank you, C3sium

 

 

 

As the others say check that your scripts are replicating to all of the netlogon folders.

 

Can you clear the event log on an affected client then reboot it and check the event log again. Post any errors.

 

It might be worth posting the script as well, what is it doing, drive mapping etc?

 

 

You said it's affecting Windows 7 and XP boxes right?

Posted (edited)
And the scripts are running from the netlogon share, and not a shared folder, yes?

 

The scripts are running from \\mserver\NETLOGON which is shared and student can access this folder and contents(more than likly they can change it too).

 

mac_shinobi;

maybe way off the mark here so apologies in advance but if you did a gpupdate on both servers and then did a force replication and then tried again would that help ?

 

Can you post help on this topic to make sure I do it correctly.

 

cookie_monster

 

As the others say check that your scripts are replicating to all of the netlogon folders.

 

Can you clear the event log on an affected client then reboot it and check the event log again. Post any errors.

 

It might be worth posting the script as well, what is it doing, drive mapping etc?

 

 

You said it's affecting Windows 7 and XP boxes right?

 

When I compare the scripts they are the same, from the two servers.

I will try to post the script and check the logs in the morning, at the moment it is 8:30pm here.

the script remove drives then map the drives and maps printers and set default printer.

Yes Windows 7 desktop(dell 780) and laptops(thinkpad r500) and some XP desktops.

 

If you have any more ideas let me know.

 

Thank you, C3sium.

Edited by C3sium
Posted

Can you post help on this topic to make sure I do it correctly.

 

Thank you, C3sium.

 

How do I force replication between two domain controllers in a site?

 

As per here go into the sites and services MMC and when you right click on the server ensure that you are selecting the correct option as there are other options in the popup / context menu

 

with ref to doing a gpupdate its just a case of going to

 

start --> run --> cmd {Press Enter} or {click on the ok button}

 

in the command prompt window type

 

gpupdate {press enter}

Posted

Hello,

 

mac_shinobi, I have tired those commands this morning and it still failed.

I have no idea what to do....

 

Here is the script some one asked for..

'******************************************************************************

'* Login Script - School *

'* -------------------------------------------------------------------------- *

'* Written by: Solutions *

'* Modified on: Tuesday, 29th September 2009 *

'* -------------------------------------------------------------------------- *

'* If any changes are to be made to this script, please notify Solutions. *

'******************************************************************************

 

Option Explicit ' Force explicit declarations

On Error Resume next

 

' Variables

Dim WSHNetwork ' Network object

Dim strUserName ' Current user

Dim strUserDomain ' Current domain name

Dim ObjGroupDict ' Dictionary of groups to which the user belongs

 

' Setup variables for Server Names. Part of DRP, can change login script server references via these variables.

Dim strServerOne 'Variable for Server

Dim strServerTwo 'Variable for Server

Dim strServerThree 'Variable for Server

 

' Define Server Names

strServerOne = "\\mserver\"

strServerTwo = "\\pcs\"

strServerThree = "\\proxy\"

 

Set WSHNetwork = WScript.CreateObject("WScript.Network")

 

'Wait until the user is really logged in

strUserName = ""

While strUserName = ""

WScript.Sleep 100 ' Wait 1 second

strUserName = WSHNetwork.UserName

Wend

 

strUserDomain = WSHNetwork.UserDomain

 

'***************************************************************

' Remove Printers

' These printers are mapped below for Admin & other Staff only

'***************************************************************

'WSHNetwork.RemovePrinterConnection strServerOne & "ADMINB&W"

'WSHNetwork.RemovePrinterConnection strServerOne & "ADMINColour"

'WSHNetwork.RemovePrinterConnection strServerOne & "Staffroom copier"

 

'**********************************************************************

' Map Network Printers

' These are classroom/library printers, so can be mapped for everyone

'**********************************************************************

WSHNetwork.AddWindowsPrinterConnection strServerOne & "KMARTSB&W"

WSHNetwork.AddWindowsPrinterConnection strServerOne & "KMARTSColour"

WSHNetwork.AddWindowsPrinterConnection strServerOne & "KMROOM5"

WSHNetwork.AddWindowsPrinterConnection strServerOne & "KMROOM5Colour"

WSHNetwork.AddWindowsPrinterConnection strServerOne & "LaserJet P2015 Library"

WSHNetwork.AddWindowsPrinterConnection strServerOne & "HPROOM4"

 

'**********************************************************

'Group MemberShip, Map Secure Drives & Set Default Printers

'**********************************************************

' Read the user's account "Member Of" tab info across the network once into a dictionary object.

Set ObjGroupDict = CreateMemberOfObject(strUserDomain, strUserName)

 

WSHNetwork.RemoveNetworkDrive "I:", TRUE, TRUE

WSHNetwork.MapNetworkDrive "I:", strServerOne & "apps", TRUE

WSHNetwork.RemoveNetworkDrive "S:", TRUE, TRUE

WSHNetwork.MapNetworkDrive "S:", strServerThree & "common", TRUE

 

'Staff

If MemberOf(ObjGroupDict, "Staff") Then

'Network Drives

WSHNetwork.RemoveNetworkDrive "H:", TRUE, TRUE

WSHNetwork.MapNetworkDrive "H:", strServerThree & WSHNetwork.UserName & "$", TRUE

WSHNetwork.RemoveNetworkDrive "M:", TRUE, TRUE

WSHNetwork.MapNetworkDrive "M:", strServerOne & "StaffShared", TRUE

WSHNetwork.RemoveNetworkDrive "O:", TRUE, TRUE

WSHNetwork.MapNetworkDrive "O:", strServerThree & "Students$", TRUE

WSHNetwork.RemoveNetworkDrive "P:", TRUE, TRUE

WSHNetwork.MapNetworkDrive "P:", strServerTwo & "PCSchool", TRUE

'WSHNetwork.RemoveNetworkDrive "J:", TRUE, TRUE

'WSHNetwork.MapNetworkDrive "J:", strServerThree & "Common", TRUE

WSHNetwork.RemoveNetworkDrive "W:", TRUE, TRUE

WSHNetwork.MapNetworkDrive "W:", strServerThree & "GroupWork$", TRUE

 

'Staffroom Printer

WSHNetwork.AddWindowsPrinterConnection strServerOne & "Staffroom copier"

WSHNetwork.AddWindowsPrinterConnection strServerOne & "ADMINB&W"

WSHNetwork.AddWindowsPrinterConnection strServerOne & "ADMINColour"

 

'Set Default Printer to the staffroom copier

WSHNetwork.SetDefaultPrinter strServerOne & "Staffroom copier"

 

End If

 

'Students

If MemberOf(ObjGroupDict, "Students") Then

Dim objADSysInfo

Set objADSysInfo = CreateObject("ADSystemInfo")

Dim arrPath

arrPath = Split(objADSysInfo.UserName, ",")

Dim intLength

intLength = Len(arrPath(1))

Dim intNameLength

intNameLength = intLength - 3

Dim strClass

strClass = Right(arrPath(1), intNameLength)

 

WSHNetwork.RemoveNetworkDrive "H:", TRUE, TRUE

WSHNetwork.MapNetworkDrive "H:", strServerThree & "Students$\" & strClass & "\" & WSHNetwork.UserName, TRUE

 

'Set Default printer to Room 5

WSHNetwork.SetDefaultPrinter strServerOne & "KMROOM5"

End If

If MemberOf(ObjGroupDict, "StudentGroupWork") Then

WSHNetwork.RemoveNetworkDrive "W:", TRUE, TRUE

WSHNetwork.MapNetworkDrive "W:", strServerThree & "GroupWork$", TRUE

End If

 

'Admin

If MemberOf(ObjGroupDict, "Admin") Then

'Network Drives

WSHNetwork.RemoveNetworkDrive "H:", TRUE, TRUE

WSHNetwork.MapNetworkDrive "H:", strServerThree & WSHNetwork.UserName & "$", TRUE

WSHNetwork.RemoveNetworkDrive "M:", TRUE, TRUE

WSHNetwork.MapNetworkDrive "M:", strServerOne & "StaffShared", TRUE

WSHNetwork.RemoveNetworkDrive "Q:", TRUE, TRUE

WSHNetwork.MapNetworkDrive "Q:", strServerThree & "PhotosArchive$", TRUE

 

'Admin Printers

WSHNetwork.AddWindowsPrinterConnection strServerOne & "ADMINB&W"

WSHNetwork.AddWindowsPrinterConnection strServerOne & "ADMINColour"

 

'Set Default printer to Admin B&W

WSHNetwork.SetDefaultPrinter strServerOne & "ADMINB&W"

End If

 

'Finance

If MemberOf(ObjGroupDict, "Finance") Then

'Network Drives

WSHNetwork.RemoveNetworkDrive "H:", TRUE, TRUE

WSHNetwork.MapNetworkDrive "H:", strServerThree & WSHNetwork.UserName & "$", TRUE

WSHNetwork.RemoveNetworkDrive "M:", TRUE, TRUE

WSHNetwork.MapNetworkDrive "M:", strServerOne & "StaffShared", TRUE

WSHNetwork.RemoveNetworkDrive "Q:", TRUE, TRUE

WSHNetwork.MapNetworkDrive "Q:", strServerThree & "PhotosArchive$", TRUE

 

'Admin Printers

WSHNetwork.AddWindowsPrinterConnection strServerOne & "ADMINB&W"

WSHNetwork.AddWindowsPrinterConnection strServerOne & "ADMINColour"

 

'Set Default printer to Admin B&W

'WSHNetwork.SetDefaultPrinter strServerOne & "ADMINB&W"

End If

 

'Assistants

If MemberOf(ObjGroupDict, "Assistants") Then

'Network Drives

WSHNetwork.RemoveNetworkDrive "H:", TRUE, TRUE

WSHNetwork.MapNetworkDrive "H:", strServerThree & WSHNetwork.UserName & "$", TRUE

WSHNetwork.RemoveNetworkDrive "M:", TRUE, TRUE

WSHNetwork.MapNetworkDrive "M:", strServerOne & "StaffShared", TRUE

WSHNetwork.RemoveNetworkDrive "O:", TRUE, TRUE

WSHNetwork.MapNetworkDrive "O:", strServerThree & "Students$", TRUE

WSHNetwork.RemoveNetworkDrive "P:", TRUE, TRUE

WSHNetwork.MapNetworkDrive "P:", strServerTwo & "PCSchool", TRUE

WSHNetwork.RemoveNetworkDrive "J:", TRUE, TRUE

WSHNetwork.MapNetworkDrive "J:", strServerThree & "Common", TRUE

WSHNetwork.RemoveNetworkDrive "W:", TRUE, TRUE

WSHNetwork.MapNetworkDrive "W:", strServerThree & "GroupWork$", TRUE

 

'Staffroom Printer

WSHNetwork.AddWindowsPrinterConnection strServerOne & "Staffroom copier"

WSHNetwork.AddWindowsPrinterConnection strServerOne & "ADMINB&W"

WSHNetwork.AddWindowsPrinterConnection strServerOne & "ADMINColour"

 

'Set Default printer to Admin B&W

'WSHNetwork.SetDefaultPrinter strServerOne & "ADMINB&W"

End If

 

'**********************************************************

' Utility Functions

'**********************************************************

Function MemberOf(ObjDict, strKey)

MemberOf = CBool(ObjGroupDict.Exists(strKey))

End Function

 

Function CreateMemberOfObject(strDomain, strUserName)

Dim objUser, objGroup

Set CreateMemberOfObject = CreateObject("Scripting.Dictionary")

CreateMemberOfObject.CompareMode = vbTextCompare

Set objUser = GetObject("WinNT://" & strDomain & "/" & strUserName & ",user")

For Each objGroup In objUser.Groups

CreateMemberOfObject.Add objGroup.Name, "-"

Next

Set objUser = Nothing

End Function

Posted

Hello,

 

I have found a work around for the moment

It is to add the script to run at login int the reg under 'Local machine' 'Run'

But the user still have to press 'Open' to run it. Anyone know a way around this?

 

Thank you, C3sium.

Posted

Did you get around to clearing the log on client then booting and logging into it? I think you'll find some errors in there post them if you can.

 

Also it might be worth checking the server event logs for DNS errors and running NetDiag and DCDiag.

 

NetDiag Tutorial. Check Server Network Connections. Free Download Support tool

 

DCDiag Tutorial Examples. Check your Windows Active Directory (+ Free Download)

Posted

Hello,

I am back to this job now.

 

Here is an event log in which occurs

 

Log Name: System

Source: Microsoft-Windows-GroupPolicy

Date: 4/03/2010 11:09:44 AM

Event ID: 1058

Task Category: None

Level: Error

Keywords:

User: FAGS\afruewirth

Computer: LAB313.mags.local

Description:

The processing of Group Policy failed. Windows attempted to read the file \\fags.local\SysVol\fags.local\Policies\{7471E73B-CE2A-4F41-A9F5-EB161797191B}\gpt.ini from a domain controller and was not successful. Group Policy settings may not be applied until this event is resolved. This issue may be transient and could be caused by one or more of the following:

a) Name Resolution/Network Connectivity to the current domain controller.

b) File Replication Service Latency (a file created on another domain controller has not replicated to the current domain controller).

c) The Distributed File System (DFS) client has been disabled.

Event Xml:

1058

0

2

0

1

0x8000000000000000

11338

System

LAB313.fags.local

4

816

2

3089

64

The specified network name is no longer available.

\\bdc.fags.local

CN={7471E73B-CE2A-4F41-A9F5-EB161797191B},CN=Policies,CN=System,DC=mags,DC=local

\\fags.local\SysVol\fags.local\Policies\{7471E73B-CE2A-4F41-A9F5-EB161797191B}\gpt.ini

 

Thank you, C3sium

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...