title: Unable to get the IP Address of network printer?
body: <p>I need to find the IP address of the installed printers on my laptop. I move my laptop between different locations and networks. Each network has its own set of ip addresses. The laptop has different printers installed for each location with all connections being made wirelessly.</p>
  
  <p>In using the below code (.net 4.0), the QueuePort.Name returns:</p>
  
  <p>WSD-27e3f972-cdc7-459d-b0c1-20e8410fb1db.0032 and</p>
  
  <p>192.168.1.12_1</p>
  
  <p>Since these are network printers, I assume these have to resolve to a real IP Address?? </p>
  
  <p>Where am I going wrong?  Or is there a better way? <em>Any help is really appreciated.</em></p>
  
  <pre><code> IEnumerable&lt;Printer&gt; GetLocalPrinters()
      {
          EnumeratedPrintQueueTypes[] enumerationFlags = { EnumeratedPrintQueueTypes.Local, EnumeratedPrintQueueTypes.Connections };
          LocalPrintServer printServer = new LocalPrintServer();
  
          var x = printServer.GetPrintQueues(enumerationFlags).Select(y =&gt;
              new Printer
              {
                  Fullname = y.FullName,          
                  QueuePortName = y.QueuePort.Name,
                  Location = y.Location
              })
              .OrderBy( z =&gt; z.QueuePortName);
  
          return x;
  
      }
  </code></pre>