?
Solved

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

Posted on 2011-02-27
13
Medium Priority
?
858 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 1336 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
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
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 1336 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 664 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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

A hard and fast method for reducing Active Directory Administrators members.
Microsoft Office 365 is a subscriptions based service which includes services like Exchange Online and Skype for business Online. These services integrate with Microsoft's online version of Active Directory called Azure Active Directory.
The viewer will learn how to implement Singleton Design Pattern in Java.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

752 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