Group Policy - Computer Startup Scripts - Add/Set Default printer

Good Morning.
Let's say we have 2 offices, A and B, and only 1 user.  The user is using Roaming Profiles.  Each office has its own printer.
What I am trying to do, is make a Startup script that is specific to the COMPUTER being logged into so when any user logs into that computer, they get the printer in that office defined and set as default.
I am able to do this successfully with my script but ONLY if i have the script be on the USER side of GP (i.e. in the Logon script section)
That is great that that is working however, when my user goes to Office B, they still get mapped to Office A's printer if I use that method.
So I figured I could just modify my GP and run the same script from the STARTUP section of the computer, rather than the LOGON section of the user.  It does not work.
Here is my script:
Set WRFCUNetwork = CreateObject("Wscript.Network")
PrinterPath = "\\fileserver\MAINTELLER"
PrinterDriver = "PrinterDriver"
WRFCUNetwork.AddWindowsPrinterConnection PrinterPath, PrinterDriver
WRFCUNetwork.SetDefaultPrinter "\\fileserver\MAINTELLER"
This is where I Have the script placed:
     Computer Configuration -> Windows Settings -> Scripts(Startup/Shutdown)
Once i'm in there, I double click Startup, click Add, and select my script which is named:
     MainPrinterSetup.vbs
I have this GP applied to ONE OU, and that OU has ONE computer in it (my test computer)
I login with a brand new user called "testuser" (creative, huh?) and basically nothing happens
except they log in and have some Microsoft Document Image Writer printer set as default (which by the way sure does slow the PC down to the point of it almost being broke if anyone actually tries to print to that by accident)
No Main Teller Printer, no anything.
The strangest part about this is, if i apply this script to the user LOGON scripts, it works fine, the printer is there, and is set as default. (but see above why that wont work for my situation)
So obviously the script works fine, but I guess i'm missing something when it comes to applying GP's to Computers rather than Users.
Can anyone shed some light as to why the script is not running (i'm guessing the script isn't even attempting to run, rather than failing, but i have no way to know that)
Thank you in advance!!
Derek Conlon
Network Administrator
WRFCU
EDIT:  Here are the PC's info that i'm working on:
     Server:  Windows Server 2003 Standard Edition (where my GP's are created and managed with AD)
     Target PC:  Windows XP Professional SP3
EDIT #2:  I manually navigated to the Script file after logging in and "opened" it and it added and set the default printer no problem.  the issue is definately with the script running at startup.

I wanted to clarify a few things:
1. While it is true that printer connections are usually per user, it is definitely possible to create "global printers".  There are a number of ways to do this, but two methods that come to mind are using:
a. "Rundll32 printui.dll,PrintUIEntry" option with the "/ga" switch.  The "/ga" switch is the key here since it allows you to deploy printers "per machine" instead of "per user".  More information
about this is available at:
http://members.shaw.ca/bsanders/NetPrinterAllUsers.htm
http://technet.microsoft.com/en-us/library/ee624057%28WS.10%29.aspx
http://www.computerperformance.co.uk/Logon/logon_printer_computer.htm
http://www.robvanderwoude.com/2kprintcontrol.php
b. The Print Management console that is available in Windows 2003 R2 and higher can help you deploy printers "per machine" in addition to "per user".  More information about this is available at:
http://www.czsolution.com/print-management/print-management/print-management-console.htm#DeployingPrintersByGroupPolicy
http://technet.microsoft.com/en-us/library/cc753109%28WS.10%29.aspx
2. As Guy mentioned, Group Policy Preferences can help set the default printer.  But there is another way to accomplish this.  The problem with the computer startup portion is that it runs before the user logs in.  And applying this script
in the login script section would not work per computer unless you used loopback processing.  So another way to do this is to place a script that sets the default printer into the "All Users" startup folder.  Items in the "All Users"
startup folder run for any user that logs into the computer, but it runs in the user's context.  So, this script would effectively set the default printer on a "per machine" basis.  The script method is a cruder way to approach the problem,
but it will help get the job done.  Here are some resources on setting the default printer via script:
http://www.intelliadmin.com/index.php/2007/08/set-default-printer-from-a-script
http://www.computerperformance.co.uk/ezine/ezine17.htm

Similar Messages

  • CC startup script to set Preference "Default Composer"?

    I have a startup script that I wrote for CS3 that controls about 20 preferences.
    One of the preferences was for Composer, which was by: app.textDefaults.composer = "Adobe Single-line Composer"
    This script has worked for CS 3, 5, 5.5, and 6 (we skipped 4)
    We're moving to CC and my script still works, but I see a new preference at Preferences > Advanced Type for "Default Composer"
    I get lost in ExtendScript's Object Model Viewer, so would someone be kind enough to tell me what to add to my startup script to set the Default Composer to Adobe Single-line Composer
    Thanks for your time
    Tom

    It seems to be related to app.textDefaults, but it seems to me that it's broken...

  • Office 2010 setup thru computer startup script

    I am trying to install Office 2010 (sp2 seperate in the updates folder) thru group policy startup script and configured with OCT .msp file. Also try to start Access Runtime 2010 with SP2 update in the updates folder.
    In group policy set run scripts asynchronisely disabled and run scripts visible enabled otherwise i could not see what the system was doiing also not when configiguring OCT with full display. The gpo settings lets the screens show during install so the user
    can see what happens.
    There is another problem that rises however: I have made 2 batchfiles and both are starting as a computer startup script in seperate gpo's (that is in another post). First the Accessruntime is installing, after that Office 2010 is running. Both are installed
    after login but only one of the 2 have SP2 installed (7015) in this case Accessruntime has it. When i run only the Office 2010 install and not the Accesruntime 2010 then Office 2010 standard has also SP2 installed (version 7015). When running both only Runtime
    has this sp2 and Office has 4763 this is without sp2 i believe.
    In both folders (Office en Runtime) are the update files .msp in the updates folder of the installation, so thats ok.
    Why is only 1 of the 2 installing the SP2 when running both?
    A second thing is when restarting the system and before the login screen appears a message: Upgradepatch cannot be installed by Windows installer becasue the upgraded program does not excist of the upgradepatch is not suitable for this program?
    Here is part of the batchfile:
    IF EXIST "c:\program files\Microsoft Office\Office14\WINWORD.EXE" (goto mkfile) ELSE (goto DeployOffice)
    :mkfile
    ECHO Office 2010 is reeds geinstalleerd>c:\temp\office.txt
    goto end
    :DeployOffice
    call cscript \\sharename\office2010\Offscrub03.vbs ALL /bypass 1 /q /s /NoCancel
    start /wait %DeployServer%\setup.exe /adminfile %DeployServer%\officeconfig.msp
    echo %date% %time% Setup ended with error code %errorlevel%. >> %LogLocation%\%computername%.txt
    Another batchfile
    start \\sharename\accessruntime2010\setup.exe /config \\share\accessruntime2010\config.xml
    REM echo %date% %time% Setup ended with error code %errorlevel%. >> %LogLocation%\%computername%.txt
    freddie
    after installing both runtime and office both have SP2 in updates folder:
    runtime 4763
    Office 2010: 7015
    So in this example runtme is installed without the SP2. installing runtime alone gives with SP2...
    The message is gone. There was a other policy inherited from above that caused the message. The only problem now is that when installing both, runtime 2010 with SP2 files and Office 2010 with SP2 files, then one of the two don't get the Sp2 installed, why
    is that?

    > In the bat file, I have a line that records if the install completes
    > successfully or failed.  I don't have any other logging in my
    > script.  Are you referring to something like GPO logging? I know that
    > the script runs because when I am looking at one of the PCs, I can
    So it is NOT GP related but rather your script fails?!? Put some "echo
    %~n0 %date% %time%>>Log-File-Of-Your-Choice.txt" in it to check what's
    going on. And put ">>Log-File-Of-Your-Choice.txt 2>&1" at the end of
    critical commands to capture their output.
    > I ran the gpresult /h command which shows all User Configuration
    > policies, but NOTHING appears under the Computer Configuration section.
    Admin commandline? If not, you don't see computer settings :)
    Martin
    Mal ein
    GUTES Buch über GPOs lesen?
    NO THEY ARE NOT EVIL, if you know what you are doing:
    Good or bad GPOs?
    And if IT bothers me - coke bottle design refreshment :))
    Martin,
    I still did not figure out why the installation script did not work for some of the PCs, even though the PCs have the same image.  For the ones that don't work, I will install manually.  Can you please look at the screenshots of the GPO
    settings I am using, and let me know if there is any settings that I need to remove or add?
      Thanks

  • Gpo computer startup scripts not running

    Hi,
    I´m making some test with a windows 7 pro 64 bit computer and a 2008 r2 domain controller where I have created a computer startup script. I give you more info:
    Domain functional level: 2008 R2
    DC: 2008 R2
    Client: Windows 7 pro x64
    Gpo: Computer configuration -> Windows configuration -> Script -> Startup
    Type of script: bat file copied on \\domain_name\SysVol\domain_name\Policies\{461E688A-E8F8-4C9B-8419-FE83DCDD4C26}\Machine\Scripts\Startup
    The windows 7 machine is full updated, windows firewall disabled, uac disabled, windows defender disabled.
    The bat file works and the gpo is applying, i have seen it via gpresult, another gpo which is in a top level works fine.
    I need some help please, because I don´t know what to try.
    Thanks in advance.

    Hello Egoitz28,
    Do you mean that you add the bat file in the startup group policy and gpresult shows that it is applied, but the bat is not run?
    Please share us the bat file to test.
    Logon/Logoff scripts could only be applied to users, whereas Start-up/Shutdown scripts applies to computers.
    I create a test.bat start %windir%\system32\notepad.exe, and add it to the User Configuration->Policies->windows Settings->Scripts->Logon in the Default domain policy. And it works.
    If I create in the startup policy in Computer configuration, I can see it in the gpresult, but it doesn’t work.
    Please test if the bat works in the Logon policy.
    Best regards,
    Fangzhou CHEN
    Fangzhou CHEN
    TechNet Community Support

  • Set Default Printer based on user setting using Powershell script

    Hi 
    I would like to create a script that runs on user log off and captures the default printer (set manually by the user) and then another script to reapply the settings (saved upon log off) when the user logs back in.
    This is because local printers are set as default printer (PDF Creator Programs) when we all use Network Printers so this means a user has to set default printer to the network printer all the time.
    I have found this script to start with:
    $Printer = Get-WmiObject -namespace root\cimv2 -Query “select * from Win32_Printer Where Default = TRUE” -Impersonation 3 | select name | out-file C:\temp\Printer.txt
    But the out file looks like this:
    name
    \\PrinterserverName\Accounts01
    Which I dont see how it can be used on another script plus there are spaces after\Account01 
    Any Ideas please?
    M
    Maelito

    Hi Maelito,
    According to your description, you want to export the default printer name to text file, then read this printer name from text file and set the default printer via Powershell:
    #save printer name to text file
    Get-WmiObject -namespace root\cimv2 -Query “select * from Win32_Printer Where Default = TRUE” -Impersonation 3 | select -ExpandProperty name | out-file C:\temp\Printer.txt
    # read printer name from text file and set default printer
    $name=get-content C:\temp\Printer.txt
    (Get-WmiObject -Class Win32_Printer -Filter "Name='$name'").SetDefaultPrinter()
    If there is anything else regarding this issue, please feel free to post back.
    Best Regards,
    Anna Wang
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Script to map default printer based on user input

    Hello everyone,
    Complete scripting noob here but I managed to cludge together a vb script (from various sources) that will remove all current printers and then add printers based on group membership.  It can also add a default printer and if they have a local printer
    make that default.  All that works just fine, my problem is that we have very large floors with many printer clusters.  Group membership for printers is by floor and I do not have the option to further define this (Also GPO is not an option as getting
    our network group to deploy anything takes years so we need to go this route).
    What I would need is something graphical (like an HTA) that when run it prompts the user to input which floor they are on, then it asks them which of the print clusters (on the floor they specified) is closest to them.  It would then install all the
    printers on the floor and make the default printer one from the print cluster they indicated (unless they have a local printer).  I hope this make sense. 
    I think I have most of the pieces laid out but I don't know how to get the user prompts/GUI and then perform the correct mappings.  Thank you in advanced!

    I agree with Bill. Using the correct method will be best.  You network people will be more than happy to tell you what is set up and how to use it.  You just need to ask your manager to get you in contact with them for a little parley.
    If you are really insisting on a script then look in the repository.  There are dozens of scripts that you can use and modify.
    You should try to see this as a challenge to bring modern technology to your company.  Approaching this kind of thing as a global IT challenge will usually get the attention of IT and they will usually take it seriously.  You will likely learn
    many things about the IT resources your company has.
    ¯\_(ツ)_/¯
    I'm sorry if I wasn't clear but I'm not asking anyone to write the script for me, as I said I have most of the parts working.  My issue is getting the user input and getting the script to take the action I need it to (I can map the printers based on
    AD group membership I really just need to prompt the user to select which one they want as default).  My thoughts were to wrap a GUI around it but it's not needed.
    I agree that GPO is the way to go but in State Government it takes an act of Congress to get anything done in the mean time I'm trying to get things done with the means available to me.

  • Setting default printer with printers deployed via print management

    Would like to set default printer on a windows 7 workstation to a printer deployed through group policy using print management.  However whenever machine reboots the defualt changes to a local printer XPS or something else.
    HOw can I set the default printer to one of the deployed printers?

    Even though this is a "machine" connection, the connection is created in each users security context.  Default printers are tied to user profiles and settings.
    I'm sure what is happening is the connection is getting created after the system sets a default or the network path is not yet available when the default printer is set.
    You can use prnmngr.vbs to get and set the default.  If get returns XPS printer, then set can change to one of the valid connections.
    Alan Morris Windows Printing Team

  • Does using Group Policy Preferences to deploy printers require the print driver to be pre-installed?

    I'm trying to prepare our school system for Windows 7 (we currently use XP).  I would like to use the new Group Policy Preferences method of deploying printers.  I pushed out the XP client side extensions through WSUS.  In my test environment, I added the shared printer in group policy preferences.  My XP machine had the printers show up automatically, but my Windows 7 machine did not.  I realized that I had previously connected a printer of the same type to my XP machine before and the drivers were already installed.  To test this theory, I manually connected the shared printers to the Windows 7 machine, deleted them, then logged off and back on.  Now the printers are showing up from group policy.  My question is does using group policy preferences to deploy printers require the print driver to be pre-installed?  If not, then what am I doing wrong?  If so, is there a way to work around this?  Thanks for your help.
    EDIT:  To clarify, I am using the share method in GPP.  This is the error message I get in the event log:
    The user 'PRINTERNAME' preference item in the 'win7 printer test {946461A1-27F8-406F-A0B3-0A1A05AF34F6}' Group Policy object did not apply because it failed with error code '0x80070bcb The specified printer driver was not found on the system and needs to be downloaded.' This error was suppressed.

    This link have a description of resolution:
    http://technet.microsoft.com/en-us/library/cc725938.aspx
    Open the GPMC.
    Open the GPO where the printer connections are deployed, and navigate to Computer Configuration, Policies, Administrative Templates, Control
    Panel, and thenPrinters.
    Note
    The Point and Print Restrictions setting can also be found under User Configuration\Policies\Administrative Templates\Control Panel\Printers.
    This policy is ignored by Windows 7 and Windows Server 2008 R2, but is enforced by earlier editions of Windows including Windows XP with SP1, Windows Server 2003 with SP1, and Windows Server 2008. We recommend that you change
    this policy setting in both locations so that all down-level clients have a consistent experience.
    Right-click Point and Print Restrictions, and then click Properties.
    Click Enabled.
    Clear the following check boxes:
    Users can only point and print to these servers 
    Users can only point and print to machines in their forest 
    In the When installing drivers for a new connection box, select Do not show warning or elevation prompt.
    Scroll down, and in the When updating drivers for an existing connection box, select Show warning only.
    Click OK.

  • How to set default Print layout in SDK!

    Hi All
    In Form Delivery (ID=140) I want to Add Button to set default print layout by Addon.
    Please let me know the interface and the table to do it. Thanks

    Hi Tao,
    there's a vb6 sample in the DIAPI documentation
    Sets the specified report layout as default
    Dim oCmpSrv As SAPbobsCOM.CompanyService
    Dim oReportLayoutService As ReportLayoutsService
    Dim oDefaultReportParams As DefaultReportParams
    'get company service
    oCmpSrv = oCompany.GetCompanyService
    'get report layout service
    oReportLayoutService = oCmpSrv.GetBusinessService(ServiceTypes.ReportLayoutsService)
    'get report layout params
    oDefaultReportParams = oReportLayoutService.GetDataInterface(ReportLayoutsServiceDataInterfaces.rlsdiDefaultReportParams)
    'set the report layout code
    oDefaultReportParams.LayoutCode = "POR20005"
    'set the report code
    'the report code is the document type code (e.g. POR2=PurchaseOrder)
    oDefaultReportParams.ReportCode = "POR2"
    'set the user code
    oDefaultReportParams.UserID = 1
    'delete the report layout
    oReportLayoutService.SetDefaultReport(oDefaultReportParams)
    i hope it helps you
    regards
    David

  • How to set default print orientation in oracle reports 6i?

    Can anyone please help how to set default print orientation of Oracle Reports 6i? Currently document is printed in Portrait orientation, but I need to print it in Landscape orientation. Is this possible?

    It is solved now. Go to Layout Model -> Main Section, Press F4. In the property pallet select the Orientation that is required to be selected when print is taken for that report.

  • Setting Default Printer on Client Machine using Webutil

    hi.........
    i have configuired webutil on Application Server.
    i want to develop a form using webutil from which user can set default printer from client's machine.....
    i have tried using CLIENT_WIN_API_ENVIRONMENT.READ_REGISTRY();......BUT NOT YET SOLVED..
    Is there any other solution except using CLIENT_WIN_API_ENVIRONMENT.READ_REGISTRY();
    pls help me asap........

    Swapnil,
    There are a lot of posts about this. I suggest you search the Forms Forum for 'WebUtil default printer' and see if you can find some that has solved this issue.
    Sorry, I could be more helpful. I started looking through these posts myself and finally decided I was the wrong person doing the search! :-)
    Craig...

  • How can I set default printer options on an iMac for an HP pro 8500 printer to print in draft mode?

    How can I set default printer options on an iMac for an HP pro 8500 printer to print in draft mode?

    When you use the Canon driver, the 2 sided printing is set in a different location. There is an entire menu dedicated to it (at least on my mx892). The printer dialog box has a menu selector in the middle of the screen (I think it says "layout" by default). If you click on it, you will see the duplexing options at the bottom. Much more flexibility than the single checkbox available with "airprint". The interface is unusual (at least for me) but you can pre-set up many different configurations (Fast Duplex, Fine Single-sided, B&W, Photo, etc etc.)

  • Group policy preference for creating printers setting the wrong printer as default

    Hi
    We have a a group policy preference applied to users.  At the moment we create a shared printer and set it as default for all users in a specific OU.  Now we need to add another shared printer.  I have updated the policy and set it to create
    the new shared printer and have set item level targeting to the same OU as the first printer.  I want to keep the existing printer as the default, however when the policy runs, the new printer is created fine but it is set as the default
    printer.  Is this because it has been added last ?  There doesn't seem to be a way of changing the order that the printers are applied.
    Both printers are Shared printers and are set to Create
    The existing printer (printer A) is set as the default printer.  It is targeted at the London OU.
    The new printer (printer B) has NOT been set as default.  It is targeted at the London OU.
    No other options have been set.
    When the policy is applied both printers are added but printer B is being set as the default.
    Any help would be appreciated.
    Thanks
    G

    Hi G,
    >>however when the policy runs, the new printer is created fine but it is set as the default printer.  Is this because it has been added last ?  There doesn't seem to be a way of changing the order that the printers are applied.
    Before going further, what's the operating systems of our clients? Here, I need to double confirm that the checkbox of
    Set this printer as the default printer... is not selected in the new GPP Printer item. Besides, we can change the orders of the printer items. To do this, select the printer item, right click, click All Tasks, and choose Move Up or Move
    Down to change the order.
    Best regards,
    Frank Shen
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • Set default printer group policy

    I am deploying our new printers via group policy.  We have a new printer in place and I am fairly familiar on how to actually deploy them.  I am deploying the printers MOSTLY by user configuration and with that method, I am able to easily delete old printers and set the correct one as a default.  
    However, We have some computers that have multiple users.  In that case, I am deploying the printers as a Computer configuration, not an employee configuration.  My question is, how can I set the newly deployed printer as a default for all users that log on to that particular computer?  Thank you.  
    This topic first appeared in the Spiceworks Community

    I am deploying our new printers via group policy.  We have a new printer in place and I am fairly familiar on how to actually deploy them.  I am deploying the printers MOSTLY by user configuration and with that method, I am able to easily delete old printers and set the correct one as a default.  
    However, We have some computers that have multiple users.  In that case, I am deploying the printers as a Computer configuration, not an employee configuration.  My question is, how can I set the newly deployed printer as a default for all users that log on to that particular computer?  Thank you.  
    This topic first appeared in the Spiceworks Community

  • Windows 8.1 Group Policy to Force Domain Logon as Default?

    I recently purchased a new Windows 8.1 computer for use in our organization.  The default logon option for the device is for a Microsoft Account (the default username field prompt is for an e-mail address, rather than for a username.)  However,
    I would prefer that the default logon option be for a Windows domain account logon, so that users don't have to click the "Sign-in options" link and select "Local or domain account password" each time they need to log onto the computer.
    I have learned that setting the "Interactive logon:  Do not display last user name"
    policy (located under Computer Configuration / Policies / Windows Settings / Security Settings / Local Policies / Security Options) to
    Disabled allows the domain logon option to be retained across sessions.  However, I would prefer to keep this option set to Enabled so that the previous user name is not displayed.
    Does anyone have any suggestions on how the default logon option can be forced to a domain logon, while still suppressing the display of the last username?

    Hi Arowitv,
    According to your description, we can use the following policy to check the result.
    Computer Configuration\Windows Settings\Security Settings\Local Policies\Security Options:
    Accounts: Block Microsoft accounts
    Click this option, and select" Users can't add or log on with Microsoft account"
    Note: Selecting this option might make it impossible for an existing administrator on this computer to log on and manage the system.
    Computer Configuration\Administrative Templates\System\Logon :Assign default domain for logon
    Set the option to Enabled, and add the Default Logon domain.
    Hope this helps.
    Regards,
    Kelvin Xu
    TechNet Community Support

Maybe you are looking for

  • How to display a specific SAP logon screen per system?

    Hello, I woud like to display a logon screen which contains system-specific information, e.g. for the QAS system it would be something like "This system was created by a system copy from PRD on MM/DD/YYYY"... I have gone through the SAP Note 205487 a

  • Where can I find an Apple certified internal hard drive?

    I have a December 2006 MacBook Pro that I upgraded RAM and hard drives (twice) from OWC. After having Apple replace the display and the motherboard (again twice) I've been having boot problems. My local Genius Bar told me to replace the RAM with my o

  • Divide JscrollPane into 2 picure viewer with scroll bar

    Hello to all, help me, i must divide a JScrollPane into 2 sub-windows in witch putting 2 different images. The image that i put at left is loaded by a JFileChooser. This is the code, my problem is into load_file() function. Help me, thanks a lot. Esc

  • I am new to workflow and I have and issue

    Hi Experts, I am very new to workflow and Ive got an issue which I need know where to start with. I am working with an application whose UI is Java and back end is SAP. When a sales order is created in the UI this creates a order record in SAP and tr

  • Crash Logs - Can I Delete old ones?

    Is there a purpose for these logs to be lying around? In User/Library/Logs/CrashReporter, I have a 105 documents, some of which are dated 2008. Can I just chuck these? I am on a bid to delete everything that has nothing to do with now, today, and the