Finding env:\computername through IP address of a remote computer on the network
I am a beginner in Powershell and as my internship project, I have to write a script for hardware/software inventory of the systems on the network.
The issue which I am not able to resolve is that instead of having the names of all the computers in the text file computer.txt as mentioned by you, I have a text file having the IP Addresses of all the systems on the network.
In most of the scripts that I have come across, the code is
$name = (Get-Item env:\Computername).Value
Now, when I am tweaking my script accordingly, the $name only returns the value of the system I am working on (localhost).
Please help me with this. How can I use IP Addresses to gather information of the systems.
PS - I am attaching a small code of how I have been proceeding below. And the text file containing the ip addresses
$arrComputers = get-Content -Path "D:\Work\computerlist.txt"
foreach ($strComputer in $arrComputers)
$name=(get-item env:\computername).value
$ipadd=([system.net.dns]::gethostaddresses($strComputer))
$hostname=([system.net.dns]::gethostentry($ip)).hostname
$network = Get-WmiObject -class Win32_NetworkAdapterConfiguration -ComputerName $name -Authentication PacketPrivacy -Impersonation Impersonate
foreach ($objItem in $network)
Write-host "======== info starts here ======================= "
Write-host "IP Address:" $ipadd
Write-host "Host Name: " $hostname
Write-host "MAC Address : " ($objItem).MACAddress
Write-host "DNS Domain : " ($objItem).DNSDomain
Write-host "======== info ends here ======================="
computerlist.txt file contain addresses as follows:
10.208.35.7
10.208.35.9
10.208.35.10
10.208.35.12
10.208.35.13
10.208.35.16
10.208.35.17
10.208.35.25
10.208.35.36
10.208.35.37
Please provide me with a solution
Thanks.
What is this line in your script doing?
$hostname=([system.net.dns]::gethostentry($ip)).hostname
[string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
Similar Messages
-
I'm trying to connect a LAN printer, HP Color Laser Jet 3800dn, through a Time Capsule but no one on the network can see it. The printer works fine if I connect it directly to my iMac. Any suggestions?
Hi Clark
There is a good chance the printer is just getting auto IP internally..
Plug it into your TC. And then set to dhcp via the controls on the printer.
If you know the name of the printer it should be immediately available to the network.. but anyway, you can find its IP by printing out the test page. That will also give you the network name.
Most later HP printers have web access to the print servers.. just type the ip into your browser and see if it comes up.
From the Mac, you should then be able to set it up via the printer preferences. Most HP will just appear.. but if not you should perhaps delete the local version and then check again for network printers. -
I had a free trial of Adobe CC on my mac at home, which I since uninstalled
. Later, I purchased on the PC I use at work with a Different email address than home. I have not been able to install at home. When I log in the email address is preprinted and I cannot change it to the other one that I used when I made the purchase. Also the time for the email that was sent when I joined has expired. I tried changing the email and password at home and have only been able to get access to another free trial.If you are facing issue with changing the email address your Home mac computer, then you may try below steps once.
Click Gear icon on the top Right corner and Quit Creative Cloud App
Click on Finder and then hold Command + Shift + G keys on your keypad
It will open Go to folder window, type exactly ~/Library and click on Go
Then open Application Support > Adobe > OOBE folders
Delete opm.db file.
Then relaunch Creative Cloud App and check if you are sign in page. -
I'm trying to better understand Mac's with respect to networking. It seems that my computer should know the IP address of ever system listed on the Local Area Network, but all I see is the system name. Is there a way to determine the IP address also?
I have tried using "Get Information", but that produces no useful data.I'm trying to better understand Mac's with respect to networking. It seems that my computer should know the IP address of ever system listed on the Local Area Network, but all I see is the system name. Is there a way to determine the IP address also?
I have tried using "Get Information", but that produces no useful data. -
Finding another computer on the network
I just got my very first mac 2 days ago, it's a mac book pro 15 inch and I wanna know how to find my PC over the network with OS X 10.6 snow leopard?? i'm not familiar with OS X very well soooo help me lol
[This read will help you get going|http://support.apple.com/kb/HT1549]. Read the Mac to Mac part first. Eventually, you will get to the Mac to PC part.
Message was edited by: donv (The Ghost)
Message was edited by: donv (The Ghost) -
I keep getting the message that another device on the network is using my IP address. I have no other devices except for an IPhone. What should I do?
Turn the iPhone off ... turn it back on again.
-
I can not find printer code on hp 8600pro ,which item is it on the network conf. page
wind vista,hp officejet pro 8600. tried the find printer code ,in setup no :web Service: icon to choose
Hello gator68,
The Web Services icon should be located on the printers home screen on the display. It should be located across the top bar and look like a piece of paper with circles behind it. You should be able to select this and follow the onscreen instructions to enable Web Services and print a registration page (as long as you are connected to the internet).
If you have any questions you can reply to this post and I will try to assist you further.
If I have solved your issue, please feel free to provide kudos and make sure you mark this thread as solution provided!
Although I work for HP, my posts and replies are my own opinion and not those of HP. -
How do I find my printer's email address?
How do I find my printer's email address?
I downloaded and read the manual for you. It says...
Find your
ePrint email address.
a. Press the ePrint button on the control panel. You will see the web services Settings menu on the printer
display.
b. Select Display Email Address from the printer display to view the printer’s email address.
Say thanks by clicking the Kudos Thumbs Up to the right in the post.
If my post resolved your problem, please mark it as an Accepted Solution ...
I worked for HP but now I'm retired! -
I have tried to search for a similar issue, but haven't had any success yet. I doubt I'm the first with this problem!
The computer is XP SP3, the printer is Deskjet 3050A, and it's a WPA-PSK WiFi.
The printer confirms that it is connected to the WiFi.
When I run the setup tool on the computer, at the Network Check point, the setup software finds the printer at the correct IP address. It is the only thing it discovers.
I click next, ànd after a minute or two, I get the error "the printer was unable to be installed over the wireless network" Click Retry to try installing the printer over the network again, or click Cancel to return to the connection options.
This just cycles with no progress. I have turned off the Windows Firewall and also disabled the AV. No change.
I can browse to the web interface of the printer - but still can't install the printer. It is listed in the Printers and Faxes as being Offline.
I'll try once again removing it, and re-adding it - but has anyone come across this problem before, please?
This question was solved.
View Solution.I am having a similar problem as well. The printer is recognized (most of the time) when I run the HP Network DIagnostic Utility. However, when I run the Add a Device setup program to install my wireless printer, it is NEVER recognized. I have even tried to use the advvanced serach to locate it using the IP listed in the Diagnostic Utility without any luck. As an aside, I was able to add the printer through windows just fine and am currently able to print to it, but would really like to add it using the HP installation so that I can configure the "scan to" settings again.
To make matters worse, I no longer have the USB cord that came with the printer because the device has been connected wirelessly for over a year now with minimal issues. Any help getting this brick back online and connected to my network would be much appreciated! -
How to get Mac Address of Remote Computer
Hi All,
I tried to find out a solution for finding Mac Address of a remote system, then first i tried with finding it with local address using the following code it works fine for me.
public class MacAddressFinder {
public static void main(String[] args) {
try
InetAddress ipAddr = InetAddress.getLocalHost();
System.out.println("Current IP address : " + ipAddr.getHostAddress());
NetworkInterface nwIntf;
try
nwIntf = NetworkInterface.getByInetAddress(ipAddr);
byte[] hwAddr = nwIntf.getHardwareAddress();
System.out.print("Current MAC address : ");
StringBuilder sb = new StringBuilder();
for (int i = 0; i < hwAddr.length; i++)
sb.append(String.format("%02X%s", hwAddr, (i < hwAddr.length - 1) ? "-" : ""));
System.out.println(sb);
} catch (SocketException e) {
e.printStackTrace();
catch (UnknownHostException e) {
e.printStackTrace();
But when i tried this piece of code in jsp with the following code i am getting NeworkInterface object value as null and there by i am unable to get the Mac Address of a remote computer.
InetAddress ipAddr = InetAddress.getByName(request.getRemoteAddr());
NetworkInterface nwIntf = NetworkInterface.getByInetAddress(ipAddr);Can you please suggest me how to find out the Mac address of remote system?
Thanks,
Udayfirst of all, NetworkInterface only exposes the NetworkInterfaces of the local computer. secondly, you cannot find the mac address of an arbitrary remote computer. that information is not available outside of the local subnet. and java doesn't expose a way to discover it even for computers on the local subnet.
-
Finding a printer on the network USB connected to a PC
I have an HP c4400 printer that came with my MBP. I have it connected with a USB cable to a PC that is the main network computer. The network is a WRT54G Linksys wireless router. I do not know how to set up the printer. I loaded the printer software on the MBP and connected via USB cable and it works fine. When I try to set it up as an IP printer, I used the address for the computer it is connected to, but it never finds it. Is there a way to search for aprinter on the whole network?
In Tiger 10.4 that was easy. I would suggest you post your query in the Leopard Printing forum area:
http://discussions.apple.com/forum.jspa?forumID=1224
You realize that the PC must be up and running to print. You might be better off setting up with a print server so each computer can print when it wants to. -
Why does my computer self-assign an IP address whenever I rest the network?
All of a sudden both my wife's and my MacBook Pro dropped their internet connections (Verizon FIOS). I spent a long time with the Verizon tech person and he suggested that I post here.
My computer is running Mountain Lion and my wife's is running Lion.
Thanks.
JonRest the network? Why would you do that? It's not like it builds up lactic acid. Actually turning electrical devices on/off can actually degrade performance/reliability over time.
When MacOS loses connection with the network it will self-assign an IP address.. see above. Turn the network back on, and I suspect it reconnects. No?
If you recently upgraded to M/L I suggest you go into System Preferences/Network, delete the Wifi service ("-") and then recreate it ("+"). Do the same with the Ethernet service connection. Also, use WPA2 for router/network security.
Then repair permissions.
BTW, I use Verizon FIOS and experience no problems. -
My iPad suddenly stopped working with my home network. It shows the network to choose from but will not connect. When I look at details in that network it does not show IP address or any other info for the network. Setting is on DHCP and http proxy is set on auto. Network is active and can connect on wife's iPad and other home computers. Do I have another setting wrong?
Some things to try first:
1. Turn Off your iPad. Then turn Off (disconnect power cord for 30 seconds or longer) the wireless router & then back On. Now boot your iPad. Hopefully it will see the WiFi.
2. Go to Settings>Wi-Fi and turn Off. Then while at Settings>Wi-Fi, turn back On and chose a Network.
3. Change the channel on your wireless router (Auto or Channel 6 is best). Instructions at http://macintoshhowto.com/advanced/how-to-get-a-good-range-on-your-wireless-netw ork.html
4. Go into your router security settings and change from WEP to WPA with AES.
5. Renew IP Address: (especially if you are droping internet connection)
• Launch Settings app
• Tap on Wi-Fi
• Tap on the blue arrow of the Wi-Fi network that you connect to from the list
• In the window that opens, tap on the Renew Lease button
~~~~~~~~~~~~~~~~~~~~~~~~~
iOS 6 Wifi Problems/Fixes
Fix For iOS 6 WiFi Problems?
http://tabletcrunch.com/2012/09/27/fix-ios-6-wifi-problems/
Did iOS 6 Screw Your Wi-Fi? Here’s How to Fix It
http://gizmodo.com/5944761/does-ios-6-have-a-wi+fi-bug
How To Fix Wi-Fi Connectivity Issue After Upgrading To iOS 6
http://www.iphonehacks.com/2012/09/fix-wi-fi-connectivity-issue-after-upgrading- to-ios-6.html
iOS 6 iPad 3 wi-fi "connection fix" for netgear router
http://www.youtube.com/watch?v=XsWS4ha-dn0
Apple's iOS 6 Wi-Fi problems
http://www.zdnet.com/apples-ios-6-wi-fi-problems-linger-on-7000004799/
~~~~~~~~~~~~~~~~~~~~~~~
How to Fix a Poor Wi-Fi Signal on Your iPad
http://ipad.about.com/od/iPad_Troubleshooting/a/How-To-Fix-A-Poor-Wi-Fi-Signal-O n-Your-iPad.htm
iOS Troubleshooting Wi-Fi networks and connections http://support.apple.com/kb/TS1398
iPad: Issues connecting to Wi-Fi networks http://support.apple.com/kb/ts3304
WiFi Connecting/Troubleshooting http://www.apple.com/support/ipad/wifi/
How to Fix: My iPad Won't Connect to WiFi
http://ipad.about.com/od/iPad_Troubleshooting/ss/How-To-Fix-My-Ipad-Wont-Connect -To-Wi-Fi.htm
iOS: Connecting to the Internet http://support.apple.com/kb/HT1695
iOS: Recommended settings for Wi-Fi routers and access points http://support.apple.com/kb/HT4199
How to Quickly Fix iPad 3 Wi-Fi Reception Problems
http://osxdaily.com/2012/03/21/fix-new-ipad-3-wi-fi-reception-problems/
iPad Wi-Fi Problems: Comprehensive List of Fixes
http://appletoolbox.com/2010/04/ipad-wi-fi-problems-comprehensive-list-of-fixes/
Fix iPad Wifi Connection and Signal Issues http://www.youtube.com/watch?v=uwWtIG5jUxE
Fix Slow WiFi Issue https://discussions.apple.com/thread/2398063?start=60&tstart=0
How To Fix iPhone, iPad, iPod Touch Wi-Fi Connectivity Issue http://tinyurl.com/7nvxbmz
Unable to Connect After iOS Update - saw this solution on another post.
https://discussions.apple.com/thread/4010130
Note - When troubleshooting wifi connection problems, don't hold your iPad by hand. There have been a few reports that holding the iPad by hand, seems to attenuate the wifi signal.
~~~~~~~~~~~~~~~
If any of the above solutions work, please post back what solved your problem. It will help others with the same problem.
Cheers, Tom -
Possible to find ip addresses of everyone in an ad hoc network?
Hi,
I am developing an application which involves roaming laptops. I need to know when a laptop comes into range so that I may begin communicating with it. Specifically, what I need is to find out the IP address of the computer.
I have put a lot of thought into this, and think there are two possible ways to do this (BTW I am running linux):
1) Using some (unknown to me right now) command line utility that I can call from Java, and parse the output of the program for any ip addresses in the current ad hoc network. So far I have looked at iwconfig and iwlist, but have not found anything useful.
or
2) Somehow flood the ad hoc network so that every computer becomes aware that my PC is now in range, and can send a signal back to complete the handshake.
Anyway, hope you guys can lend me some insight into this problem.>
1) Using some (unknown to me right now) command line utility that I can call from Java, and parse the output of the program for any ip addresses in the current ad hoc network. So far I have looked at iwconfig and iwlist, but have not found anything useful.There is no such command in Java.
jellystones wrote:
2) Somehow flood the ad hoc network so that every computer becomes aware that my PC is now in range, and can send a signal back to complete the handshake.You could, in theory, flood the network constantly with ping-like requests to ever possible IP in your network range, causing anyone else on your network to be moderately annoyed with you. If you're really serious about doing that (which I will reiterate, is a bad idea), you just need to set an infinite loop to continuously search each IP in your local network's range, and use the isReachable(int something) call available as part of the inetAddress API, if you're running Java 1.5 or higher.
Like I said, I can tell you right now that you don't want to do this, at least in Java, and I would suggest looking for alternative network moderation utility methods, more specifically at the source of network communications on your network (ie, at the point of a firewall or router, where you can reasonably expect all users to go through as an access point). -
Finding IP Printer's IP Address?
This used to be simpler in OS9 I believe ! Or at least it was simpler when I used a Linksys router, but I am having a very difficult time finding the IP addresses of eitehr wireless and ethernet connected printers or computers on my home network connected via my Time Capsule. I've looked through the Network System panel, the airport utility, but it just escapes me...
Why isn't there an easy utility to view connected IP addresses? In Linksys, I could just connect to the router with Safari and could get control of the user interface...
My Xerox printer is too old for Bonjour, so that doesn't work..
Is there a utility or third party util that works?
BTW, my Desktop is bluetooth only...
Thanks
JeffHow can I look at static IP addresses in the Time Capsule? I have (2) statics coming into the physical ports, and one wireless static. I can only look at wireless clients and DHCP assigned IP addresses.
Several months from now I will either forget or lose my network map and not know what is hooked to physical ports 1 and 2. These devices are hard wired from other rooms inside the walls, tracing the wires could be a problem. Shouldn't there be an easy way to see ALL IP addresses connected to the Time Capsule? I expect there is . . . and that's why I am a newb
Thanks!
Message was edited by: gblakeney
Message was edited by: gblakeney
Maybe you are looking for
-
I Have a running set of topics in my Notes. I just added to Note topic on iPhone 5. When I finished I mistakenly clicked + instead of Done. When I saw the blank page that appeared after the + click, I clicked Done. That brought me back to the menu of
-
How can i get my icloud calendar appointments to appear in the outlook to-do bar?
I find the upcoming appointments in Outlook's To-Do Bar really useful but since synching with icloud they are no longer there. I know this is an ongoing issue and wondered if there was any up-to-date information on how to resolve it?
-
Hi, by assigning the a/c assignment in po, the system genereated qm order upon compltion of migo. please advise can we do confirmation like in prod orders (with co11n) for qm orders? please advise t-code to do confirmation for qm orders (without ente
-
hi, in vf02 header -foreign trade/customs -organization data tab - no of foreign trade data field HOw this no of foreign trade data is getting picked up where setting is done for this
-
My printer does not work with firefox but does work with explorer
While using ebay I tried to print out a mailing label, and fox fire does not work with it anymore. My printer does work with internet explorer ?