Fetching computer IP address?

hi,
i need to be able to fetch the ip address of the computer the prog is running on and store it in a string, can someone help me with some code please..
thanks

String ip = InetAddress.getLocalHost().getHostAddress();
:)

Similar Messages

  • Fetching Dynamic email address from the HTML content sent in the email body

    Hi All,
    I have a scenario where in i have to send an html content via an email body . while doing so , i need to fetch the email address from the html content and send a mail to the specified email adrress in the html content .
    How to fetch the email address from the html content.
    Regards
    Vinay P.

    Hi ,
    Dynamic configuration means ...do i need to come up with a mapping which contains the  To,From,Subject fields & all...so that when i click on the mail package in mail adapter ...this  "To" email id will be fetched dynamically
    Regards
    Vinay P

  • Fetch client IP addresses from the Netlogon.log file of all domain controllers in the domain

    Hi,
    The event ID 5807 is logged in the system logs of domain controllers as a result of which the IP addresses for the missing subnets are logged in Netlogon.log under %systemroot%/debug. The end goal is to fetch the IP addresses along with rest of the respective
    attributes from the Netlogon.log for all the domain controllers in the domain. I have the following script however, it gives me a 0KB file despite the fact that the Netlogon.log on the DC contains ample entries from last two months. 
    function GetDomainControllers {
        $DCs=[system.directoryservices.activedirectory.domain]::GetCurrentDomain() | ForEach-Object {$_.DomainControllers} | ForEach-Object {$_.Name}
        return $DCs
    function GetNetLogonFile ($server) {
        $path= '\\' + $server + '\c$\windows\debug\netlogon.log'
        try {$netlogon=get-content -Path $path -ErrorAction stop}
        catch { "Can't open $path"}
        #reverse the array's order to the end of the file
        [array]::Reverse($netlogon)
        $IPs=@()
        foreach ($line in $netlogon) {
            #split the line into pieces using a space as the delimiter
            $splitline=$line.split(' ')
            #Get the date stamp which is in the mm/dd format
            $logdate=$splitline[0]
            #split the date
            $logdatesplit=($logdate.split('/'))
            [int]$logmonth=$logdatesplit[0]
    #last month and this month
            if (($logmonth -eq $thismonth) -or ($logmonth -eq $lastmonth)) {
                #only push it into an array if it matches an IP address format
                if ($splitline[5] -match '\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b'){
                    $objuser = new-object system.object
                    $objuser | add-member -type NoteProperty -name IPaddress -value $splitline[5]
                    $objuser | add-member -type NoteProperty -name Computername -value $splitline[4]
                    $objuser | add-member -type NoteProperty -name Server -value $server
                    $objuser | add-member -type NoteProperty -name Date -value $splitline[0]
                    $objuser | add-member -type NoteProperty -name Time -value $splitline[1]
                    $IPs+=$objuser
            } else {
                #break out of loop if the date is not this month or last month
                break
        return $IPs
    #Get last month's date
    $thismonth=(get-date).month
    $lastmonth=((get-date).addmonths(-1)).month
    #get all the domain controllers
    $DomainControllers=GetDomainControllers
    #Get the Netlogon.log from each DC
    Foreach ($DomainController in $DomainControllers) {
        $IPsFromDC=GetNetLogonFile($DomainController)
        $allIPs+=$IPsFromDC
    $allIPs | Sort-Object -Property IPaddress -Unique | Export-Csv "E:\bin\NetlogonIPs.csv"
    PLEASE HELP!!

    Hi jrv,
    Thanks a lot for your help.
    I understand you cannot keep on iterating the code for me. However, I am stuck at this error :-
    ERROR : Exception calling "Parse" with "1" argument(s): "String was not recognized as a valid DateTime."
    After the following code finishes executing, I get the following output :-
    $csv=cat c:\windows\debug\netlogon.log |
    %{'{0}|{1}' -f $_.SubString(0,14),$_.SubString(15,$_.Length-15)}|
    ConvertFrom-Csv -Delimiter '|' -header time,message
    time message
    04/14 01:18:45
    NO_CLIENT_SITE: ServerX 10.x.x.x
    04/14 01:17:45
    NO_CLIENT_SITE: ServerY 10.x.x.x
    04/14 01:17:44
    NO_CLIENT_SITE: ServerY 10.x.x.x
    04/14 01:17:43
    NO_CLIENT_SITE: ServerX 10.x.x.x
    However, I get the above mentioned error at the following line :-
    $csv|%{$_.time=[datetime]::Parse(($_.time -replace ' ','/2015 '))}
    I would later want to run the query just for logs from past day.
    Entire code is as follows :-
    function GetDomainControllers {
        $DCs=[system.directoryservices.activedirectory.domain]::GetCurrentDomain() | ForEach-Object {$_.DomainControllers} | ForEach-Object {$_.Name}
        return $DCs
    function GetNetLogonFile ($server) {
        $path= 'C:\Test\netlogon.log'
        try {$netlogon=get-content -Path $path -ErrorAction stop}
        catch { "Can't open $path"}
        #reverse the array's order to the end of the file
        [array]::Reverse($netlogon)
        foreach ($line in $netlogon) {
       $csv=  $netlogon | %{'{0}|{1}' -f $_.SubString(0,14),$_.SubString(15,$_.Length-15)}| ConvertFrom-Csv -Delimiter '|' -header time,message | Out-Gridview
       $csv|%{$_.time=[datetime]::Parse(($_.time -replace ' ','/2015 '))}
    #get all the domain controllers
    $DomainControllers=GetDomainControllers
    #Get the Netlogon.log from each DC
    Foreach ($DomainController in $DomainControllers) {
        GetNetLogonFile($DomainController)
    Please help!! Any help will be highly appreciated.

  • HT4199 how do I fix it when "another device is using computer IP address" and I can't get wireless to work anymore? It used to work fine.

    How do I fix it when "another device is using computer IP address"? Airport used to work fine. I've already tried turning everything on and off several times.

    I would recommend that you do the following as a minimum:
    Power-down the modem, AirPort base station, and computer(s).
    Power-up the modem; wait at least 10-15 minutes to allow it adequate time to initialize.
    Power-up the AirPort base station; wait at least 5-10 minutes. Note: The AirPort's status light may continue to flash amber after it has intialized. That is because, there may be some additional configuration items necessary, like setting up wireless security, before the overall setup is completed to get a green status.
    Power-up your computer(s).
    If the above steps do not solve the problem, start over with step 1 above, but then perform the next steps between steps 1 & 2. above.
    Disconnect the AirPort base station from the Internet broadband modem.
    While all of the devices are powered-down, perform a "factory default" reset on the base station. This will get it back to its "out-of-the-box" configuration and make setting it up much easier, especially if you use the "Assist me" process within the AirPort Utility. (ref: Resetting an AirPort Base Station or Time Capsule)
    After the base station resets, go ahead and power it back down.
    Reconnect the AirPort base station to the Internet broadband modem. For the Extreme and Time Capsule, be sure to connect the cable to the base station's WAN (circle-of-dots) port.
    Continue with step 2 in the first set of steps.
    In this basic configuration, the AirPort base station will broadcast an unsecured wireless network with a Network Name (SSID) of Apple Network NNNNNN. Network clients, connected to the base station either by wire or wireless, should now be able to access the Internet through the ISP's modem. Once Internet connectivity has been verified, you can use the AirPort Utility to configure the base station for wireless security and any other desired options. Please post back your results.

  • Why won't my computer's address book sync ALL of my contacts with my iPhone?  no MobileMe, no iCloud, just straight from computer to phone.

    Why won't my computer's address book sync ALL of my contacts with my iPhone?  No MobileMe, no iCloud, just straight from computer to phone.  I have checked all the settings and all seems correct.  It simply won't pull in all of the contacts.  Last time, it added some new ones, but deleted others.

    I found the route of the problem! All the songs under 'On This Phone' are completely grayed out! The only question is now how do I ungray them???

  • Not able to Fetch Client IP Address in HTTPS mode

    Hi All,
    I am having trouble in fetching client's IP Address.
    The IP address is used for tracking the login information.
    Now, let me explain the problem:
    I use owa_util.get_cgi_env ('REMOTE_ADDR'); to fetch the ip address.
    Now, whenever I login using https, I get the server IP and,
    when I login using http, I get the client IP.
    I have tried using javascript also to get the IP address.
    I followed the technique mentioned in Link: [http://javascript.internet.com/user-details/ip-address.html].
    This returns *#echo var="REMOTE_ADDR"* as an output while using HTTPS.
    Other techniques also, do not give any output.
    I did check other related forums which provided a little insight, but my problem still remains unanswered.
    Please advice.
    Thanks,
    Saurav

    This problem may occur due to loss of some system files while upgrading your  dell vostro 1014 laptop from 8.0.to 8.1 or unsuccessful upgrade. 
    Try to refresh your laptop by inserting windows 8.1 installation disc.
    To do this go to control panel->recovery->refresh your system without loosing any data
    If you don't have any windows 8.1 installation disc just download from Microsoft website.
    Make sure to choose correct architecture of your windows installation (x86 or x64) when you download.

  • Computer ip address when using airport

    I need to provide TIVO with my computer ip address to access photos. I am using wireless for the TIVO and my computer with airport. I know the airport IP address but that doesn't work for TIVO. I tried to find the computer IP under system Pref. network and under utility network but no luck. I am using sys 10.6.4

    Terrance Turner1 wrote:
    I need to provide TIVO with my computer ip address to access photos. I am using wireless for the TIVO and my computer with airport. I know the airport IP address but that doesn't work for TIVO. I tried to find the computer IP under system Pref. network and under utility network but no luck. I am using sys 10.6.4
    Welcome to Apple's discussion groups.
    If you open the Network panel of System Preferences and select the connection item you're using, you should see your computer's IP address on the right. If that's not what you need, please try again to describe it.

  • HT201184 What does this mean? How do I fix it?  "Another device on the Network is using your computer IP address (then it gives current IP address)"

    "Another device on the Network is using your computer IP address" is plaguing me.  What can I do to correct this?  It seems to come on after it has been inactive for some time.

    Hi Delores,
    What Encrytion does your Router/Modem use?
    This might mean your Mac is set to a Static/Manual IP instead of using DHCP to request an IP, or another device is starting up with a Static IP & kicking your Mac off the Router.
    If this is Wifi/Airport with little or no encryption,it could be somebody outside causing it.
    How many things are connecting there?

  • How to fetch the BCC address using java mail

    Hi,
    I want to extract the mail address given in the Bcc address field of an email which I fetch it from the IMAP store !!
    I will be very much thankful if this problem is solved !!
    Thanks!!

    You can read the Bcc addresses just like the To and Cc addresses. But.... Note that Bcc addresses
    won't be present in any message you receive; if you could see the Bcc addresses it wouldn't be a
    blind carbon copy. If you create a message with Bcc addresses and save that message in your
    "Sent Items" folder, you'll be able to read the Bcc addresses in that message.

  • How do I transfer computer email addresses to my IPad?

    How do I transfer my computer e-mail addresses to my IPad?

    Do you mean your email account(s)?  If so, go to Settings > Mail and add your account(s).
    The USer Guide should help... http://manuals.info.apple.com/en_US/ipad_user_guide.pdf

  • Is there any way to pull out computer Mac addresses from GPO?

    Hello!
    I was wondering if there is any way to pull out the mac address from all the computers in the organisation via the group policy?
    It would be rather difficult to pull out mac address one by one from each computer.
    Appreciate your assistance and advise on this!
    Thank you so much :)

    You can use group policy to run a startup or logon script to get the information and write it to some file/database.
    You could also get the information remotely using a script.
    You could also as your network guy for a list of IPs and MACs they see.
    Group policy is intended to make settings, not to get information. However you can
    set a startup or logonscript that reads out the information through group policy.
    A sample script surely is available in the scriptcenter, but I think help on the specific script is more something or the scripting forums.
    MCP/MCSA/MCTS/MCITP

  • Fetching of email address too slow since TB 31

    Since the update to TB 31, fetching email addresses while typing a part of it and hitting tab does not work.
    Ex. I have an email saved as [email protected] Till the update I would quickly type "samp" and hit tab immediately. It would automatically fetch that email. Since the update I would have to wait till the list of possible email addresses show up and than hit tab.
    This is really disturbing and time consuming. Maybe it has something to do with the recent changes made in that area. How could I disable the new function to revert back to the old behavior and maybe speed things up a notch again?

    There is a more popular and detailed thread about this issue just over here:
    https://support.mozilla.org/de/questions/1011952

  • Computer IP address in data warehouse?

    Hi,
    In the Service Manager 2012 data warehouse, I'm trying to locate the table and fields for a computer's IP and MAC address as seen in the Service Manager console, under Configuration Items => Computer => Hardware => Network Adapters.
    In the DW, I can find the computer and its related network adapter(s), but not table storing the MAC and IP address(es). In which DW table can I find them? Are they copied to the data warehouse by default, or do I need to do some hokey pokey to get it working?
    Sebastian

    Hello Sebastian,
    Did you find out why the IPaddresses and the macaddresses are not in the networkadapters view,
    i'm having the same problem, and have no idea why the data is not filled in...
    The entries in computer and deployed computer should be filled in
    by the scom connector apparently
    thanks,
    Dennis

  • Receiving someone else's email on my computer but addressed to another

    I have been receiving someone else's email on my computer, but the email has the address for their
    computer. We are using 2 different ISP; only our last name is the same. Is this the work of a virus/worm received from an email from the other person? What can I do to rid my email of this intrusion?

    I would say there are 2 possibilities:
    1) The the sender (or sender's computer) sent the email to your address
    2) The ISP of 'the other person' has made an error in one of his rerouting-rules
    The only thing you can do is report these cases (forward the email with Full Headers ON) to the postmaster of both your and the other person's domain, as well as to the sender.
    The problem is not on your end UNLESS you managed to configure your mailreader in a way that you use the other person's mail-servername, username and password, which is very unlikely!
    Kind regards,
    Adam

  • All information in Palm doesn't sync to computer's address book

    I have been trying to sync my palms info to my computer. Most information syncs except for the contacts addresses. Help please.

    Welcome to Apple Discussions.
    This is a long-term shortcoming of the iSync Palm Conduit. No contact address information is passed to and from a Palm device unless the address data label is set to <home>. Using the label <work> or, using any other value, results in the field being ignored.
    For a better synchronization experience, one that does not burden you with this and many other iSync Palm Conduit issues, consider using the Missing Sync for Palm OS instead.
    PowerBook G4 12 867 MHz 640 meg 40 gig SuperDrive   Mac OS X (10.4.10)   temporarily coupled with a Handspring Treo 300 on the T-Mobile network

Maybe you are looking for

  • Ap ageing

    what is vendor ageing analysis how we calucate them just tell me the functionality?

  • Messages don't work

    Messages don't work

  • How to see recent My Verizon login activity?

    Hello, Is there a way to view a log of all the times that I have logged in to My Verizon to check usage? Say, for example, if logged in yesterday at 11:00 PM to check my recent texting activity, is this captured somewhere (hopefully on My Verizon) so

  • Audio rendering problems in Premiere Pro CC 2014

    Hi I'm rendering a very small project in Premiere Pro (just some cut and music). I tried to render it in H.264 but when I open it in windows media player there is no audio, when I copy it to my mobile phone I can't hear the audio neither. When I impo

  • What's the URL of a folder?

    Hi folks; How can our customer access a folder? Something like this? /pls/portal30/URL/folder/foldername But it doesn't work - what's wrong / any ideas? Thank you / regards, Bernhard