Cannot open service control manager

I have numerous servers associated in VPN to my host server. All run windows 7.I"m running in loop Get-Service -ComputerName $server -Name Spooler for each server. For some factor some of them rerevolve the organization efficiently and also some don"t saying Get-Service : Cannot find any type of organization through company name "Spooler". I recognize for 100% that all of them have actually Spooler service.

You watching: Cannot open service control manager

Probably somepoint is configured differently on the servers that fail to rerotate the company. Can someone advise what must I examine for?

windows-7 powershell remote-accessibility
Improve this question
asked Feb 20 "17 at 3:03

15322 silver badges66 bronze badges
Add a comment |

2 Answers 2

Active Oldest Votes
A likely cause is you don"t have sufficient privileges to query services on remote machine. Try without specifying the -Name dispute, eg:

get-service -ComputerName TEST-CLIENTWright here TEST-CLIENT is your server name. And see if you obtain a better error message, eg:

get-service : Cannot open Service Control Manager on computer "TEST-CLIENT". This procedure might need various other privileges.If this turns out to be your worry you deserve to attempt approving remote logon and/or administrator access to your account on the remote machine. Without more details of your setup I can"t provide a much more precise solution.

Improve this answer
edited Feb 20 "17 at 4:33
answered Feb 20 "17 at 4:05

Andy VerhoefAndy Verhoef
8144 bronze badges
Add a comment |
Aside from the privileges problem, I think the next a lot of most likely culprit is that your $server variable is not the correct type.

See more: Each Worksheet In A Workbook Has ____ Columns., How Many Rows And Columns Does Excel Have

Looking in the assist file for Get-Service. We deserve to see that -ComputerName only accepts String worths.

PS C:Temp> Get-Help Get-Service -Parameter Computername -ComputerName ****Gets the solutions running on the stated computer systems. The default is the local computer system.Type the NetBIOS name, an IP resolve, or a totally qualified domain name (FQDN) of a remote computer system. To specify the regional computer, type the computer name, a dot (.), or localorganize.This parameter does not count on Windows PowerCovering remoting. You deserve to use the ComputerName parameter of Get-Service even if your computer system is not configured to run remote commands.Required? falsePosition? namedDefault value NoneAccept pipeline input? True (ByPropertyName)Accept wildcard characters? falseIf you set your $server variable making use of Get-ADComputer, the variable more than likely consists of the object type "Microsoft.ActiveDirectory.Management.ADComputer"

PS C:Temp> Get-ADComputer -Identity AE-HTPC | Get-Member TypeName: Microsoft.ActiveDirectory.Management.ADComputerIf you grab the object and expand out the contents to String then you will certainly have actually a variable that Get-Service deserve to understand also.

PS C:Temp> Get-ADComputer -Identity AE-HTPC | Select-Object - ExpandProperty Name | Get-Member TypeName: System.String......

Results Replicated...

See more: How To Fix Windows Startup Repair Error Code 0X490, How To Easily Fix Error Code 0X490

*PS C:Temp> $server = Get-ADComputer -Identity AE-HTCOMPUTER PS C:Temp> Get-Service -ComputerName $server Get-Service : Cannot open Service Control Manager on computer system "CN=AE- HTCOMPUTER,OU=HTPC,OU=Workstations,OU=All Clients,DC=ae,DC=kingdom,DC=com". This procedure could call for other privileges. At line:1 char:1 + Get-Service -ComputerName $server + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo : NotSpecified: (:) , InvalidOperationException+ FullyQualifiedErrorId : System.InvalidOperationException,Microsoft.PowerCovering.Commands.GetServiceCommand also PS C:Temp> $server = Get-ADComputer -Identity AE-HTPC | Select-Object -ExpandProperty name PS C:Temp> Get-Service -ComputerName $server Status Name DisplayName ------ ---- ----------- Stopped AdobeFlashPlaye... Adobe Flash Player Update Service Stopped AJRexternal AllJoyn Rexternal Service* I hope this answer isn"t too thorough. It"s my first one. Let me understand if it helps.