How to find out IP address or any other information within WinRM session?

This topic contains 3 replies, has 2 voices, and was last updated by  Jonathan Warnken 2 years ago.

  • Author
  • #38248



    What uniquely identifiable information available which can be logged from within WinRM session? I need to be able to find out for example log IP address of client which connected to endpoint. I see how I can get username of connected user but is there any other information hidden somewhere in variables (like IP address or hostname of client etc)?

  • #38291

    Jonathan Warnken

    any information you collect locally can be done in the winrm session.
    wmi is a good place to get the info you are after

    $ip=get-WmiObject Win32_NetworkAdapterConfiguration|Where {$_.Ipaddress.length -gt 1} 
    $pcinfo = get-WmiObject win32_computersystem
  • #38296


    I mean I need to know client IP not target IP.
    Client Computer1 connects to WinRM session on Server1. I want within WinRM session on Server1 to find out IP address of Computer1.

  • #38297

    Jonathan Warnken

    Ahh, off the top of my head I am not sure if that available via a built in command. If you have powershell logging enabled you may find the info in the event logs.

You must be logged in to reply to this topic.