none
PSRemoting - Reading registry key value RRS feed

  • Question

  • PSRemoting - Reading registry key value

    Wednesday, February 7, 2018 3:08 PM

Answers

  • Firewall!

    Please fix the title of your question and fill in the question text in your first post.

    Also - to test remoting

    Test-WsMan

    help Test-WsMan -online
    help about_Remote_Requirements


    \_(ツ)_/

    • Marked as answer by Gudakesh (GD) Friday, February 9, 2018 8:19 AM
    Friday, February 9, 2018 8:00 AM

All replies

  • You must be an Administrator for all of these methods.  None of the methods listed are WMI methods.

    Remote registry access must be running and opened through the firewall.

    Get-ItemProperty cannot be used remotely without running a remote session.


    \_(ツ)_/

    Wednesday, February 7, 2018 3:20 PM
  • They won't work remotely if the registry service is not running.

    Without more accurate info this is pointless.


    \_(ツ)_/

    Wednesday, February 7, 2018 3:28 PM
  • I recommend managing your antivirus software using the tool(s) provided by the vendor (including reporting) rather than trying to script this. There is no point in reinventing the wheel.

    -- Bill Stewart [Bill_Stewart]

    Wednesday, February 7, 2018 5:03 PM
    Moderator
  • You still have failed to show your code and the exact error.


    \_(ツ)_/

    Wednesday, February 7, 2018 8:05 PM
  • Hi jrv,

    Please find the details below :

    Method1:-

    CMDLET - Invoke-Command -ComputerName 'ServerName' -Scriptblock {Get-itemproperty hklm:\software\Mcafee\AVEngine} -credential "Domain Admin"

    ERROR -  - Connection to the remote server 'ServerName' faield with following error message : WinRM cannot complete the operation, verify that computername is valid, that computer is accessible over network, and that a firewall exception for WinRM is enabled and allows access from this computer.

    With error above, I have checked that PSremoting is enabled on both the servers(source,target).

    When I try to telnet however it says connection failed

    (from server1 I try - "telnet server2 5895"). Is that the reason my cmd isn't working?

    Method2:-

    $key = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('localmachine', 'Server2')

    There is no error with method 2, however the variable $key contains nothing.

    I have recently started working with Remoting with powershell and I am in my learning phase. Could you please help learning what all needs to be enabled and is required in terms of Restrictions\Connections to let Powershell talk amongst servers on the same domain successfully.(Any site\doc you can refer me to would be great.)


    GD

    Friday, February 9, 2018 7:25 AM
  • Firewall!

    Please fix the title of your question and fill in the question text in your first post.

    Also - to test remoting

    Test-WsMan

    help Test-WsMan -online
    help about_Remote_Requirements


    \_(ツ)_/

    • Marked as answer by Gudakesh (GD) Friday, February 9, 2018 8:19 AM
    Friday, February 9, 2018 8:00 AM
  • Thanks a Lot jrv.

    you best!


    GD

    Friday, February 9, 2018 8:19 AM
  • Hi Jrv,

    Need further help please

    What we have here is multiple VLANs and within each VLAN there are multiple Win2k8 and Win2k12 servers

    For instance - VLAN01 :

    Win2012Server1 to Win2012Server2 - works fine (PSremoting enabled by default)

    Win2012Server1 to win2008server2 - works (after enabling PSremoting on win2008server2 )

    It got me thinking over the Winrm service and the port its using. Websites say it uses port 5895\5896 however when I try to telnet these ports from Server1 to server2 , it doesn't work.

    Then I looked for Winrm service PID on one of the server and used netstat -ano to see which port the PID is listening on. - This did not help because when I telnet localhost with the respective port, it doesn't telnet.

    Could you help me find out which Port powershell is using after enabling-psremoting so I can open that port on all the VLANs and do you think it after doing so, my Server1 will be able to remote into any other server irrespective of any VLAN.

    What we are trying to achieve is have Server1 open to remote into any Server irrespective of VLAN.

    Thank you for all the advice you can give please


    GD

    Friday, February 9, 2018 11:51 AM
  • Test-WsMan

    Test-WsMan

    Test-WsMan

    help Test-Wsman -Online

    Please reread the documentation and get the ports right.  You cannot test with Telnet to the wrong ports.

    We cannot help you fix your network so the VLAN info is not useful in this forum.  Talk to you network admins or techs for help with your network.


    \_(ツ)_/

    Friday, February 9, 2018 12:28 PM