Calling all techies, calling all techies...

News and important info, general banter, and suggestions for 5punk

Moderator: Forum Moderators

Woo Elephant Yeah
Heavy
Heavy
Posts: 5433
Joined: October 10th, 2004, 17:36
Location: Bristol, UK
Contact:

Calling all techies, calling all techies...

Post 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
Fear
Zombie
Zombie
Posts: 2032
Joined: August 6th, 2006, 21:45

Post 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.
Woo Elephant Yeah
Heavy
Heavy
Posts: 5433
Joined: October 10th, 2004, 17:36
Location: Bristol, UK
Contact:

Post by Woo Elephant Yeah »

Brilliant stuff! :clap:

Slight problem though, I cannot find that CD anywhere :cry:
fabyak
Home-made Big Daddy
Home-made Big Daddy
Posts: 5681
Joined: October 14th, 2004, 14:02
Location: Oxford, England

Post 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
Woo Elephant Yeah
Heavy
Heavy
Posts: 5433
Joined: October 10th, 2004, 17:36
Location: Bristol, UK
Contact:

Post by Woo Elephant Yeah »

I was so nearly :ilovehorses:'d then.
Thanks dude, much appreciated, I was havign issues finding that online myself.
fabyak
Home-made Big Daddy
Home-made Big Daddy
Posts: 5681
Joined: October 14th, 2004, 14:02
Location: Oxford, England

Post 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
Woo Elephant Yeah
Heavy
Heavy
Posts: 5433
Joined: October 10th, 2004, 17:36
Location: Bristol, UK
Contact:

Post 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:
Fear
Zombie
Zombie
Posts: 2032
Joined: August 6th, 2006, 21:45

Post 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.
fabyak
Home-made Big Daddy
Home-made Big Daddy
Posts: 5681
Joined: October 14th, 2004, 14:02
Location: Oxford, England

Post 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
Woo Elephant Yeah
Heavy
Heavy
Posts: 5433
Joined: October 10th, 2004, 17:36
Location: Bristol, UK
Contact:

Post 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!
Fear
Zombie
Zombie
Posts: 2032
Joined: August 6th, 2006, 21:45

Post 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.
Woo Elephant Yeah
Heavy
Heavy
Posts: 5433
Joined: October 10th, 2004, 17:36
Location: Bristol, UK
Contact:

Post 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:
Fear
Zombie
Zombie
Posts: 2032
Joined: August 6th, 2006, 21:45

Post 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)
Woo Elephant Yeah
Heavy
Heavy
Posts: 5433
Joined: October 10th, 2004, 17:36
Location: Bristol, UK
Contact:

Post by Woo Elephant Yeah »

Hmm doesn't make any difference it seems, thanks anyway though dude.

/Ninja Edit :lol:
Dr. kitteny berk
Morbo
Morbo
Posts: 19676
Joined: December 10th, 2004, 21:53
Contact:

Post by Dr. kitteny berk »

would something similar be possible dumping to text file using Gonad?
Woo Elephant Yeah
Heavy
Heavy
Posts: 5433
Joined: October 10th, 2004, 17:36
Location: Bristol, UK
Contact:

Post 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!
Dog Pants
Site Moderator
Site Moderator
Posts: 21653
Joined: April 29th, 2005, 13:39
Location: Surrey, UK
Contact:

Post 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
Woo Elephant Yeah
Heavy
Heavy
Posts: 5433
Joined: October 10th, 2004, 17:36
Location: Bristol, UK
Contact:

Post 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?
mrbobbins
Robotic Despot
Robotic Despot
Posts: 4595
Joined: October 14th, 2004, 21:35
Location: Sitting in a tin can
Contact:

Post 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.
Chickenz
Optimus Prime
Optimus Prime
Posts: 1155
Joined: December 8th, 2005, 20:06

Post 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 :)
Post Reply