Thank you Todd! That is exactly what I was lookig for. -JB

-----Original Message-----
From: Todd Povilaitis [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, November 20, 2002 6:22 PM
To: [EMAIL PROTECTED]
Subject: RE: [ActiveDir] Script for publishing printers?


If you have the Windows 2000 Server Resource Kit, check out prnadmin.dll
(you'll need to register it).  It's well documented (prnadmin.doc) and comes
with several "one-shot" scripts (working documentation) to get you familiar
with how to use it.  The script you'll be immediately interested in is
prncfg.vbs.  Use the -a switch to set the "+published" attribute...


-----Original Message-----
From: Glenn Corbett [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 20, 2002 12:13
To: [EMAIL PROTECTED]
Subject: Re: [ActiveDir] Script for publishing printers?


Could be correct tony, didnt try to retrofit printers that have already been
created.

G.

----- Original Message -----
From: "Tony Murray" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, November 20, 2002 9:32 PM
Subject: Re: [ActiveDir] Script for publishing printers?


> Hi Glenn
>
> I could be wrong, but I don't believe you can force the publishing of
printers in AD using Group Policy if the printers already exist on the print
server and the "list in directory" checkbox is unchecked (John's scenario).
>
> Tony
>
> ---------- Original Message ----------------------------------
> From: "Glenn Corbett" <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> Date: Wed, 20 Nov 2002 21:14:35 +1100
>
> Script for publishing printers?John,
>
> there are a couple of ways to to this. From VB/VBScript, you can set 
> the
Location and Description of the printers (code below).
>
> Obviously this is just an example :)
>
> Dim P
> Dim PQcontainer As IADsContainer
> Dim pq As IADsPrintQueue
>
> ' Bind to the computer object
>     Set PQcontainer = GetObject("WinNT://<ServerName>,computer") <-- 
> set
<ServerName> equal to your print server
>
>     PQcontainer.Filter = Array("PrintQueue") <-- filter for print 
> queues
only
>     For Each P In PQcontainer
>        Set pq = GetObject(P.ADsPath)
>        'Only set this if you are not using Printer location Tracking
(which is great BTW)
>        pq.Location = "Test" <-- set the information
>        'Set the description
>        pq.Description = "On First Floor" <-- set the information
>        pq.SetInfo <-- update the printer
>
>        MsgBox pq.Name & " is a " & pq.Model
>     Next P
>
> Unfortunately havent figured out how to set the "Publish in AD" 
> setting
from script....so on to next bit :)
>
>
> You can also use a group policy setting on the print server to force
publishing of printers in AD:
>
> http://support.microsoft.com/default.aspx?scid=kb;EN-US;234270
>
> HTH
>
> Glenn
>
>   ----- Original Message -----
>   From: Bjelke John A Contr AFRL/VSIO
>   To: '[EMAIL PROTECTED]'
>   Sent: Wednesday, November 20, 2002 2:26 AM
>   Subject: [ActiveDir] Script for publishing printers?
>
>
>   Hey folks!
>           quick question, and one I hope there is a relatively easy 
> answer
to:
>   Print servers migrated to AD via Aelita tools. Need to publish all 
> of
the printers on the server. Is there a way to script this, or do I need to
manually go through hundreds of printers and check "List in directory" and
enter a location? Suggestions, criticisms, verbal abuse, etc. welcome :^)
>
>            John A. Bjelke
>                 Unisys
>            505.853.6774
>     [EMAIL PROTECTED]
>   The wise man learns more from his enemies than a fool does from his
friends.   - Chinese Proverb
>
>
>
> List info   : http://www.activedir.org/mail_list.htm
> List FAQ    : http://www.activedir.org/list_faq.htm
> List archive: 
> http://www.mail-archive.com/activedir%40mail.activedir.org/
>

List info   : http://www.activedir.org/mail_list.htm
List FAQ    : http://www.activedir.org/list_faq.htm
List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/
List info   : http://www.activedir.org/mail_list.htm
List FAQ    : http://www.activedir.org/list_faq.htm
List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/
List info   : http://www.activedir.org/mail_list.htm
List FAQ    : http://www.activedir.org/list_faq.htm
List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/

Reply via email to