Change WinRM AllowUnencrypted Value to True

Hello, the customer needs to change the value of "AllowRemoteAccess" to be true, please help to check what the change means(false to ture). I wrote the following script to change the value, but it cannot be changed,  why? thank you.  

<PS C:\Windows\system32> Get-ChildItem WSMan:\localhost\Service\

WSManConfig: Microsoft.WSMan.Management\WSMan::localhost\Service

Type Name SourceOfValue Value

System.String RootSDDL O:NSG:BAD:P(A;;GA;;;BA)(A;;GXGR;;;S-1-5-21-2906060012…
System.String MaxConcurrentOperations 4294967295
System.String MaxConcurrentOperationsPerUser 1500
System.String EnumerationTimeoutms 240000
System.String MaxConnections 300
System.String MaxPacketRetrievalTimeSeconds 120
System.String AllowUnencrypted false
Container Auth
Container DefaultPorts
System.String IPv4Filter *
System.String IPv6Filter *
System.String EnableCompatibilityHttpList… false
System.String EnableCompatibilityHttpsLis… false
System.String CertificateThumbprint
System.String AllowRemoteAccess true

PS C:\Windows\system32> winrm set winrm/config/service ‘@{AllowUnencrypted = “true”}’
Message = The system cannot find the file specified.

Error number: -2147024894 0x80070002
The system cannot find the file specified.
PS C:\Windows\system32> Set-Item WSMan:\localhost\Service\AllowUnencrypted -Value $true -Force
Set-Item : The system cannot find the file specified.
At line:1 char:1

  • Set-Item WSMan:\localhost\Service\AllowUnencrypted -Value $true -Forc …
  •   + CategoryInfo          : NotSpecified: (:) [Set-Item], InvalidOperationException
      + FullyQualifiedErrorId : System.InvalidOperationException,Microsoft.PowerShell.Commands.SetItemCommand>

@jasonrobertson @jefferyhayes

Hi Ben, welcome to the forum :wave:

You will get this error if you run the command using an account with insufficient rights.
Please try running the command in an elevated prompt.

As a note for future posts, please use the pre-formatted text button </> to post code and errors. It helps with readability and makes it easier for forum users to copy and paste your code for testing. Thanks.