troubleshooting Question

Powershell permissions for remote computers

Avatar of qvfps
qvfps asked on
PowershellMicrosoft Server OS
12 Comments1 Solution2068 ViewsLast Modified:
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.
ASKER CERTIFIED SOLUTION
Chris Dent
PowerShell Developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Top Expert 2010

The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.

Join our community to see this answer!
Unlock 1 Answer and 12 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 12 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros