Mapping default printer based on AD attribute

Hi all ! 
Sorry for my english, i'll try to be clear... :)
I need to run a VBscript on TSE 2008 R2 servers to set computer's
default printer (not user). For this, I need to use the ClientName var. 
The default printer name is written in the computer's description attribute in Active Directory. 
I'm a beginner in VBscripting. I have parts of scripts working, but not everything.
Here is my script (my comments are written with ''''''''''''''''''''''''''''''''''''''''''''): 
'find clientname
strComputer = "."
Const ForAppending = 8
Set oNetwork = wscript.CreateObject("wscript.network") 'Create network object
Set objShell = Wscript.CreateObject("Wscript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colAdapters = objWMIService.ExecQuery ("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled = True")
strUserName  = oNetwork.userName
strComputerName  = oNetwork.computerName
strClientName = objShell.ExpandEnvironmentStrings("%clientname%")
ExecuteSearch = SearchDistinguishedName(strClientName)
Public Function SearchDistinguishedName(ByVal vSAN)
Const ADS_SCOPE_SUBTREE = 2
    Dim oRootDSE, oConnection, oCommand, oRecordSet
    Set oRootDSE = GetObject("LDAP://rootDSE")
    Set oConnection = CreateObject("ADODB.Connection")
    oConnection.Open "Provider=ADsDSOObject;"
    Set objCommand = CreateObject("ADODB.Command")
    objCommand.ActiveConnection = oConnection
ldstring = "'LDAP://" & oRootDSE.get("defaultNamingContext") & "'" 
objCommand.CommandText = "Select Name, distinguishedName from "& ldstring & " where objectClass='computer'"  
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Timeout") = 30 
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE 
objCommand.Properties("Cache Results") = False 
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
Do Until objRecordSet.EOF
If lcase(objRecordSet.Fields("Name").Value) = lcase(vSan) Then
    Wscript.Echo "Client Name: " & objRecordSet.Fields("Name").Value & vbCrLf _ 
    & "Location: " & objRecordSet.Fields("distinguishedName").Value
    'Wscript.Quit
End If
    objRecordSet.MoveNext
Loop
End Function
' find canonical name
On Error Resume Next
ADSRoot = "DC=domain,DC=fr"
Const ADS_SCOPE_SUBTREE = 2
Set objConnection2 = CreateObject("ADODB.Connection")
Set objCommand2 = CreateObject("ADODB.Command")
objConnection2.Provider = "ADsDSOObject"
objConnection2.Open "Active Directory Provider"
Set objCommand2.ActiveConnection = objConnection2
objCommand2.Properties("Page Size") = 1000
objCommand2.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objCommand2.CommandText = _
"SELECT * FROM 'LDAP://" & ADSRoot & "' WHERE objectCategory='user' OR objectCategory='computer'"
''''''''''''''''''''''''''''''''''''Here, I use a input box to enter the clientname, cause I don't know how to re-use the clientname found in the lasts vars.
srchTrm = LCase(InputBox("Please enter your search term.", "Active Directory Search"))
WScript.Echo srchTrm
i = 0
If Len(srchTrm) < 4 or Instr(srchTrm, "=") Then
WScript.Echo "Please enter a search term in excess of 3 characters. Don't use ""="""
WScript.Quit
End If
Set objRecordSet2 = objCommand2.Execute
objRecordSet2.MoveFirst
Do Until objRecordSet2.EOF
strADPath = LCase(objRecordSet2.Fields("adsPath").Value)
If InStr(strADPath, srchTrm) Then
Set objUser = GetObject(objRecordSet2.Fields("adsPath").Value)
Select Case objUser.Class
Case "user"
strMsg = "Type: Person" & VbCrLf
strMsg = strMsg & "Name: " & objUser.DisplayName & VbCrLf
strMsg = strMsg & "Email: " & objUser.mail & VbCrLf
strMsg = strMsg & "Telephone: " & objUser.telephoneNumber & VbCrLf
strMsg = strMsg & "Department: " & objUser.department & VbCrLf
strMsg = strMsg & "Title: " & objUser.title & VbCrLf
Case "computer"
strMsg = "Type: Computer" & VbCrLf
strMsg = strMsg & "Name: " & objUser.Get("name") & VbCrLf
strMsg = strMsg & "OS: " & objUser.operatingSystem & VbCrLf
Case Else
strMsg = "Unidentified" & VbCrLf
End Select
'strMsg = strMsg & "LDAP: " & objUser.adsPath & VbCrLf
objUser.GetInfoEx Array("canonicalName"), 0
strMsg = strMsg & "AD Path: " & objUser.canonicalName & VbCrLf
objUser.GetInfoEx Array("description"), 0
strMsg = strMsg & "Imprimante: " & objUser.description
WScript.Echo strMsg & VbCrLf
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''Here I want to use the "objuser.description" to set default printer
Dim WshNetwork
Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.SetDefaultPrinter "\\SRV-PRINT.domain.fr\" & objUser.description
i = i + 1
End If
objRecordSet2.MoveNext
Loop
If Not i > 0 Then
WScript.Echo "No results found."
End If
I think there's a most simple way to do this, but for the moment, I Don't know how to do. 
Any help would be grateful. 

Hello. 
We need to do this because each computer in the office as a network printer (or nearly each computer). I can't do a Group Policy for each computer in my domain. We cannot work with users accounts, only computers . 
My problem is that if the user1 is connected on Comp1, he must have the printer near computer 1 as default printer.
If user1 is connected on computer 2, at the other side of the office, he must have the printer near computer 2. So I cannot imagine a group policy to do this :). 
We had the idea to use the descprition attribute in Active Directory to indicate the default printer to map.
We must now make a script to get clientname on the TSE session, look for the computer account in Active Directory, read its description's attibute and map the default printer. 
For example, my computer is COMP01. I use a TSE environment on SRVTSE01. 
The script need to determine which computer (COMP01) is connected to the SRVTSE01 server (clientname var), search Active Directory computer account of COMP01, read the account's description attribute (for example PRINT01) and set \\SRV-PRINT\PRINT01 as the
default printer on COMP01.
Hope it's better with this example... 

Similar Messages

  • 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.

  • 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]

  • Map default values in Header based on multiple values in the line item

    Hi
    I have a scenario in which the Header field of an IDOC should be populated with some default values based on some mixed mvt types in the line items.
    eg:
    Header -
    > Delivery type -
    > needs to be mapped to A (for X of line item 1)or B (for Y of line item 2) or C (for Z of line item 3 )
    based on line items field
    line item1---> mvt type---> X
    line item 2-->mvt type----->Y
    line item 3 -
    > mvt type -
    > Z
    mvt types doesnt necessarily have to come in that order and even the same mvt type can repeat in multiple line items.
    Can we achieve this logic in XI ?

    I think if you include removeContext, Sort, SplitByValue (on Value Change), CollapseContext to mvt type in all line items and then use ifelse condition to achieve your result.
    I will give an example of line Item1
    mvt type --->RemoveContext ->Sort>SplitByValue(on value change) --> CollapseContext
    Use the above mapping to IF function and check if it is having X, Y or Z then map the appropriate value to target field.
    Do the same for rest of the line items.

  • Forcing default printer from gpp cse computer based policy using item level tracking

    currently I have 1 policy for deploying printers and under the computer config/preferences/control panel/printers
    I have 2 printers set up the exact same way with item level targeting to apply it to 2 different pc's.  so 1 printer for each pc
    this all works as it should, each pc gets the correct printer, in the policy each printer has the "set this printer as the default printer" checked and "...only if a local printer is not present" is checked
    the above works for 1 pc and 1 printer which becomes the default, not the second printer on the second machine.  it adds the printer but does not mark it as the default
    so in the end I want floor a to get printer a and have it be the default printer and floor b to get printer b and have it the default printer

    > so far this is working for the 1 printer  on the 1 pc but not on the
    Yes, it seems to be "working" in terms of "the result is what you
    expected". But this is  rather by accident than by design, because...
    > second printer in the policy that goes to another computer using ilt
    ...as you are seeing yourself: It is NOT working.
    Greetings/Grüße,
    Martin
    Mal ein
    gutes Buch über GPOs lesen?
    Good or bad GPOs? - my blog…
    And if IT bothers me -
    coke bottle design refreshment (-:

  • Network shared printers stop working; default printer changes

    Hello,
    Have an odd printing issue that seems to be ongoing and am trying to come up with a good solution or fix for it.
    We have an environment that has a Windows 2012R2 Print Server, that is sharing various printers which are also set to List in Directory.  Some of the printers are HP and are using the HP Universal driver which shows as "True" for Packaged in
    the print management window, and some of the printers are Canon which are using device specific drivers and show as "False" for Packaged.  My understanding is that the packaged attribute simply indicates that Point and Print can then download
    the driver and install/use it without any security prompts whereas if it is not Packaged, then the driver must be installed on the local server/workstation by an Administrator.  We have Group Policy defined such that all Point and Print restrictions are
    Disabled.
    We then have multiple Remote Desktop Session Hosts based on Server 2008R2 (x64).  Users connect to these hosts via thin clients (Wyse) and there is a domain login script using KiXtart that creates printer connections to the shared printers using an address
    of \\printserver\printername.  We also set the default printer via the login script each time depending on user's group membership.
    Each part of this setup is on it's own routed VLAN subnet, so the Print Server is on 192.168.0.x/24, RDSHs are on 192.168.1.x/24 and the printers themselves are on 192.168.2.x/24.  There is no firewall or other restrictions between the subnets, all traffic
    is allowed to flow.
    The issue we are having is two parts, the first is the larger issue, but both are a pain:
    1) Randomly (no discernible pattern/reason/timeframe), some Canon printers will stop appearing in Print dialog boxes from applications when a user tries to print.  It only seems to happen on the Canon printers.  The printer will still show in Control
    Panel -> Devices and Printers, but when you right click it and try to go to Printer Properties or view any of the printer settings, you'll get an error saying the printer is not accessible/valid.  I have also tried a WMI query for "select * from
    win32_printer" and the printer will not be returned.  To temporarily fix it, we right click the printer, and choose to remove it and then go through the wizard to re-add the same printer from the directory again.  That will correct it and the
    user can print again, view all properties, etc.  This doesn't happen to every user but happens sporadically and once it happens to a user it seems to pop up once every week or two.
    Now, we have made a change and installed the Canon printers in question locally on the Remote Desktop Session Hosts themselves using TCP/IP ports so that each user logging into the session host will see all of the printers.  This also seems to have resolved
    this issue.  So it leads me to think there is some sort of timeout or connection getting dropped, but for no real apparent reason.  This is all on a virtualized platform and so the Print Server and Session Hosts have very reliable LAN connections
    amongst themselves.  And further, we never see the issue with the HP printers, they seem to maintain their stability at all times.
    2) The other issue we are seeing is that from time to time the default printer setting changes or vanishes altogether.  It doesn't happen to every user but once it does happen it happens regularly (multiple times a day).  This happens even when using
    the locally mapped TCP/IP printer or when using the network print server.  From what I have read and found, this generally seems to be a known issue regarding redirected client printers and some GP settings related thereto.  But we aren't redirecting
    any local client printers, everything is network based/shared.
    In digging into these two issues I have run across the following error we get regularly in the PrintService Event Viewer log:
    The print spooler failed to import the printer driver that was downloaded from \\printserver\print$\x64\PCC\ntprint.inf_amd64_59246c3ac1bd3f2a.cab into the driver store for driver Microsoft enhanced Point and Print compatibility driver. Error code= 800f024b.
    This can occur if there is a problem with the driver or the digital signature of the driver.
    And digging further into that seems to be that their was an error validating one of the DLL files as seen at the following thread:  http://social.technet.microsoft.com/Forums/windowsserver/en-US/9fe186e4-52f7-4552-a223-b2320cfc9ed5/driver-install-semi-fails-with-800f024b?forum=winserverprint
    We get the exact same error that is shown there UNISRV.DLL being flagged as invalid, and have applied the hotfix indicated in KB2701894.
    I am not sure the above error is realted to the issues at hand, but figured it is a good starting point to eliminate it as a potential cause of the issue.
    Any input or suggestions on what to do to diagnose or further resolve this would be greatly appreciated!

    Alan, I'm getting this error 600 in my company. Is there any fix for this problem?
    After installing KB2919355 on Windows 2012 R2, when I try to map a shared printer I receive the following error message: A policy is in effect on your computer which prevents you from connecting to this print queue. Please contact your system administrator.
    If I uninstall the patch the shared printer maps correctly.
    I also notice that if I copy the driver \\server\print$\x64\PCC\ntprint.inf_amd64_a7ac65d1b7714fb1.cab
    from a Windows 2012 R2 before applying KB2919355 to the server that has the patch applyed (and rename it), I can map the printer.
    Does anyone know if there is a fix for that?

  • Mapping to printer

    My network requires I use Z: for other things.  Currently Z: is mapping by default to my HP printer.  I'm assuming the printer has a share established for the mapping to occur, but how do I change the drive to something other than Z: ?  What is the share name , if any?
    I tried disconnecting and re-mapping to P: based on the IP address of the printer, but no dice.

    Hi CCRedNeck and welcome to the HP Forum,
    In order for the printer to work on all drives, it technically should be installed on the network. You would need to have your IT person do this.
    If your printer is a commercial printer you can contact the HP Support Center for business.
    I hope this information helps.
    Thank you,
    I worked on behalf of HP.

  • How to print report on client default printer ?

    I develop web application. I use jdev 10.1.3.4.0 . I can print report in PDF format.
    My Problem
    I can't print report on client default printer. when Client run application and print. Report is printed at server default printer
    How can I do.
    _My source code for print to PDF format._
    FacesContext context = FacesContext.getCurrentInstance();
    response = (HttpServletResponse)context.getExternalContext().getResponse();
    String urlSchema = "jdbc:oracle:thin:@localhost:1521:ORCL";
    String schemaName = "hr";
    String schemaPass = "hr;
    reportPath = "D:\\Project\\Reports";
    Class.forName("oracle.jdbc.driver.OracleDriver");
    conn = DriverManager.getConnection(urlSchema, schemaName, schemaPass);
    reportPath = reportPath.endsWith("\\") ? reportPath : (reportPath + "\\");
    input = new File(reportPath + reportName + ".jasper");
    reportParameters.put("SUBREPORT_DIR", reportPath);
    reportParameters.put("P_IMAGE_PATH", reportPath);
    jasperPrint = JasperFillManager.fillReport(input.getPath(), reportParameters, conn);
    response.setContentType("application/pdf");
    response.addHeader("Content-Disposition", "attachment;filename=" + reportNameOutput + ".pdf");
    OutputStream outputStream = response.getOutputStream();
    JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
    outputStream.flush();
    outputStream.close();
    conn.close();{code}
    _My source code for print to *printer*._
    {code}FacesContext context = FacesContext.getCurrentInstance();
    response = (HttpServletResponse)context.getExternalContext().getResponse();
    String urlSchema = "jdbc:oracle:thin:@localhost:1521:ORCL";
    String schemaName = "hr";
    String schemaPass = "hr;
    reportPath = "D:\\Project\\Reports";
    Class.forName("oracle.jdbc.driver.OracleDriver");
    conn = DriverManager.getConnection(urlSchema, schemaName, schemaPass);
    reportPath = reportPath.endsWith("\\") ? reportPath : (reportPath + "\\");
    input = new File(reportPath + reportName + ".jasper");
    reportParameters.put("SUBREPORT_DIR", reportPath);
    reportParameters.put("P_IMAGE_PATH", reportPath);
    jasperPrint = JasperFillManager.fillReport(input.getPath(), reportParameters, conn);
    JasperPrintManager.printReport(jasperPrint, false);
    conn.close();Edited by: jaae251 on Jun 18, 2009 2:29 AM

    If you offer a PDF to the end user, they usually know what to do with it. OTOH, if you wish to provide software to facilitate the local printing, you might launch an application on the client side that accesses the JNLP API's PrintService - that can be done in a sandboxed application.
    A signed application might access the normal J2SE based print services. Though I heard that Sun had decided to make printing a 'prompt on first attempt' deal - even for sandboxed apps., from 1.5 plus (or was it 1.6 plus?).
    It would be a serious security bug if a web site could print on the client printer, without trust or active involvement from the end user.

  • Print Reports on Client Default Printer

    Hi All,
    I am using  Oracle Reports 11g Release 2 (11.1.2.2.0).
    I want to print oracle reports from ADF which is JEE base framework on client default printer. I am send just plane url to generate report to report server. In Oracle forms we have option to get job id of report, but in plain url i am not seeing any thing like that. In forms in am generating PDF wait untill job is finished and then send pdf to client printer by using job id.
    How it will be possible by using plain URL send to report server or any other idea to achieve this task.
    Thanks in advance.

    If you offer a PDF to the end user, they usually know what to do with it. OTOH, if you wish to provide software to facilitate the local printing, you might launch an application on the client side that accesses the JNLP API's PrintService - that can be done in a sandboxed application.
    A signed application might access the normal J2SE based print services. Though I heard that Sun had decided to make printing a 'prompt on first attempt' deal - even for sandboxed apps., from 1.5 plus (or was it 1.6 plus?).
    It would be a serious security bug if a web site could print on the client printer, without trust or active involvement from the end user.

  • Can Reader pick up the Default Page Size of a printer that is not the Windows Default Printer?

    We have a web based application that generates PDF documents via Crystal Reports.
    We are using Adobe Reader 8
    The PDF pages are displayed within an Internet Explorer window where the the users then print the document.
    The application is designed so the user only gets one chance to print the document (ie they cant come back and change printer settings if they happen to print the document out incorrectly)
    The document needs to be printed on A3 paper, full duplex.
    We have a printer set-up decidated to the printing of the documents generated by this application.  The default page size of this printer is set of A3.
    If we set this dedicated printer as the Windows Default Printer we have no problems at all.  The default page size (A3) is picked up and the document is printed correctly.
    If any other printer is set as the Windows Default Printer (eg one that has a default page size of A4), the users must obviously select the correct printer from the Print Dialogue Box -however when the user selects the dedicated A3 printer, the page size remains as A4 (page size of the Windows Default Printer).  This means the user must remember to change the paper size to A3 each time.
    Out users find IT a struggle at the best of times - anything that makes the process simpler is very welcomed!
    Is there a way to ensure the default page size of the printer is respected when that printer is not the Windows Default Printer?
    Thanks!

    No.

  • 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

  • I want to set default printer settings to be used only for a specific type of application, certain documents. All other print jobs should use a different default setting for the printer.

    I am printing a specific document from a web based application. This document need to be printed in landscape. So I would like to set the default settings for this specific printer to landscape. But for all other printers it should be portrait. But this does not seem to work. The browser picks the settings from the standard/default printer and uses this for all print jobs.

    Embie wrote:
    I was told by support that my problem was a hardware problem and that HP would not replace the faulty hardware.  Great.  I will replace my faulty hardware manufacturer.  Simple, HP never again.
    In the hour since you have registered you have posted seven messages, none of which contain any useful information that would allow someone here to help you.  Please read this post then provide some details in a new thread.  What printer model? What operating system? How is the printer connected - USB, wired LAN, Wireless LAN, bluetooth?  What is the problem you are having (with the printer...)?
    Bob Headrick,  HP Expert
    I am not an employee of HP, I am a volunteer posting here on my own time.
    If your problem is solved please click the "Accept as Solution" button ------------V
    If my answer was helpful please click the "Thumbs Up" to say "Thank You"--V

  • Pages does not select the default printer.

    I have an IMac, 2.8 GHz, running version 10.6.5 connected to a Canon MX860. Under Print & Fax preferences, I list two printers. The first is Canon MX860 USB and the second is Canon MX860 Wireless. The default is set for the wireless. On all applications except "Pages", the default printer is the one selected. But, PAGES always selects the USB one. Is this a bug in PAGES, or is there something I can do?

    Yvan, not wishing to incur your ire... I have a similar problem and went through pages of discussions generated by the search function. I cannot find a thread matched with exactly with what I believe to be the issue here. My default print setting is wireless and all apps respect that including Pages (Version 09) generic templates. However, when I print from a Pages template that I created, it always defaults to the USB connection of my printer - and I do not leave the USB cable plugged in. I have tried to modify the template by opening it, File, Page Setup, Attributes, Format for wireless printer - save template.... Yet it still defaults to the unconnected USB version of my printer. Even doing page set up and then trying to print immediately, it defaults to the USB version. My printer is HP Photosmart C4585.
    Yvan if you know of the right thread, apologies but could you point me to it please?
    Many thanks for your patience

  • Push default printer settings from server - setprinter.exe ?

    Hi,
    I need to push out some new default printer settings (mono and duplex) for 300 printers across about 12 x 2003/2008 print servers.  All of these devices are already mapped by around 2500 WinXP/7 users, so reconnecting the devices for everybody is not
    an option, nor is redeploying via GPO.  I've read the following thread, which appears to explain what I need to do:
    http://social.technet.microsoft.com/Forums/en-US/winserverprint/thread/a0a9bb3f-db24-417d-9905-c310d068d3c6/ 
    Firstly, I need the latest version of setprinter.exe, as the one I've got is date stamped April 2003, which I assume is the one that fails to work with devmode 9.  Does anybody know where I can get this from?
    Secondly, I think it says that the clients will periodically update themselves with the server's default settings.  This is perfect, if correct.  However, would anybody please be able to explain when these periodic updates take place?
    Many thanks in advance !
    Andy

    Hi,
    There is a tool named "setprinter.exe" tool in the Windows Server 2003 Resource Kit.
    Windows Server 2003 Resource Kit can be downloaded from the link below:
    http://www.microsoft.com/downloads/details.aspx?FamilyID=9D467A69-57FF-4AE7-96EE-B18C4790CFFD&displaylang=en
    As far as I know, there is no Windows Server 2008 Resource Kit for download, some of the MS Press have some books include Windows® Server 2008 Security Resource Kit
     http://www.microsoft.com/learning/en/us/book.aspx?ID=11841&locale=en-us
    Windows Server® 2008 Resource Kit (bundle)
    http://www.microsoft.com/learning/en/us/book.aspx?ID=10345&locale=en-us
    You may find ll the entire RESOURCE KIT on CD attached with the book.
    Windows Server 2008 R2
    ==================
    No resource kit Tools & Support tools are available for 2008R2...everything is on the OS already
    Secondly, I think it says that the clients will periodically update themselves with the server's default settings.
    >> Do you mean group policy refresh? By default, computer Group Policy is updated in the background every 90 minutes, with a random offset of 0 to 30 minutes. In addition to background updates, Group Policy for the computer is always updated when the
    system starts.
    Hope this helps!
    Best Regards
    Elytis Cheng
    Elytis Cheng
    TechNet Community Support

  • Detect Default Printer in 9iDS ??

    Hi,
    I will detect the default Printer from the Client
    The Get_default_printer Function is not included in WEBUTIL
    Exists an other possibility to detect the default Printer ?
    Thanks Alfred

    Default printer is an attribute of the Window. Unfortunately the version of Java supported by WebUtil (JDK 1,3) does not offer a method through which to get the window handle, so it is not possible to get the default printer by that route.
    However, you can get the Default Printer by reading the registry using
    Client_Win_API_Environment.read_registry('HKEY_CURRENT_USER\SOFTWARE\MICROSOFT\WINDOWS NT\CURRENTVERSION\WINDOWS','Device',false);
    END;     Cheers, APC

Maybe you are looking for

  • Any way to repair corrupted pdf file?

    I created a pdf document on a my PC and it became corrupted with all these strange characters. Now when I open the document I get an error message that wasn't coming up before im hoping this msg will bring some light into the situation. If anyone can

  • Calendar event not showing correctly

    Hi, I'm running several iCloud calendar and encountered a weird problem today with the way an event block rendered in day view in my personal work calendar.  I'm putting in a night-shift which runs from 2230 on a Sunday 30th March 2014 to 0730 the ne

  • Error import in CI_PERSONAL_DATA

    I am making an import of data to te PERSONAL_DATA component in Peoplesoft HCM 9.2 with CI_PERSONAL_DATA component interface, but I have this error: Error Position: 12 Return: 1732 - ORA-01732: data manipulation operation not legal on this view Failed

  • How can i download iPhoto for Mac OS x10.4 for free?

    please help, cant seem to find this app on my old Powerbook G4, have iTunes, just no IpHoto. dont want to have to buy it again, only downloads I seem to be able to find are updates, where can I get the program? Please help

  • GR/IR posting date

    Dear Experts, I have one scenario i want to restrict no body can make the VIV before GR posting date . Suppose Gr date is   03.04.2010 VIV date is 31.03.2010 Regards Aamir