Page 1 of 2

Calling all techies, calling all techies...

Posted: October 30th, 2006, 14:24
by Woo Elephant Yeah
Anybody here know how to export a list of shared windows printers along with their Location, Comments details into a spreadsheet file such as *.csv or *.xls?

I really really don't want to type this out manually for over a hundred printers, and I'm pretty sure you guys would have had to do this at some point in your career.

If it helps, we have Active Directory and the printers are installed on a clustered 2003 server, but I assume that should make no odds.

Thanks in advance

Posted: October 30th, 2006, 14:34
by Fear
On the "Windows 2000 Server Resource Kit Supplement" CD there is a vbs script named share.vbs.

You want this.

Code: Select all

The Kit Supplement contains Share.VBS, which can list, create, or delete shares from a local or remote computer. The syntax is:

1.  Share.vbs /L [/S <server>] [/U <username>] [/W <password>]
                 [/O <outputfile>]
2.  Share.vbs /C /N <name> /P <path> [/T <type>] [/V <description>]
             [/S <server>] [/U <username>] [/W <password>]
             [/O <outputfile>]
3.  Share.vbs /D /N <name>
             [/S <server>] [/U <username>] [/W <password>]
             [/O <outputfile>]

PARAMETER SPECIFIERS:
   /L            Lists all shares on a machine.
   /C            Creates a share on a machine.
   /D            Deletes a share from a machine.
   name          Name of the share to be created or deleted.
   path          Path of the share to be created.
   description   A description for the share.
   type          Type of the share to be created. Must be one
                 one of Disk, Printer, IPC, Special.
   server        A machine name.
   username      The current user's name.
   password      Password of the current user.
   outputfile    The output file name.

EXAMPLE:
1. cscript Share.vbs /l /s MyMachine2
   List the shares on the machine MyMachine2.
2. cscript Share.vbs /c /n scratch /p c:\scratch /t Disk /v "Scratch Directory"
   Creates a file share called "scratch" on the local machine.
3. cscript Share.vbs /d /n scratch /s MyMachine2.
   Deletes the share named "scratch" on the machine MyMachine2.

Posted: October 30th, 2006, 15:15
by Woo Elephant Yeah
Brilliant stuff! :clap:

Slight problem though, I cannot find that CD anywhere :cry:

Posted: October 30th, 2006, 16:25
by fabyak
Had to use Google to find the bloody things on M$'s website but here be downlaods of said resource kit tools :)

http://download.microsoft.com/download/2/0/C/20C1B0F7-B803-4BAB-BA2F-27DDCADAD68E/sp4supporttools.exe

Otherwise this should do it

Posted: October 30th, 2006, 16:45
by Woo Elephant Yeah
I was so nearly :ilovehorses:'d then.
Thanks dude, much appreciated, I was havign issues finding that online myself.

Posted: October 30th, 2006, 16:47
by fabyak
Pleasure :) both for the attempted horseying and the link, I remember it being a bitch to find when I last wanted it too

Posted: October 30th, 2006, 16:56
by Woo Elephant Yeah
Hmmm, that exe doesn't seem to contain the share.vbs script mentioned above :cry:
I've searched the entire hard drive and install directories, and can't find it anywhere?

Damn Microsoft, damn them to hell :x :lol:

Posted: October 30th, 2006, 16:59
by Fear
It comes with the supplement CD so perhaps wont be in the 'free' M$ downloads.

I'll see if I can dig out the script from anywhere, gotta find the cd first.

Posted: October 30th, 2006, 17:13
by fabyak
This may be what you're after

http://www.microsoft.com/windows2000/do ... tools.mspx

*WARNING* THE ABOVE LINK DOES NOT CONTAIN HORSES

ARSE, and looks like it may be the same thing

Posted: October 31st, 2006, 15:15
by Woo Elephant Yeah
Looks like I'm an hour away from giving up and typing this thing out manually :cry: :cry: :cry:

Damn you Microsuck, damn you!

Posted: October 31st, 2006, 15:17
by Fear
Try sitting on the server which shares the printers and typing:

Code: Select all

net share
This will give you a list you can cut and paste and will probably be a lot quicker than hand writing them. It does not exclude non-printer shares tho.

Code: Select all

Share name   Resource                        Remark

-------------------------------------------------------------------------------
print$       C:\WINDOWS\system32\spool\drivers
                                             Printer Drivers
C$           C:\                             Default share
ADMIN$       C:\WINDOWS                      Remote Admin
IPC$                                         Remote IPC
EPSON880     USB001                 Spooled  EPSON Stylus COLOR 880
The command completed successfully.

Posted: October 31st, 2006, 15:21
by Woo Elephant Yeah
Thanks mate, that's something so simple, I never would have thought of it.
At least it makes things slightly easier by having to just edit stuff, and not completely populate the list. :clap:

Damn you Microsuck for truncating my results! :lol:

Posted: October 31st, 2006, 15:26
by Fear
Woo Elephant Yeah wrote:Damn you Microsuck for truncating my results! :lol:
Right click on the command window icon, properties.

Then set the buffer size here (in # of lines) which you need to be able to see all your results. Should make it a little easier.

(edit: layout tab not options tab)

Posted: October 31st, 2006, 15:43
by Woo Elephant Yeah
Hmm doesn't make any difference it seems, thanks anyway though dude.

/Ninja Edit :lol:

Posted: October 31st, 2006, 16:29
by Dr. kitteny berk
would something similar be possible dumping to text file using Gonad?

Posted: October 31st, 2006, 17:24
by Woo Elephant Yeah
Managed to cheat and print screen to tiff, then OCR the files and save them as a spreadsheet.

Hoorah for overly complicated methods of doing simple things!

Posted: October 31st, 2006, 18:20
by Dog Pants
Woo Elephant Yeah wrote:Hoorah for overly complicated methods of doing simple things!
Hooray! Have you ever considered a career in the military? :P

Posted: May 29th, 2007, 14:50
by Woo Elephant Yeah
Cast Resurrect Thread Level 111eleventyone!

I need to do the same thing again, and I'm really reluctant to save printscreens and OCR them again :lol:

Anyone have any other suggestions, as I still can't find that Share.vbs script Fear mentioned anywhere. :above:

Surely there must be an easy way to output every printer on a file and print server into a file in some way? I'm googled out, but I wondered if any of you techies new any decent sites for posting questions such as this?

Posted: May 29th, 2007, 15:14
by mrbobbins
Have you tried just not doing it?

This usually works when I don't know how/can't be bothered to do something.

Posted: May 29th, 2007, 16:32
by Chickenz
I'm a Weapons Technician if that helps Woo?!?!

I'm sure I could get some PE4 if you want to blow it up :)