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

Welcome Forums General PowerShell Q&A 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

 
Participant
2 years, 6 months ago.

  • Author
    Posts
  • #38248
    GS

    Participant
    Points: 1
    Rank: Member

    Hello,

    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

    Participant
    Points: 0
    Rank: Member

    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} 
    $ip.ipaddress[0] 
    
    $pcinfo = get-WmiObject win32_computersystem
    $pcinfo.Name
    
  • #38296
    GS

    Participant
    Points: 1
    Rank: Member

    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

    Participant
    Points: 0
    Rank: Member

    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.

The topic ‘How to find out IP address or any other information within WinRM session?’ is closed to new replies.