Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 872
  • Last Modified:

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

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
Ikelca
Asked:
Ikelca
  • 6
  • 4
3 Solutions
 
for_yanCommented:
You can use Runtime.getRuntime.exec("net  view \\\\print_server_name");
0
 
for_yanCommented:

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
 
IkelcaAuthor Commented:
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
for_yanCommented:


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
 
for_yanCommented:

Stiil, I think in this API it will discover only local printer
0
 
IkelcaAuthor Commented:
so i guess there is no way to implement this idea in java ?
0
 
for_yanCommented:
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
 
IkelcaAuthor Commented:
it seems only you and me here lol~~
0
 
for_yanCommented:
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
 
pcsmitpraCommented:
Please view here , a similar script was discussed.
0
 
IkelcaAuthor Commented:
cant find working solution, decided to go with c# instead of java
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

  • 6
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now