Page 1 of 1 1
Topic Options
#167017 - 2006-09-07 06:33 PM Create ObjectGUID for printers
Duvander Offline
Fresh Scripter

Registered: 2005-11-07
Posts: 27
I have created a lot of printers on a w2k3 server using:
Code:

SHELL 'cscript %windir%\system32\prnmngr.vbs -a -p "PrinterName" -m "DriverName" -r "IP_192.168.0.254"'
SHELL 'cscript %windir%\system32\prncnfg.vbs -t -p "PrinterName" -h "ShareName" -l "Location" -m "Comment" +shared'


The problem is that after created th printers the AD doesn't find the them. The printers works fine but I cannot search them thru the AD. I noticed that the printers haven't got any ObjectGUID in the register. Is there any way to add those printers to the AD now and give them a ObjectGUID?

Top
#167018 - 2006-09-07 06:42 PM Re: Create ObjectGUID for printers
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Asking a VBS question on this KiX forum is considered off-topic.
Top
#167019 - 2006-09-07 07:47 PM Re: Create ObjectGUID for printers
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
have you tried the addprinter() udf?
Top
#167020 - 2006-09-07 10:22 PM Re: Create ObjectGUID for printers
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Maybe the printers are just not listed in the directory?
Try this on the computer where the printers are *really* installed (the printer server?)
Right-click the printer and go to properties
Go to the sharing tab
Tick the "List in directory" tickbox

Top
#167021 - 2006-09-08 12:00 AM Re: Create ObjectGUID for printers
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
If you looked at his code you would see the script is *really* installing it locally as an IP printer.
Top
#167022 - 2006-09-08 12:58 AM Re: Create ObjectGUID for printers
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Les,
Guess you are right. But if these shared printers do not show up in the AD, I think about that tickbox.

Top
#167023 - 2006-09-08 01:09 AM Re: Create ObjectGUID for printers
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Yes, and Duvander wants his VBS code to set that tickbox but since he is using VBS, he should post to a VBers forum.
Top
#167024 - 2006-09-08 01:20 AM Re: Create ObjectGUID for printers
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Les, you are totally right. Maybe there is also an explanation about Prncnfg.vbs on the Microsoft website.
Top
#167025 - 2006-09-08 01:47 AM Re: Create ObjectGUID for printers
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Ja, well... it's not a KiX question so it does not belong here in the KiX forum. It should be moved to General.
Top
#167026 - 2006-09-08 09:57 PM Re: Create ObjectGUID for printers
Duvander Offline
Fresh Scripter

Registered: 2005-11-07
Posts: 27
I'm sorry that I did place my question in tis forum. Thing is that the code is part of a kix-script but I haven't found any way to really create local printers with kix. Witto, you are right about Tick the "List in directory" tickbox in the sharing tab. Thanks!
I've now found out what i missed in my "VB's lines"... (if anyone is interested)
Code:
SHELL 'cscript %windir%\system32\prncnfg.vbs -t -p "PrinterName" +published'



Les: Sorry again for asking here

Top
#167027 - 2006-09-08 11:03 PM Re: Create ObjectGUID for printers
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
like I already said, look at addprinter():
http://www.kixtart.org/ubbthreads/showflat.php?Cat=0&Number=83350

Top
#167028 - 2006-09-09 09:34 PM Re: Create ObjectGUID for printers
Duvander Offline
Fresh Scripter

Registered: 2005-11-07
Posts: 27
I've looked at that one but I coudn't find anything about sharing the printer-
Thanks anyway

Top
#167029 - 2006-09-09 09:41 PM Re: Create ObjectGUID for printers
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ja, I saw you looking at it.
but don't think you mentioned you need sharing, just that adding a printer was an issue.

Top
#167030 - 2006-09-09 09:47 PM Re: Create ObjectGUID for printers
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
k, change in the $printercmd line the /z switch to /Z (uppercase) and it will share the printer.
Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1188 anonymous users online.
Newest Members
StuTheCoder, M_Moore, BeeEm, min_seow, Audio
17884 Registered Users

Generated in 0.073 seconds in which 0.029 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org