Uniquely indentifying a user's machine

My team and I have established a statistics service that allows our program to send data to a PHP script, which then stores the data in a MySQL table, but now we need a way to uniquely identify the user's computer so that duplicate occurrances don't appear and throw our statistics off.
We considered just building a huge string of all the System.getProperty() values, then calling hashCode() on it, but even that doesn't seem unique enough. We're completely out of ideas.
Can anyone think of a good way this could be accomplished?

Consider using the MAC address of the network interface. I use the following to get All the MAC addresses associated with a computer.import java.io.*;
import java.util.*;
import java.util.regex.*;
public final class MACAddress
    public final static List<String> getMacAddresses() throws IOException
        final ArrayList<String> macAddressList = new ArrayList<String>();
        final String os = System.getProperty("os.name");
        final String[] command;
        if(os.startsWith("Windows"))
            command = windowsCommand;
        else if(os.startsWith("Linux"))
            command = linuxCommand;
        else
            throw new IOException("Unknown operating system: " + os);
        final Process process = Runtime.getRuntime().exec(command);
        // Discard the stderr
        new Thread()
            public void run()
                try
                    InputStream errorStream = process.getErrorStream();
                    while (errorStream.read() != -1)
                    errorStream.close();
                catch (IOException e)
                    e.printStackTrace();
        }.start();
        // Extract the MAC addresses from stdout
        BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
        for (String line = null; (line = reader.readLine()) != null;)
            Matcher matcher = macPattern.matcher(line);
            if (matcher.matches())
                macAddressList.add(matcher.group(1).replaceAll("[-:]"," "));
        reader.close();
        return macAddressList;
    static private Pattern macPattern = Pattern.compile(".*((:?[0-9a-f]{2}[-:]){5}[0-9a-f]{2}).*", Pattern.CASE_INSENSITIVE);
    static final String[] windowsCommand = {"ipconfig","/all"};
    static final String[] linuxCommand = {"/sbin/ifconfig","-a"};
    public final static void main(String[] args)
        try
            for (String macAddress : getMacAddresses())
                System.out.println("  MAC Address: " + macAddress);
        catch(Throwable t)
            t.printStackTrace();
}

Similar Messages

  • SAP R/3 : Indirect Role assignments - Is position unique to every user?

    Hi.
    While am exploring /learning SAP R/3 roles and auth, I would appreciate if I could get clarity on the following :
    This  link on SDN on Indirect role assignments are very informative.
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/f03e6f6c-8c16-2a10-1581-ed8812e2effe
    This link is also more explanatory : http://my.affinitext.com/public/book/5442/-1/1423831
    So if my understanding is correct, it is better to assign roles - indirectly by position, so that if an employee's position changes, his role can be removed, based on position again ??? And somewhere we are linking with infotype 105.
    My only doubt is : if we are going to assign roles by position and remove the roles by position, so that as the position of an employee changes, the previous roles become null and void and new roles can be assigned as per new position.
    So would like to know :
    as to whether this position number which we see from PA20, is unique to every user on the system ?
    So that, if there is a need to remove a role based on postion, we could remove the role from PO13;
    BY doing that, then will it not affect other users ?
    Can somebody help me understand this.
    Because if i want to see the effect immediately, if i go to PFUD and put the role name and say execute, i see that the role which was removed from PO13 is gone immediately from the user.
    Many thanks
    Indu
    Edited by: Indumathy Narayanan on Nov 22, 2011 9:25 AM

    GOT IT THANKS.
    Hi Prashant.
    Good morning and wishes.
    Can you please help me understand this.
    I understand from HR person that position is uniquely defined (from hire to retire)
    and roles are generally given based on position.
    However, I see a person : whose roles have been assigned as per position all these years.
    He had 2 roles in project A. He now moved into a different project B.
    But. when i check, i still see the roles - reflecting on SU01  & well as in the tab of user of the role X under pfcg.
    BUT when i check PO13 - and put the position / relationship and say overview.
    I dont see the roles at all there.
    Why this is so.  Why the discrepancy on different screens.
    Also How can I get a confirmation that - these roles are actually removed and is not there for the user.
    Rather.
    How could the removal of roles based on position become completely effective on the system.
    So that all screens display the same information.
    Also would like to know - whether it is ok to remove the role expiry date directly from PFCG/ROLE Display/user tab/select user/
    and then make the role invalid or expired / or extend the expiry.
    Many thanks.
    Indu
    Edited by: Indumathy Narayanan on Dec 7, 2011 12:09 PM
    Edited by: Indumathy Narayanan on Dec 7, 2011 1:42 PM
    Edited by: Indumathy Narayanan on Dec 7, 2011 5:17 PM

  • Iphoto can not be open by different users on Machine, why? OSX Maverick

    I photo is working very well for one user but is not possible to start for the other user on machine.

    Have solved the problem myself. Upgrade was in the tools map, not in program.

  • Problems to avoiding local copy in the user's machine

    Hi All,
    I implemented the BadI DOCUMENT_FILES01~AFTER_START_APPL according to the wiki http://wiki.sdn.sap.com/wiki/display/PLM/Avoidinglocalcopyoforiginal for avoid local copy of original in the user's machine.
    This implementation only works for originals open through the ECL Viewer or MS Office Integration, avoiding local copy of originals in this cases.
    But the problem is that PDF files still being copy to temporary folder in the user's machine when I use ECL Viewer 6.0 with patch 5 implemented according to SAP note 1380587.
    If I implement the patch 5 for ECL Viewer 6.0 without the manually customizing in "Enviroment Variables" indicating in the solution section of the SAP note, then the PDF files are not copy to temporary folder in the user's machine.
    In test with ECL Viewer 5.1.2 and 5.1.3, this problem with PDF Files doesn't happen too.
    My system and customizing information:
    SAP GUI 710 PATCH 18
    ECL 6.0 with all patches installed 1 to 7 according to the SAP notes
    Data carrier
           - Define mount points/logical drive => Data Carrier: PC; Data Carrier Type: PC; Prefix for access path: PC
           - Define data carrier type "server, front end" => Data Carrier Type: PC; Description: local PC; path: c:\temp\
    Has anyone experienced this?
    Best Regards,
    Daniel

    Hi Daniel,
    regarding the display or handling of PDF files I have to say that here the local copy is required by the Adobe Reader and therefore the system has to made a local copy to display the PDF files correctly. This happens also if you display PDF files with the ECL Viewer because also the viewer requires an instance of the Adobe Reader which again needs a local copy. So for displaying PDF files a local copy is mandatory.
    Best regards,
    Christoph

  • How to get Unique calid for users with same name in multiple domain env..

    I found we need to use "-k legacy" option for creating users in non-hosted setup..
    I had two domains default as xxxx.com and the one that I created as yyyy.com
    When I have users with same name in two of the domains as user1..
    The calid for both of them is... user1 ....so they share the same calendar
    When Im in valid SSO of yyyy.com I get the mail account for user1 as [email protected] .....but the calid .. common as user1
    How I can get unique calid for users under two domains..
    whether I need to set Hosted domain support...Then how the mailid's differ with out using hosted domain support..
    And I need to login UWC without using @domain.com...
    Help me on this...
    Ashik

    Do you have UWC and Cal configured at least for virtual domain support?
    basically.. for discussion.. let's say you have three domains on your server.. 1st domain is the default domain. other 2 domains are virtual domains.
    if all domains were created with mail and cal support (-S mail,cal).. you would use the following options when creating users:
    1) for the default domain.. you must use the "-k legacy" option when adding users.
    2) for the other two domains.. when you create the user.. do NOT use a "-k" option.
    If you do not use the "-k" option.. it defaults to "hosted" which will cause the user's calid to be [email protected]
    If you Do use the "-k legacy" option.. it will create the calid as just "userid"
    With regard to logging into UWC without the @domain.com part of a username in a hosted domain.. the easiest way to avoid this.. is to point a host name under the hosted domain to the server.
    if you point webmail.xxxx.com to the server... and then access it via:
    http://webmail.xxxx.com/uwc/
    any users in the xxxx.com hosted domain will NOT need to use @xxxx.com when logging in... they can just use "userid"
    This feature does not take any special configuration (aside from adding a DNS entry for the hosted domain)
    Hopefully that helps.

  • Arial embedded font displaying jumbled on another user's machine

    I have a PDF document that uses an Arial embedded font and it looks fine on my machine, but looks like this on one of my end user's machines:
    In researching this problem all the advice points to a problem with the font, but it's just the common Arial font and it is listed as embedded. Or at least, I think it is, Arial shows up in the font list for the PDF properties 3 times, and if I use the Touchup Text tool, select the text and look at Properties, it says "Cannot embed font" although both embed and subset checkboxes are checked and disabled.
    Can anyone help please?
    -VG_mnet
    P.s. I should have mentioned that it shows jumbled on my machine too when the user emailed it to me.  I'm on Adobe Pro version 9.
    Here is the font list on the PDF properties:

    Thank you again for your help Bill@VT and CtDave.  I did play around with the Distiller but I don't think those options help me much since I do not use either of the options to create the PDF that you mention Bill.  I actually am usually starting with an existing PDF template (that has our logos and a demo title) and then I fill in the rest of the paragraphs, charts, labels and form fields.  So my understanding (now that I have explored) is that the Distiller is used for converting a postscript file to a pdf.  I already have a PDF tho.  Just for yuks, I saved my PDF as a .ps and ran it through the distiller - it correctly embedded all my fonts, but my form fields were all gone. 
    So I moved on to Plan B and looked at the preflights that Dave referred to.  After looking at a lot of instructional web pages that all told me the Preflights were of the View or Tools menu, I finally found it under Advanced->Print Production->Preflights.  I chose the option to Embed fonts (even if text is invisible), and ran it through.  It seemed to work great and maintained my form fields.  Most of my fonts are also now embedded as I had hoped.  I think this will be the way we move forward with all the existing PDFs we have in our system, but I did notice that one font still didn't get embedded.  One of the Arial's (the 1st CID in the screenshot above) is still listed as not embedded even though the other fonts listed are practically identical and are embedded.  This may be a problem on just this one PDF, and the other PDFs in my system appear to not have this issue when I run the preflight, so I'll keep playing with this one PDF, but does anyone have a theory as to why the preflight wasn't able to embed that one CID font?
    Thanks again! You have both been helpful and I've learned some new tricks!
    -VG

  • 802.1x Wireless - Enforce user AND machine authentication

    I am using ACS v5.6 and I'd like to confirm that it is not possible to enforce both user and machine authentication against AD before allowing wireless access to Windows 7 clients, using PEAP/MSCHAPv2 and the built-in 802.1x supplicant.
    The only workaround seems to involve MAR (Machine Access Restrictions), which has pretty significant drawbacks.
    I'd rather not have to deploy user and machine certificates.
    All I want to do is allow access to the wireless network only if the device and the user are in AD.
    It's such a simple scenario that I must be missing something.
    Any suggestions are welcome. Thanks in advance for your comments.
    Lucas

    In my opinion, the only solution that works is using NAM and EAP-Chaining with ISE as radius backend, last time i looked in ACS release notes was 5.4, and it didn't have eap-chaining support.
    Using the built-in windows supplicant will only authenticate user or machine at any time, not both. As you discovered, the feature called MAR used to be what was being recommended (mostly because nothing else existed), What most people miss when they say this will work fine with windows supplicant and acs, is the fact that you cannot be sure that when the user authenticates, he is doing it from an authenticated machine, this is mainly due to the shortcomings.of MAR. You should consider migrating to ISE if you are not using any TACACS features on ACS.

  • EAP-TLS User and machine authentication question

    Hello,
    i have a question regarding EAP TLS authentication in a wireless environment. We use Cisco AnyConnect NAM client and an ACS 5.1 to do EAP-TLS authentification. The Laptop and the user can be successfully authenticated using a certificate from our internal CA. i can also check the in our corporate AD if the user and machine are member of a certain group and based on the membership a can grant access to the network.
    i can see in the ACS when the laptops after a reboot logs on to the network, but i don't see a log when the laptop comes back from hibernate mode, i guess this is normal because the laptop sends only the autentication equest after rebooting.
    What i'd like to achive is, when a user logs on the it should always be checked if the machine was authenticated prior the user can get access to the network. Is there a way to do this with EAP-TLS and a LDAP connection to Active Directory.
    thanks in advanced
    alex

    Sounds like you rather want to use PEAP/MSChapV2

  • Fetching the serial number of the user's machine

    Hi there.
    I am after a Cocoa approach to retrieving the serial number of the user's machine in my application.
    I have seen an AppleScript solution, but I was wondering if there was a more efficient Cocoa way.
    Thanks in advance,
    Ricky.

    You should not post your serial number in these forums, besides what you posted was invalid,  Post your serial number here and post back the exact model MBP you have:
    https://selfsolve.apple.com/agreementWarrantyDynamic.do
    Ciao.

  • Can I run a Unique Clients and Users Summary report customized by both floor area and SSID?

    In Cisco Prime, can I run a Unique Clients and Users Summary report customized by both floor area and SSID?

    Allright guys. I appreciate the quick responses. I've worked a lot in CR however i am not understanding the solution so I'd appreciate if you can dumb it down for me. If i understand it correctly you guys are suggesting to make a formula, that either return my group by string (which is a formula in my report) or the Quantity. I tried writing a formula like this
    if ({@param} = 1 then
    GroupName ({@GroupBy})
    else
    {NetPNL.GrossAfterAdj}
    but it seems like CR does not allow you to return 2 different data types. Even if it had worked i would not know what to do from there. Can anyone please dumb it down for me. To make my situation more clear below is an example of how my data is..
    MN 100
    MN 200
    MN 50
    CA 300
    CA 500
    when the data shows in the report, its grouped by state, so it comes out like
    MN 350
    CA 800
    I want the users to decide whether they want it sorted by state  (ascending)
    CA 800
    MN 350
    or Total quantity (asc)
    MN 350
    CA 800

  • Required settings in AD USER Client machine

    After configuring AD RMS, what are required settings in Regedit, MSIPC to encrypt the data using Templates and AD hoc policies in newly created AD USER client machine.

    Hi CK,
    Based on Your Step 2 answer template
    distribution works fine..
    Thanks for your quick answer..

  • Windows Virtual PC (VMWindow.exe) does nothing but open a dialog box labeled user "Virtual Machines"

    Windows Virtual PC (VMWindow.exe)  does nothing but open a dialog box labeled <user> "Virtual Machines"
    Running Win 7 Pro 64 bit SP1 on an Asus Z97 Pro socket 1150 mobo, with Intel VT-d both Supported and Enabled in the BIOS.

    I am attempting to use Win Virtual PC as one would use VirtualBox or VMware Player.
    I thought I stated my case clearly.
    Are you proposing that Win Virtual PC functions ONLY  to run Win XP in a virtual machine environment? 
    Bill
    No, I just suspect you would like to install XP mode on virtual machine.
    Supported guest operating systems in Virtual PC:
    •Windows XP Service Pack 3 (SP3) Professional
    •Windows Vista Enterprise Service Pack 1 (SP1) and later versions
    •Windows Vista Ultimate Service Pack 1 (SP1) and later versions
    •Windows Vista Business Service Pack 1 (SP1) and later versions *
    • Windows 7 Professional *
    •Windows 7 Enterprise.
    •Windows 7 Ultimate
    • Windows 7 Professional (SP1)*
    •Windows 7 Enterprise (SP1)
    •Windows 7 Ultimate (SP1)
    *Note  Virtual applications are not supported on Windows Vista Business or on Windows 7 Professional or on Windows 7 Professional(SP1). All other features of Windows Virtual PC are supported on these two guest systems.
    In addition, refer to this guide to create virtual PC before using:
    How to Create a New Virtual Machine in Virtual PC
    http://support.microsoft.com/kb/826291
    Kate Li
    TechNet Community Support

  • Need to ftp files(BACS) from Server to Users Local Machine-Urgent

    Hello,
    I am working on a Oracle HRMS Implementation(11i) and have a requirement wher I need to ftp files (BACS File) from a server to Users Local Machine.
    Please let me know any scripts or the way forward to achieve the same using a concurrent program.
    Thanks a lot!

    That requires the users machine for a ftp server installed and to be "visible" to the conc program server, the first one requiring setup and configure for every client and the second one may be a problem if in different segments or security policies. Another approach may be to generate the files on the server in a known location and from the client create a batch script to connect to that server and retrieve the file(s). You may schedule the program to run at certain hours or use a shortcut so the user can run it on demand

  • Sharing: 2 users, same machine... not possible, incredible (!)

    A simple question:
    2 users, same machine. My wife and Me. We both want to use the same iphoto library.
    It's on an external Hard Drive.
    Possible??

    Yes. Make sure the external HD is set to ignore ownership and formatted OS X Extended (journaled).
    Click to view full size
    Then each of you should launch iPhoto with the Option key depressed and in the next window select the library on the external HD.

  • Proxy settings moved from User to Machine not removing user settings.

    Hi All,
    I have recently moved our company's proxy settings from User based to Machine based as we were having issues after moving from an internal proxy to a hosted external proxy.  What we found was after turning off the internal some users were no longer
    getting external internet. 
    After some investigation we found they were still getting old proxy settings on login and after a GPupdate.exe or normal gpupdate from the server the correct settings would apply. (happened to users logging on for the 1st time) To prevent this from happening
    I moved the proxy settings to the Computer GPO and it all appeared to work in the test GPO and in live.  But a few days later we got some calls logged to our help desk stating they don't get external internet.  After some more
    investigation we found that they are still getting the user policy applied to them even though it has all been removed from the User GPO. 
    I found if I remove the proxy settings it doesn't always apply to users but if I add info in it always updates to the user.  What can be causing this?  Some of these users have local admin rights and I thought at first it might be something they
    did but now we are getting non admin users with these issues.
    We are using IE 10 and have set the original Proxy settings using the GUI internet control panel and are now applying the proxy settings via Registry updates in the Computer GPO and enabled "Make Proxy settings per-machine" object.  Our SOE
    is Win 7 ent x64 with IE 10 (1500 units) and Win 8.1 ent x64 IE11 (100 units) And some XP SP3 that are in the process of migrating to Win7.
    Any help on this would be much appreciated.
    Cheers,
    Nat

    Hi Nat,
    you wrote: I found if I remove the proxy settings it doesn't always apply to users but if I add info in it always updates to the user. 
    Does that also happen für new users now after you changed your settings to the computer settings?
    I guess you used group policy preferences; that worked as "one time settings", so as long as the policy exists it will be merged with the Settings on the users computer. Please find a detailed description on
    http://technet.microsoft.com/en-us/library/dn581922.aspx
    So you now have 2 configuration items: your policy as well as the users registry. So to remove that you already moved the Settings from the user configuration to your Computers configuration (that worked as you described) while the Settings
    in their HKCU are still there - you Need to either implement another  policy to remove that, or you can set it empty.
    Don't set it to "not configured" as that will keep your old setting deployed before.
    Sometimes I found in more easy to implement another user preference that removed the Registry key with the Registry keys to remove a Setting instead of Publishing a "remove Setting" configuration.
    Regards,
    Martin

Maybe you are looking for