Jump to content
House Price Crash Forum

Archived

This topic is now archived and is closed to further replies.

pl1

Mapping Printers Using Active Directory

Recommended Posts

I'm a reluctant part-time IT admin for a remote site and there is a PC there that multiple people log onto but I always need the same printers mapped to it. I know you can add them as local ports but I'd like to do it through Active Directory as this site is fully AD enabled (it's own seperate forest as I understand it) and I'm marginally curious how this would be achieved using AD/GPO. It's 2003 server which is the only server in the forest so it does everthing on the admin side of things fsmo etc. I know you probably need a GPO and/or a login script but I need spoonfeeding the info as my Google searches haven't been productive. I've read about the 2003 R2 push printer software? but it talks about updating the AD schema and I am reluctant to do this, especially if it requires reboots and bearing in mind my lack of knowledge in this area if it screws up.

So basically, one computer always needs the same 2 printers no matter who logs on. If possible I'd like it to log on quickly so I'm unsure if a login script that maps the printer on the fly each time would cause an extra delay at logon?

Thanks,

Share this post


Link to post
Share on other sites

technet?

http://technet.microsoft.com/en-us/library/cc784753(WS.10).aspx

You haven't told us if it is a big fancy printer with can get on the network on it's own, a printer connected to a PC or a print server.

There's two and they are bog standard network printers on the only server there obviously as thats why I was asking about AD. If they were local I would use add/remove printers as local ports and it wouldn't matter who logged onto the pc.

I might bump this tomorrow when there's some bored AD admins loitering :lol:

Share this post


Link to post
Share on other sites

There's two and they are bog standard network printers on the only server there obviously as thats why I was asking about AD. If they were local I would use add/remove printers as local ports and it wouldn't matter who logged onto the pc.

I might bump this tomorrow when there's some bored AD admins loitering :lol:

Even if a printer is on a server, it can still be added directly as local (TCP/IP port). Wouldn't recommend it as an elegant solution though.

Adding a printer to AD is fairly easy is it not? I'm sure if you Google you'll find the full solution you need.

Share this post


Link to post
Share on other sites

You shouldn't have to reboot the server.

If you add the printers as a local machine GPO, it will be processed during startup by the local PC. (so you will need to reboot after applying it)

If you add them as a user GPO it will be applied to all computers the users log on to.

I was trying to point you in the right direction, technet has instructions for just about eventuality and if you simply browse through you will find step by step instructions for your exact needs.

Share this post


Link to post
Share on other sites

Even if a printer is on a server, it can still be added directly as local (TCP/IP port). Wouldn't recommend it as an elegant solution though.

I know I stated this in my op. Was just wondering how AD did it.

Adding a printer to AD is fairly easy is it not? I'm sure if you Google you'll find the full solution you need.

As I said my Google search was a bit fruitless. There is a program that allows just what I want, but you need 2003 R2 server and involves something to do with changing the AD schema, probably easy but never having done it before don't want to risk it.

You shouldn't have to reboot the server.

Good.

If you add the printers as a local machine GPO, it will be processed during startup by the local PC. (so you will need to reboot after applying it)

Do you do this in AD U&C on the server by sticking the computer I'm on about in it's own OU, right click that and then....? How do you actually tell/edit the GPO to say I want this printer on this server to always load on this PC?

Cheers

If you add them as a user GPO it will be applied to all computers the users log on to.

I was trying to point you in the right direction, technet has instructions for just about eventuality and if you simply browse through you will find step by step instructions for your exact needs.

Thanks, I'm slightly reluctant Admin and the thought of perusing admin stuff on technet for hours and hours doesn't appeal. What you could tell me in 5 minutes might take me many hours of searching.

Add a printer connection that's available to anyone who logs on:

Rundll32 printui.dll,PrintUIEntry /ga /n\\Server\PrintShare

http://ss64.com/nt/rundll32.html

I use this as a batch script sometimes and it takes a little while, while it faffs about searching for a printer but wouldn't this run every logon and slow down the logon process? Also as an excercise I was marginally interested in seeing how AD would do it.

Cheers all, sorry if posts sometimes sound rude, it's sometimes difficult not to convey this with this kind of subject

Share this post


Link to post
Share on other sites

I use a vbscript logon script, which has functions to add a remove printers.

I've also written a function that returns true if the user that is logging on is a member of an AD group, so that the printers can be added conditionally, based on group membership.

Let me know if that's any use to you, and I'll send you the code. It takes very little time to execute, so I let them run at every logon.

Share this post


Link to post
Share on other sites
I use a vbscript logon script, which has functions to add a remove printers.

I've also written a function that returns true if the user that is logging on is a member of an AD group, so that the printers can be added conditionally, based on group membership.

Let me know if that's any use to you, and I'll send you the code. It takes very little time to execute, so I let them run at every logon.

Yea thanks.

It sounds like it is always a login type script (via computer level GPO??) that runs each time the PC boots up that you set up initially from t'server ADU&C? If so can anyone spoonfeed/bullet point/peel back the onion on that process for me.

I'm guessing there's no built in "add this printer" function GPO section and it has to be some kind of rundll32/vbs type script thing punched out via GPO?

Share this post


Link to post
Share on other sites

Yea thanks.

It sounds like it is always a login type script (via computer level GPO??) that runs each time the PC boots up that you set up initially from t'server ADU&C? If so can anyone spoonfeed/bullet point/peel back the onion on that process for me.

I'm guessing there's no built in "add this printer" function GPO section and it has to be some kind of rundll32/vbs type script thing punched out via GPO?

I'm not sure you can do it all with a GPO, but you can assign the logon script to a user with a GPO.

The most straightforward way of doing this is to go into ADUC, right-click on the OU you want to add the GPO to, click New, type in a name, then highlight it and click Edit. Then you want to go to User Configuration, Windows Settings, Scripts (Logon/Logoff), Logon. In there you can add your script.

Here's the code, anyway:

'Get AD objectSet objADSystemInfo = CreateObject("ADSystemInfo")'Get Current User ObjectSet objADUser = GetObject("LDAP://" & objADSystemInfo.UserName)'Check whether objADUser is a member of PrinterGroup using the function IsMember, if so add network printer \\server\printerIf (IsMember(objADUser, "PrinterGroup") = True) Then wshNetwork.AddWindowsPrinterConnection "\\server\printer"End If' optionally set the printer as default'wshNetwork.SetDefaultPrinter "\\server\printer"

And you'll need this function at the bottom of the script:

'========================================================================'Function IsMember(ByVal objADObject, ByVal strGroupNTName)'========================================================================'   ' Function to test for group membership.   ' objADObject is a user or computer object.   ' strGroupNTName is the NT name (sAMAccountName) of the group to test.   ' objGroupList is a dictionary object, with global scope.   ' Returns True if the user or computer is a member of the group.   ' Subroutine LoadGroups is called once for each different objADObject.   Dim objRootDSE, strDNSDomain   ' The first time IsMember is called, setup the dictionary object   ' and objects required for ADO.   If (IsEmpty(objGroupList) = True) Then       Set objGroupList = CreateObject("Scripting.Dictionary")       objGroupList.CompareMode = vbTextCompare       Set adoCommand = CreateObject("ADODB.Command")       Set adoConnection = CreateObject("ADODB.Connection")       adoConnection.Provider = "ADsDSOObject"       adoConnection.Open "Active Directory Provider"       adoCommand.ActiveConnection = adoConnection       Set objRootDSE = GetObject("LDAP://RootDSE")       strDNSDomain = objRootDSE.Get("defaultNamingContext")       adoCommand.Properties("Page Size") = 100       adoCommand.Properties("Timeout") = 30       adoCommand.Properties("Cache Results") = False       ' Search entire domain.       strBase = "<LDAP://" & strDNSDomain & ">"       ' Retrieve NT name of each group.       strAttributes = "sAMAccountName"       ' Load group memberships for this user or computer into dictionary       ' object.       Call LoadGroups(objADObject)       Set objRootDSE = Nothing   End If   If (objGroupList.Exists(objADObject.sAMAccountName & "\") = False) Then       ' Dictionary object established, but group memberships for this       ' user or computer must be added.       Call LoadGroups(objADObject)   End If   ' Return True if this user or computer is a member of the group.   IsMember = objGroupList.Exists(objADObject.sAMAccountName & "\" _       & strGroupNTName)End Function'========================================================================'

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.

  • 259 Brexit, House prices and Summer 2020

    1. 1. Including the effects Brexit, where do you think average UK house prices will be relative to now in June 2020?


      • down 5% +
      • down 2.5%
      • Even
      • up 2.5%
      • up 5%



×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.