0

I need your help.

I have the username or ip address and I need the computer name. How can I get the computer name with this information. Please help me.

I had tried this, but it was not successful:

Invoke-Command -ComputerName x.x.x.x -ScriptBlock {$env:COMPUTERNAME}

boxdog
  • 7,894
  • 2
  • 18
  • 27
  • Could you elaborate on `but not successful`? Do you get any errors? What kind of environment is this? – notjustme Jan 26 '21 at 09:54
  • "*I have **username** or ıp address*", forget `username`, there is no common relationship between the user and the computer. In essence, any user can login to any computer. (You might have a customized relation, but you need to elaborate on that too if you want us to help you with that.) – iRon Jan 26 '21 at 10:12
  • Hi, Thanks for your help, I ' ve this error + CategoryInfo : OpenError: (10:String) [], PSRemotingTransportException + FullyQualifiedErrorId : CannotUseIPAddress,PSSessionStateBroken – 3xploiter Jan 26 '21 at 10:36

1 Answers1

0
ping -a 111.222.333.444

The name should appear in the output enter image description here

Jossnix
  • 306
  • 1
  • 5