1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Login Script being prevented by software restriction policy! Help plzz

Discussion in 'Networks' started by Jiser, Feb 11, 2008.

  1. Jiser

    Jiser Kilobyte Poster

    386
    10
    37
    Hi all I have a printers vbs script which is being prevented from running. Thing is I have other vbs script which maps network drives which runs fine...

    Also there were no restriction policies anyway, I enabled one and ensured the path of the vbs file was unrestricted and vbs scripts unrestricted to see if it worked. I also made sure I force /gpupdate. No clue at all... Any help would be great.

    Script: \\domain\sysvol\domain\scripts\printers.vbs

    Line: 2
    Char: 1
    Error: Windows cannot open this program because it has been prevented by a software restriction policy. For more information, open event viewer or contact your system administrator.
    code: 80070e4c
    source: (null)
     
    Certifications: BSc (Hons), PGc, MCTS:Win 7, MCSA W7/MCITP EDST, ITIL Foundation, Prince 2 Foundation, C&G: Web Design, MOS 07: Excel, Word, Powerpoint, Outlook.
  2. Fergal1982

    Fergal1982 Petabyte Poster

    4,196
    171
    211
    are you sure the error is being generated by trying to run the script, or by something you are trying to do within the script. Post the script up for us to take a look at, it might provide a better startpoint for us.

    Also, have you tried manually running the script on a machine? rather than using policy to run it. it might give you a more meaningful error, if the script is causing a problem of some sort.
     
    Certifications: ITIL Foundation; MCTS: Visual Studio Team Foundation Server 2010, Administration
    WIP: None at present
  3. Stoney

    Stoney Megabyte Poster

    731
    23
    69
    What machine is trying to execute the script? Server, client...........
     
    Certifications: 25 + 50 metre front crawl
    WIP: MCSA - Exam 70-270
  4. Jiser

    Jiser Kilobyte Poster

    386
    10
    37
    Printers.vbs - Windows Logon Script.
    Set objNetwork = CreateObject("WScript.Network")
    objNetwork.AddWindowsPrinterConnection "\\server\2600n"

    Thats basically the script.
    Client is trying to run script through group policy.

    Ok tried running on client, software restriction policy error again.
     
    Certifications: BSc (Hons), PGc, MCTS:Win 7, MCSA W7/MCITP EDST, ITIL Foundation, Prince 2 Foundation, C&G: Web Design, MOS 07: Excel, Word, Powerpoint, Outlook.
  5. Fergal1982

    Fergal1982 Petabyte Poster

    4,196
    171
    211
    try using this

    Code:
    On Error Resume Next
    Set objNetwork = CreateObject("WScript.Network")
    objNetwork.AddWindowsPrinterConnection "\\server\2600n"
    
    If err.number <> 0 Then
        wscript.echo err.message
    End If
    
    I suspect that it still wont run, but it might give something other than the software restriction error. It looks like the client network has some sort of policy preventing the script from running because its modifying something.

    Could it be that the client has locked down their users so that they are unable to add their own printers? Try to manually add the printer yourself (just enter \\server\2600n into the run command), and see what happens.
     
    Certifications: ITIL Foundation; MCTS: Visual Studio Team Foundation Server 2010, Administration
    WIP: None at present
  6. Jiser

    Jiser Kilobyte Poster

    386
    10
    37
    Hey it worked! :) Thanks

    Ok how do I make a printer default and delete an old printer using the login script?

    Cheers
     
    Certifications: BSc (Hons), PGc, MCTS:Win 7, MCSA W7/MCITP EDST, ITIL Foundation, Prince 2 Foundation, C&G: Web Design, MOS 07: Excel, Word, Powerpoint, Outlook.
  7. Fergal1982

    Fergal1982 Petabyte Poster

    4,196
    171
    211
    I would be careful there. The modification wont necessarily make it work. All it does is skip over any lines that cause an error. I was hoping it would actually provide a meaningful error run it manually, and see what it says.
     
    Certifications: ITIL Foundation; MCTS: Visual Studio Team Foundation Server 2010, Administration
    WIP: None at present
  8. Modey

    Modey Terabyte Poster

    2,397
    99
    154
    There is a utility called con2prt that MS release a while back in a resource pack or something. It will allow you to specify a network printer, set it as the default and clear out existing printers etc...

    You should be able to get it here.

    Stick it in a batch file, or their logon scripts and hopefully it will sort your problem out.
     
    Certifications: A+, N+, MCP, MCDST, MCSA 2K3, MCTS, MOS, MTA, MCT, MCITP:EDST7, MCSA W7, Citrix CCA, ITIL Foundation
    WIP: Nada

Share This Page

Loading...