+ Post New Thread
Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20
Windows 7 Thread, Not running scripts in Technical; Originally Posted by C3sium Can you post help on this topic to make sure I do it correctly. Thank you, ...
  1. #16

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,218
    Thank Post
    2,769
    Thanked 935 Times in 875 Posts
    Rep Power
    343
    Quote Originally Posted by C3sium View Post
    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}

  2. #17

    Join Date
    Feb 2010
    Location
    Australia
    Posts
    26
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    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

  3. #18

    Join Date
    Feb 2010
    Location
    Australia
    Posts
    26
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    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.

  4. #19
    cookie_monster's Avatar
    Join Date
    May 2007
    Location
    Derbyshire
    Posts
    4,185
    Thank Post
    392
    Thanked 278 Times in 239 Posts
    Rep Power
    74
    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)

  5. #20

    Join Date
    Feb 2010
    Location
    Australia
    Posts
    26
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    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:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
    <System>
    <Provider Name="Microsoft-Windows-GroupPolicy" Guid="{AEA1B4FA-97D1-45F2-A64C-4D69FFFD92C9}" />
    <EventID>1058</EventID>
    <Version>0</Version>
    <Level>2</Level>
    <Task>0</Task>
    <Opcode>1</Opcode>
    <Keywords>0x8000000000000000</Keywords>
    <TimeCreated SystemTime="2010-03-04T00:09:44.376244500Z" />
    <EventRecordID>11338</EventRecordID>
    <Correlation ActivityID="{7EF39EB3-26BA-4F02-8222-B59484474CFD}" />
    <Execution ProcessID="880" ThreadID="3684" />
    <Channel>System</Channel>
    <Computer>LAB313.fags.local</Computer>
    <Security UserID="S-1-5-21-2605365618-1002651659-3317245403-4107" />
    </System>
    <EventData>
    <Data Name="SupportInfo1">4</Data>
    <Data Name="SupportInfo2">816</Data>
    <Data Name="ProcessingMode">2</Data>
    <Data Name="ProcessingTimeInMilliseconds">3089</Data>
    <Data Name="ErrorCode">64</Data>
    <Data Name="ErrorDescription">The specified network name is no longer available. </Data>
    <Data Name="DCName">\\bdc.fags.local</Data>
    <Data Name="GPOCNName">CN={7471E73B-CE2A-4F41-A9F5-EB161797191B},CN=Policies,CN=System,DC=mags,DC=loc al</Data>
    <Data Name="FilePath">\\fags.local\SysVol\fags.local\Pol icies\{7471E73B-CE2A-4F41-A9F5-EB161797191B}\gpt.ini</Data>
    </EventData>
    </Event>
    Thank you, C3sium

SHARE:
+ Post New Thread
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 0
    Last Post: 23rd September 2009, 01:06 PM
  2. Workstations not running Group Policies or Logon Scripts
    By richard_s in forum Windows Server 2000/2003
    Replies: 18
    Last Post: 6th August 2009, 11:46 AM
  3. Help running scripts within scripts
    By SimpleSi in forum *nix
    Replies: 7
    Last Post: 7th March 2008, 09:23 AM
  4. Vista isn't running logon scripts
    By woody in forum Windows Vista
    Replies: 6
    Last Post: 30th January 2007, 03:32 PM
  5. Scripts, Scripts, Scripts
    By wesleyw in forum Windows
    Replies: 18
    Last Post: 17th July 2006, 02:36 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •