Solved

how to list and map network printer in Active Directory using java

Posted on 2011-02-27
13
836 Views
Last Modified: 2013-11-24
hi,

is that possible to list network printers in AD and connect it to local machine when a button clicked?
I am wondering if this could be done in java. and if yes, can you please give me some ideas?

thanks
0
Comment
Question by:Ikelca
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
13 Comments
 
LVL 47

Expert Comment

by:for_yan
ID: 34993879
You can use Runtime.getRuntime.exec("net  view \\\\print_server_name");
0
 
LVL 47

Accepted Solution

by:
for_yan earned 334 total points
ID: 34993888

You can check this page which talks about it:

http://www.thatsjava.com/java-essentials/2240/

Then you need to capture output and anlyze it

Connect to local machine - that's next step you can do in the same
way using command
Runtime.getRuntime().exec("net use lpt: \\\\server_name\\printer")
0
 

Author Comment

by:Ikelca
ID: 34993945
it seems that link has no answers either, net view or net use commands are OS dependent.  
im wondering if there is any API that we can use.
0
Flexible connectivity for any environment

The KE6900 series can extend and deploy computers with high definition displays across multiple stations in a variety of applications that suit any environment. Expand computer use to stations across multiple rooms with dynamic access.

 
LVL 47

Expert Comment

by:for_yan
ID: 34993963


Java printing API does have a part which is called Printer discovery - maybe it will help:
http://java.sun.com/products/java-media/2D/forDevelopers/sdk12print.html
0
 
LVL 47

Expert Comment

by:for_yan
ID: 34993971

Stiil, I think in this API it will discover only local printer
0
 

Author Comment

by:Ikelca
ID: 34994005
so i guess there is no way to implement this idea in java ?
0
 
LVL 47

Expert Comment

by:for_yan
ID: 34994026
Well, never say never, maybe someone will still come up with some idea
Probably, for now if you just check the system and do some system specific discovery - maybe it is more practical
0
 

Author Comment

by:Ikelca
ID: 35019853
it seems only you and me here lol~~
0
 
LVL 47

Assisted Solution

by:for_yan
for_yan earned 334 total points
ID: 35020156
I guess you can RequestAttention.
Because once the question is a little bit old - and only those who chimed in before are
by default informed about, say, your additinal posting to it, so probability
someone else to rememeber is quite low.
I'm not sure,  as I'm rather new here myself,
but I think Request Attention may help to get more folks reminded
0
 
LVL 15

Assisted Solution

by:pcsmitpra
pcsmitpra earned 166 total points
ID: 35181803
Please view here , a similar script was discussed.
0
 

Author Closing Comment

by:Ikelca
ID: 35341462
cant find working solution, decided to go with c# instead of java
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
Active Directory security has been a hot topic of late, and for good reason. With 90% of the world’s organization using this system to manage access to all parts of their IT infrastructure, knowing how to protect against threats and keep vulnerabil…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This video teaches viewers about errors in exception handling.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question