Windows 2003: Logon script on Sysvol

Hi,

Please can someone help me. I am struggling with this below.

I have this script on the C:\WINDOWS\SYSVOL on my Windows 2003 and 2008 Servers.

The script itself is
On Error Resume Next

Set objSysInfo = CreateObject("ADSystemInfo")
Set objNetwork = CreateObject("Wscript.Network")
Set objShell = CreateObject("WScript.Shell")


strUser = objNetwork.UserName

strStatus = strStatus

Select Case UCase(objNetwork.UserDomain)
      Case UCase("go1000")
            strHomeDir = "\\grkfs1\home\" & strUser
            objNetwork.MapNetworkDrive "H:", strHomeDir, True
            objNetwork.MapNetworkDrive "G:", "\\GRKFS1\go1000", True
            objNetwork.AddWindowsPrinterConnection "\\grkfs1\LexmarkC.2"
            objNetwork.AddWindowsPrinterConnection "\\top1\TOSHIBAe"
            objNetwork.AddWindowsPrinterConnection "\\top1\Kyocera Colour"
            objNetwork.AddWindowsPrinterConnection "\\top1\Kyocera BW"
End Select
objShell.RegWrite "HKEY_USERS\.Default\Control Panel\Keyboard\InitialKeyboardIndicators", "2"
objShell.RegWrite "HKEY_CURRENT_USER\Control Panel\Keyboard\InitialKeyboardIndicators", "2"
'#########################3
Function MapDrive(strDrive, strPath, bPersistent)
      If Not objFSO.DriveExists(strDrive) Then
            objNet.MapNetworkDrive strDrive, strPath, bPersistent
      End If
End Function

---------------------------------------------------------------------------------------------------------------------------------------------------------
Some of my client are having issues with it when I look on their computer - event logs this is what I see below.

ERROR
Could not execute the following script {C:\WINDOWS\SYSVOL\sysvol\go1000.local\scripts\new g1000 script.vbs. The system cannot find the file specified.}

Also, I see this {Failed to apply changes to software installation settings.  Software changes could not be applied.  A previous log entry with details should exist.  The error was : There is no software installation data object in the Active Directory}
bkebbayAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mike ThomasConsultantCommented:
Check that the script exists @ \\domain.com\SYSVOL\domain.com\scripts\ and that the clients can see this location

alos in AD for the users ensure that their logon script is just "nameofscript.vbs" no path required.
0
bkebbayAuthor Commented:
your fist question yes the script exits in C:\WINDOWS\SYSVOL\domain\scripts

Your second question I don't understand it clearly how do you do that.

Thanks
0
abhijeet11160Commented:
hi,

how does the .vbs file run,

is it throught logon scrips through group policy or .bat file embedded to user ad profile.

try creating a bat file

\\server\path\*.vbs

click the bat file to find the error locally on system.

does the .vbs file has appropiate rights..??
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

bkebbayAuthor Commented:
The logon script runs through group policy.
0
n0fraggerCommented:
The script tries to find "C:\WINDOWS\SYSVOL\domain\scripts" on your local machine instead of your server.

I think you added the script wrong into de Group Policy, when adding a login script go to the GPMC and go the the policy where you add the login script. There is a butten which is called "Show Files". that is the folder where you should store the vbs script.
0
Mike ThomasConsultantCommented:
Run the policy manually from \\domain.com\SYSVOL\domain.com\scripts\ to prove it is in the correct place and that it works, then set all path references to \\domain.com\SYSVOL\domain.com\scripts\ not C:\WINDOWS\SYSVOL\domain\scripts
0
bkebbayAuthor Commented:
Ok I don't know if I undestand you quite well.

I have looked through group policy and have seen that  under user-configuration - windows settings- script - logon the scipt is there
\\domain.com\SYSVOL\domain.com\scripts\LOGON

and is also in the folders. C:\WINDOWS\SYSVOL\domain\scripts

I have double click the script and is working fine.
0
Mike ThomasConsultantCommented:
but for some reason your clients are seeking it at C:\WINDOWS\SYSVOL\domain\scripts  their pc's appear to be looking at that directly which will be invalid to the local pc

although on the server the locations
C:\WINDOWS\SYSVOL\domain\scripts
\\domain.com\SYSVOL\domain.com\scripts\LOGON
 ar the same, the client can only reference one, that one being \\domain.com\SYSVOL\domain.com\scripts\LOGON

make sense?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
k1ndredxCommented:
You start you script with "On Error Resume Next", because you start the script in this fashion any errors that are encountered are ignored and the script attempts to continue, but eventually fails.

Comment out the line "On Error Resume Next", and run the script locally to see what is actually happening.

If there is an error (which there definitely is), you should see an error dialog and then have more information to be able to troubleshoot the problem.
0
abhijeet11160Commented:
ya there is some issues with your clients those are not getting grouppolicy updates.

run gpresult on clients and check for following errors

   The following GPOs were not applied because they were filtered out
   -------------------------------------------------------------------
       Default Domain Policy
           Filtering:  Not Applied (Unknown Reason)
 
0
bkebbayAuthor Commented:
This is what I got from the result



Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
 
H:\>gpresult
 
Microsoft (R) Windows (R) XP Operating System Group Policy Result tool v2.0
Copyright (C) Microsoft Corp. 1981-2001
 
Created On 31/03/2010 at 16:15:58
 
 
RSOP results for go1000\mlt on GRK69 : Logging Mode
-----------------------------------------------------
 
OS Type:                     Microsoft Windows XP Professional
OS Configuration:            Member Workstation
OS Version:                  5.1.2600
Domain Name:                 go1000
Domain Type:                 Windows 2000
Site Name:                   Default-First-Site-Name
Roaming Profile:
Local Profile:               C:\Documents and Settings\mlt
Connected over a slow link?: No
 
 
COMPUTER SETTINGS
------------------
    CN=GRK69,CN=Computers,DC=go1000,DC=local
    Last time Group Policy was applied: 31/03/2010 at 14:51:14
    Group Policy was applied from:      GRKFS1.go1000.local
    Group Policy slow link threshold:   500 kbps
 
    Applied Group Policy Objects
    -----------------------------
        Default Domain Policy
        WUSU
 
    The following GPOs were not applied because they were filtered out
    -------------------------------------------------------------------
        Local Group Policy
            Filtering:  Not Applied (Empty)
 
    The computer is a part of the following security groups:
    --------------------------------------------------------
        BUILTIN\Administrators
        Everyone
        BUILTIN\Users
        NT AUTHORITY\NETWORK
        NT AUTHORITY\Authenticated Users
        GRK69$
        Domain Computers
        WSUS
 
 
USER SETTINGS
--------------
    CN=Michael Levett,OU=Departmental Heads,DC=go1000,DC=local
    Last time Group Policy was applied: 31/03/2010 at 16:08:22
    Group Policy was applied from:      GRKFS1.go1000.local
    Group Policy slow link threshold:   500 kbps
 
    Applied Group Policy Objects
    -----------------------------
        Default Domain Policy
        Deparmental Heads
        WUSU
 
    The following GPOs were not applied because they were filtered out
    -------------------------------------------------------------------
        Local Group Policy
            Filtering:  Not Applied (Empty)
 
    The user is a part of the following security groups:
    ----------------------------------------------------
        Domain Users
        Everyone
        BUILTIN\Users
        NT AUTHORITY\INTERACTIVE
        NT AUTHORITY\Authenticated Users
        LOCAL
        grk_access_RW
        go1000_forward features(R&W)
        Webmarshal
        grk_marketing_RW
        grk_GPR Jobs_RW
        grk_NewsTeams_RW
        gorkanaPr
        grk_Products_Read Only
        grk_GPR Financial_RW
        grk_GPR Consumer_Read Only
        grk_Accounts Management_Read Only
        grk_GPR Consumer_RW
        grk_events_RW
        grk_Projects_RW
        go1000_FF_Georgie (R&W)
        go1000
        mlt
        go1000Pr
 
H:\>
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows XP

From novice to tech pro — start learning today.