Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Need to use -credential in get-wmiobject

$
0
0

Hi,

I would like to remotely enumerate printers on our 2012r2 print server from a Windows 7 box. I am logged into the Win7 box with a domain account that is in the local admins group on the print server. When I:

  get-wmiobject -class "Win32_Printer" -computer printserver.college.edu

I get the dreaded 0x80070005 access denied. If I add "-credential DOMAIN\user" (where DOMAIN\user is the account I am already logged into the Windows 7 box with) and enter my password when prompted, it works fine (so I am sure DOMAIN\user has the proper authority on the print server to do this). I've tried this from the PowerShell console/command line as well as in the ISE with the same results.

What's going on here? Thanks, Tony


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>