Startup script trouble with group policy

Discussion in 'Windows Server 2003 / 2008 / 2012 / 2016' started by SimonV, Nov 13, 2003.

  1. SimonV
    Honorary Member

    SimonV Petabyte Poster Gold Member

    6,651
    180
    258
    Was going to post this in the Networking forum but it is 2KServer related.

    Here’s the problem, I have a vbs script that I'm wishing to use on a group of PCs through Group policies. I've applied a Start-up script to the GPO that contains the computer accounts but when they boot I get an error stating that the file could not be found or something like that ( I cant quite remember as it was at work). But the script is in the correct place as I can navigate to the sysvol domain.com\policies\GUID folder through the network and double click it. I've also tried placing the vbs file into a share and using the UNC but get the same results.

    Do I need to include any parameters for the script? All the script is doing is adding a network printer to the group of PC's. This has been doing my head in this afternoon so any help and ideas would be great.

    SimonV
    :D
     
    Last edited: Jan 2, 2015
    Certifications: MOS Master 2003, CompTIA A+, MCSA:M, MCSE
    WIP: Keeping CF Alive...
  2. Phil
    Honorary Member

    Phil Gigabyte Poster

    1,680
    7
    87
    Is the script accessing resources on another machine ? If so, do the machines have the correct permissions to access those resources ?
     
    Certifications: MCSE:M & S MCSA:M CCNA CNA
    WIP: 2003 Upgrade, CCNA Upgrade
  3. AJ

    AJ 01000001 01100100 01101101 01101001 01101110 Administrator

    6,897
    182
    221
    Try puting the startup script in the Netlogon folder. We find that scripts tend to run from there as they are replicated to all DC's

    Andrew
     
    Certifications: MCSE, MCSA (messaging), ITIL Foundation v3
    WIP: Breathing in and out, but not out and in, that's just wrong
  4. SimonV
    Honorary Member

    SimonV Petabyte Poster Gold Member

    6,651
    180
    258
    @ Phil, Yeah it is, but the permissions are correct as I can run the script after loging on the the PC and it works fine???

    @Andrew, the script is in the sysvol\domain.com\policies\GUID etc etc folder and I checked that it had replicated between the DC's.

    I'll try again today when I get to work. Cheers.

    Si
    :D
     
    Certifications: MOS Master 2003, CompTIA A+, MCSA:M, MCSE
    WIP: Keeping CF Alive...
  5. Phil
    Honorary Member

    Phil Gigabyte Poster

    1,680
    7
    87
    When you log on and run the script it is using the logged on users credentials, on startup it has to use the computer account. If the computer account doesn't have permissions to the resources then it isn't going to be able to run. I had similar problems recently when I wrote a script to drag an update from a server when the PC's rebooted.
     
    Certifications: MCSE:M & S MCSA:M CCNA CNA
    WIP: 2003 Upgrade, CCNA Upgrade
  6. SimonV
    Honorary Member

    SimonV Petabyte Poster Gold Member

    6,651
    180
    258
    I'm sure I've added the permisions for the computer account but I'm not at work yet so cant check. I'll post later when I get infront of the PC. You never know Phil you might be onto something, it was a long day yesterday I could have added the wrong computer account!! :roll:


    Si
     
    Certifications: MOS Master 2003, CompTIA A+, MCSA:M, MCSE
    WIP: Keeping CF Alive...
  7. SimonV
    Honorary Member

    SimonV Petabyte Poster Gold Member

    6,651
    180
    258
    The exact error I'm getting is:

    [code:1:050e2c256f]Script:
    \\itsuite\sysvol\itsuite\policies\{623a642c-db6c-4345-91ae-2b26631f7aac}\machine\scripts\startup\printer.vbs
    Line: 4
    Char: 1
    Error: The system could not find the file specified

    Code: 80070002
    Source: (null)[/code:1:050e2c256f]

    itsuite being the domain. The script is connecting the client to a shared printer on another client. Does this need to be run after the startup event, say in a login event?

    does the computer account need to be in a certain group to execute the script?

    HELP ME!!!!!!!
    :hang
     
    Certifications: MOS Master 2003, CompTIA A+, MCSA:M, MCSE
    WIP: Keeping CF Alive...
  8. AJ

    AJ 01000001 01100100 01101101 01101001 01101110 Administrator

    6,897
    182
    221
    Sorry Si but I might sound a bit thick here. Why do you want to run a script to attatch to a shared printer? :? Surely if that is all you want to do then just add another port on the printer properties pointing on the remote computer pointing at the shared printer.

    Andrew
     
    Certifications: MCSE, MCSA (messaging), ITIL Foundation v3
    WIP: Breathing in and out, but not out and in, that's just wrong
  9. Phil
    Honorary Member

    Phil Gigabyte Poster

    1,680
    7
    87
    Si, can you post your script?
     
    Certifications: MCSE:M & S MCSA:M CCNA CNA
    WIP: 2003 Upgrade, CCNA Upgrade
  10. SimonV
    Honorary Member

    SimonV Petabyte Poster Gold Member

    6,651
    180
    258
    Here goes Phil:

    [code:1:019cc178e0]Set WshNetwork = CreateObject("WScript.Network")
    PrinterPath = "\\itdept\canons20"
    PrinterDriver = "Test Printer"
    WshNetwork.AddWindowsPrinterConnection PrinterPath, PrinterDriver
    WshNetwork.SetDefaultPrinter "\\itdept\canons20"[/code:1:019cc178e0]
     
    Certifications: MOS Master 2003, CompTIA A+, MCSA:M, MCSE
    WIP: Keeping CF Alive...
  11. Phil
    Honorary Member

    Phil Gigabyte Poster

    1,680
    7
    87
    Have you tried taking it out of the startup script and putting it in the logins cript?
     
    Certifications: MCSE:M & S MCSA:M CCNA CNA
    WIP: 2003 Upgrade, CCNA Upgrade
  12. SimonV
    Honorary Member

    SimonV Petabyte Poster Gold Member

    6,651
    180
    258
    No it might be me thats a bit of a thicko here, explain in simple Andrew

    Not yet, I tried using a batch file that called the vbs file but got the same error. I'll give it a go later as I've got called to somthing else now.

    Cheers, Si
     
    Certifications: MOS Master 2003, CompTIA A+, MCSA:M, MCSE
    WIP: Keeping CF Alive...
  13. AJ

    AJ 01000001 01100100 01101101 01101001 01101110 Administrator

    6,897
    182
    221
    I take it that it is either NT, W2K or an XP domain or workgroup. The printer is installed locally on a machine fairly close to the other computer that wants to print to it and it is shared. On the second machine, using either Network Neighbourhood or navigate via the URL (eg \\computer_name\Printer_share_name) and then right click on the printer and select connect. Voila, printer drivers automatically download and printer port installed. So long as the computer with the printer attached is switched on then you can print away. the connection should be there all the time the machines are switched on. In fact the first pc dosen't even have to be logged in, just on.

    HTH

    Andrew
     
    Certifications: MCSE, MCSA (messaging), ITIL Foundation v3
    WIP: Breathing in and out, but not out and in, that's just wrong
  14. SimonV
    Honorary Member

    SimonV Petabyte Poster Gold Member

    6,651
    180
    258
    Now I get you, yes its a W2K domain and the users will be using different PC's throughout the building more than one user will use the same PC in this group of PC's. That would mean that I would have to install the printer everytime a new user logs on.

    I'm totaly confused now as I've got so many jobs to do and the other tech here is as much use as a chocolate teapot. :twisted:

    My head hurts today, boy do I need a drink. :silly
     
    Certifications: MOS Master 2003, CompTIA A+, MCSA:M, MCSE
    WIP: Keeping CF Alive...
  15. AJ

    AJ 01000001 01100100 01101101 01101001 01101110 Administrator

    6,897
    182
    221
    DON'T PANIC :eek:

    Install the driver locally on each machine and it will be there for any user.

    I wonder if you can use a group to do this for you. Make a new group called say use_shared_printer and add to the group all of the users that need access to that printer and then on the security page of the printer properties add the group and remove everyone. This, however will not get around the fact that each machine needs the printer drivers loaded onto them. Something for the chocolate teapot perhaps :roll:

    Andrew
     
    Certifications: MCSE, MCSA (messaging), ITIL Foundation v3
    WIP: Breathing in and out, but not out and in, that's just wrong
  16. Phil
    Honorary Member

    Phil Gigabyte Poster

    1,680
    7
    87
    Manually installing the drivers on each PC defeats on of the godsends of having a windows 2000 network, i.e. having drivers download from the print server with no intervention from the admin required.

    All you need to do is install the print driver on one server / PC then share it. Your script will work, I have exactly the same configured in Group Policy for 20- 30 print queues on one server. If you set the script up in a login script, add the PC's you want to get this printer into a group and set the security for the GPO to execute for the security group you just created.

    The next time a user logs on to that PC the printer will be connected and be the default. The way we have them set up is based on the user not PC. But I guess yours will be for classroom PC's so you'll get a lot of people sat at the same PC's.
     
    Certifications: MCSE:M & S MCSA:M CCNA CNA
    WIP: 2003 Upgrade, CCNA Upgrade
  17. AJ

    AJ 01000001 01100100 01101101 01101001 01101110 Administrator

    6,897
    182
    221
    Ok Phil I agree that it would work it that scenario, but as you mentioned in a school it is different. You get users (pupils) moving around the school from classroom to classroom doing different subjects. In an ideal world the kids would use the same printers through out the whole school. Now back from the land of dreams, it ain't like that. Different Dept. have different printers in different classrooms. So the machines in the classrooms have got to have drivers for the local printers even if they are networked rather than a local shared printer. Therefore the classroom printer have got to be loaded to the classroom machines and nowhere else, so the driver is for the machine not the user.

    Does that make sence?????????? :? :?

    Andrew
     
    Certifications: MCSE, MCSA (messaging), ITIL Foundation v3
    WIP: Breathing in and out, but not out and in, that's just wrong
  18. AJ

    AJ 01000001 01100100 01101101 01101001 01101110 Administrator

    6,897
    182
    221
    Sorry Phil, I didn't mean the post to sound the way it was. I thought the as Si worked within an educational environment, as do I, that this was the way that the post was to be answered. :oops:

    No offence mate

    Andrew
     
    Certifications: MCSE, MCSA (messaging), ITIL Foundation v3
    WIP: Breathing in and out, but not out and in, that's just wrong
  19. SimonV
    Honorary Member

    SimonV Petabyte Poster Gold Member

    6,651
    180
    258
    K, Andrew your spot on, Phils a big boy he won't take it the wrong way. :cry:

    On a serious note I tried to do this but it didnt work. I set up the shared printer then loaded the drivers onto another PC as local admin. Logged out then back in with a domain account but the printer wasnt there. (could this be that I'd already logged into this PC previously so the printer didnt get carried into the profile?)

    What am I doing wrong here. Boy have I had a hard day. My head is totally confused on this, I cant remember when I've done this before how I did it. Well as its the weekend I wont get to do this till monday anyway.

    :kar
     
    Certifications: MOS Master 2003, CompTIA A+, MCSA:M, MCSE
    WIP: Keeping CF Alive...
  20. AJ

    AJ 01000001 01100100 01101101 01101001 01101110 Administrator

    6,897
    182
    221
    I'm sure Phil is a big boy, but we have never met!!

    When you install the printer on the remote machine is there not an option to install a network printer? I think if you select this and then browse for the actual machine it should make the port for you.

    Unfortunately as our school is, so to speak "in session" on Saturday mornings I shall have to be at work. If I get the chance I shall test this out on the test network.

    Cheers All

    Andrew
     
    Certifications: MCSE, MCSA (messaging), ITIL Foundation v3
    WIP: Breathing in and out, but not out and in, that's just wrong

Share This Page

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.