We help IT Professionals succeed at work.
Get Started

Powershell permissions for remote computers

qvfps
qvfps asked
on
2,066 Views
Last Modified: 2018-02-06
I wrote a powershell script using the following command to gather information about our servers

$os = Get-Ciminstance Win32_OperatingSystem -ComputerName $server

When I run this command as my admin account everything works and I get the information for all of our servers.   I wanted this to run on a schedule so I created a task and set it to run using a service account on our network.   When I run it this way it fails for most of the servers.  

I tried logging on to the server with the service account and manually running the script with the same results.   I checked the permissions on one of the remote servers and as far as I can tell the service account has more privileges than my admin account.   It is in every group that my admin account is plus the backup operators group and a couple more I added when trying to get this to work.  

The server running the script runs Windows 2008r2 and  Windows PowerShell ISE Host  Version          : 5.1.14409.1005.
The servers I am trying to pull the information from run a mix of Windows 2008, 2008r2 and 2012r2.  

Is there an additional permission or setting I need on the service account?   It works for some of the 2008r2 and 2012r2 servers but not all of them and I don't see why.

I know I can get the information I am looking for using Get-WmiObject instead.  I just want to know why the above doesn't work.
Comment
Watch Question
PowerShell Developer
CERTIFIED EXPERT
Top Expert 2010
Commented:
This problem has been solved!
Unlock 1 Answer and 12 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE