473,382 Members | 1,786 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

WMI - shared remote printer on remote machine

The following WMI code only retrieves the list of local shared printers on a
target machine but NOT the list of shared REMOTE printers.
Any suggestions please?
string strWapiServer = "\\\\" + txtServerName.Text;
// Use the ObjectQuery to get the list of configured printers
System.Management.ObjectQuery oquery =
new System.Management.ObjectQuery("SELECT * FROM
Win32_Printer");

ConnectionOptions options = new ConnectionOptions();
ManagementScope myScope = new ManagementScope(strWapiServer +
"\\root\\cimv2", options);

System.Management.ManagementObjectSearcher mosearcher =
new System.Management.ManagementObjectSearcher(myScope ,
oquery);

System.Management.ManagementObjectCollection moc =
mosearcher.Get();

foreach (ManagementObject mo in moc)
{
System.Management.PropertyDataCollection pdc = mo.Properties;
cboPrinters.Items.Add(pdc["DeviceID"].Value.ToString());
}
Oct 2 '08 #1
0 1740

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Mike MacSween | last post by:
My client has an MS Access database application on her local machine. I have full access to that in terms of changing the design. I've got a simple PHP/MySql application on shared hosting, so no...
2
by: Daniel | last post by:
when i use stream writer to write to a shared folder, and the network card of that remote computer is disabled in the middle of the write then reenabled later. every time i try to write to that...
5
by: Bill Gates | last post by:
Hello, I am having a little trouble accessing a list of printers on our Network through a web service... I am using the PrinterSettings.InstalledPrinters to access a list of printers installed...
11
by: Brett | last post by:
I have an assembly on a shared LAN drive. On my developer machine, I give that assembly full trust from the .NET wizard. It works fine. I go to a user machine on the LAN, map to the shared...
1
by: kimpton | last post by:
Hi, I'm trying to create a library of shared code, some of which are ascx and aspx files. I'm pretty much following the procedure outlined in...
4
by: Gregory Gadow | last post by:
I've cobbled together a PrinterClass that takes a text file and dumps it to a printer. The app using is has multiple threads, all of which need access to a shared instance. Can someone point me to...
56
by: peng | last post by:
Hi, I am development a project using C#.Net. Inside application, it needs to print labels on different Zebra label printers on the network. I used a shell script, but it only worked on the...
1
by: sathyp | last post by:
Public Function SetPrinterDefaultsW(ByVal sPrinterName As String, _ ByVal nPaperSize As Long, ByVal nOrientation As Long) As Boolean Dim Prn As Printer Dim hPrinter As Long Dim pd As...
1
by: =?Utf-8?B?UHJhZGVlcCBFYXJsYQ==?= | last post by:
Hi I am having one windows application on my local machine and I want to display the folders(shared folders) of remote machine in tree view control of my win application. I haved added me as...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.