none
get-wmi not showing sharing printer on remote systems RRS feed

  • Question

  • Hi all,

    I am writing a power-shell script to list all the printers available on remote systems in our network. To compare I have taken the result on a remote machine and my local machine. The issue is there are two shared printers that will be available in all the systems(Shown with pointer in the image).

    \\10.XX.XX.XX\Canon MF4700 UFRII LT XPS \\XXXXXXXXXXXXXX  Canon MF4700 UFRII LT XPS

    \\10.XX.XX.XX\Canon MF4700 UFRII LT XPS \\XXXXXXXXXXXXXX  CanonN   

    These are not showing up in the remote machine. Where I am doing wrong. Please help me out guys!!!!

    $Class = "win32_printer" 
    $arrayComp = "10.XX.XX.XX" , "10.YY.YY.YY"
    foreach ($machine in $arrayComp) { 
    Get-WmiObject -class $Class -computername $machine |`
    ft name, systemName, shareName -auto  } 


    Naveen Basati

    Monday, March 30, 2015 12:24 PM

Answers

  • Hi Bill,

    Thanks for the answer. Could you please help me out in accomplishing it, so that I can list all the printers....


    Naveen Basati

    What Bill is telling you is that this cannot be done.  You cannot know what printer a user has mapped.  Only the user can know this. 


    ¯\_(ツ)_/¯

    • Marked as answer by BASATI Wednesday, April 8, 2015 8:44 AM
    Tuesday, March 31, 2015 4:45 AM

All replies

  • If you connect to a printer in your profile, that printer connection is stored in HKEY_CURRENT_USER. So it will not appear if you query a remote computer.


    -- Bill Stewart [Bill_Stewart]

    • Proposed as answer by jrv Monday, March 30, 2015 2:19 PM
    Monday, March 30, 2015 2:16 PM
    Moderator
  • Hi Bill,

    Thanks for the answer. Could you please help me out in accomplishing it, so that I can list all the printers....


    Naveen Basati

    Tuesday, March 31, 2015 3:57 AM
  • Hi Bill,

    Thanks for the answer. Could you please help me out in accomplishing it, so that I can list all the printers....


    Naveen Basati

    What Bill is telling you is that this cannot be done.  You cannot know what printer a user has mapped.  Only the user can know this. 


    ¯\_(ツ)_/¯

    • Marked as answer by BASATI Wednesday, April 8, 2015 8:44 AM
    Tuesday, March 31, 2015 4:45 AM