Solved

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

Posted on 2011-02-27
13
820 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
  • 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Resolve DNS query failed errors for Exchange
This article runs through the process of deploying a single EXE application selectively to a group of user.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

816 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now