Executing the PowerShell Get-Hotfix cmdlet on a remote server

Sert1k 0 Reputation points
2023-09-21T16:52:22.5366667+00:00

Tell me, please, what is the logic of the Get-Hotfix cmdlet with the -ComputerName parameters and, in general, the whole process of accessing the remote server?

I need to contact a non-domain server to get information on the currently installed updates.

I successfully get this using the "Get-Hotfix -ComputerName Server -Credential $Cred_Administrator" command

In the $Cred_Administrator variable I enter the account of the built-in local administrator.

If I create a new user and grant him local administrator rights, then by specifying his data, I already get the "Access Denied" response.

The first question - why? What advantage does the built-in administrator have in this case from the newly created system administrator?

If I change the WinRM settings (reduce security quite a lot), then the command is executed for new local administrators as well. However, I don't want to downgrade security if there are other options.

The second question is why the account should be in local administrators? Doesn't the "Remote Management Users" group make it possible to run remote commands on a server? This Get-Hotfix cmdlet is executed with the least rights when logging in interactively. Remote access to the server is allowed, rights are granted through this group, what is missing?

Windows for business | Windows Server | User experience | PowerShell
Windows for business | Windows Server | User experience | Other
{count} votes

6 answers

Sort by: Most helpful
  1. khov vannak 0 Reputation points
    2023-10-13T18:35:20.9766667+00:00

    CategoryInfo : ConnectionError: (:) [New-CimSession], CimException

    FullyQualifiedErrorId៖ HRESULT 0x80338126,Microsoft.Management.Infrastructure.CimCmdlets.NewCimSessionCom

    mand

    PSComputerName : Khov vannak

    ----- administrator group members to verify that the admin user is a member------

    AccountType Caption Domain SID FullName Nam

    e:Khov vannak


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.