Answered by:
Get-Service cmdlet basic question

Question
-
When using Get Service to get the services on a remote computer, you can't use a DNS CName?
See my results below, both highlighted computer names are the same server, first one VPM-APP is a CName, the second, NYVPM01 is the hostname
PS C:\Users\adm> Get-Service -Computer VPM-APP
Get-Service : Cannot open Service Control Manager on computer 'VPM-APP'. This operation
might require other privileges.
At line:1 char:1
+ Get-Service -Computer VPM-APP.xxx.xxx.com
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-Service], InvalidOperationException
+ FullyQualifiedErrorId : System.InvalidOperationException,Microsoft.PowerShell.Commands.GetServiceCommand
PS C:\Users\adm> Get-Service -Computer NYVPM01
Status Name DisplayName
------ ---- -----------
Running <<NOT_SET>> <<NOT_SET>>
Stopped AeLookupSvc Application Experience
Running al_agent AL Agent
Stopped ALG Application Layer Gateway Service
Running AppHostSvc Application Host Helper Service
Stopped AppIDSvc Application Identity
Stopped Appinfo Application Information
Etc...
Friday, January 12, 2018 2:19 AM
Answers
-
Also, as I noted above, you cannot use an "alias". An alias is created using a CNAME record. These are not recognized by the AD portion of validation partly because there is no reverse pointer record and the name does not resolve in AD. If you must use a different name it must be ab "A" record with an IP.
\_(ツ)_/
- Marked as answer by Willmeister Tuesday, January 16, 2018 9:23 PM
Friday, January 12, 2018 2:47 AM
All replies
-
You must use the DNS name registered to AD. Aliases are not allowed.
The DNS name is the "CN" of the computer object plus the AD domain name.
This is not an issue. It is by design.
\_(ツ)_/
Friday, January 12, 2018 2:32 AM -
For Get-Service which uses WMI I can create an alias record for the computer and the command works correctly. This makes it hard to in derstand what you are trying to post.
For many commands that use Kerberos and WinRM the DNS record can be an issue. It must, at time, match the computer certificate subject.
\_(ツ)_/
Friday, January 12, 2018 2:41 AM -
Also, as I noted above, you cannot use an "alias". An alias is created using a CNAME record. These are not recognized by the AD portion of validation partly because there is no reverse pointer record and the name does not resolve in AD. If you must use a different name it must be ab "A" record with an IP.
\_(ツ)_/
- Marked as answer by Willmeister Tuesday, January 16, 2018 9:23 PM
Friday, January 12, 2018 2:47 AM -
Hi,
Based on the tests in my lab, we can use CNAME for ComputerName parameter in Get-Service cmdlet. I suppose this may be a permission issue, have you tried run the command as domain admins? The following related thread for your reference:
Remote Get-Service as Normal user require other privileges
https://social.technet.microsoft.com/Forums/en-US/24d5c01f-f6b7-4e06-b2e1-7cc16c4f1ad5/remote-getservice-as-normal-user-require-other-privileges?forum=winserverpowershell
If you need further help, please feel free to let us know.
Best Regards,
AlbertPlease remember to mark the replies as an answers if they help.
If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.comMonday, January 15, 2018 1:08 AM -
Awesome thanks. Just needed verification to tell the developer..Tuesday, January 16, 2018 9:24 PM