skip to Main Content

I need to get certain OS-level information. I cannot install anything on client’s machines, I only have option to open a URL in the browser on client’s machines. I need to get following information if possible.

  • get OS version
  • Have they run Windows Update
  • Any Pending reboots waiting (from software installs) it causes issues with SentryBay install
  • Audio settings
    • The name of the default recording and playback devices
    • Whether either of those devices are muted
    • Whether either of those devices’ volume is at 0
  • CPU
  • RAM
  • Should be running Defender only (for PCs)
  • Are they using wifi
  • What is running on PC (if their CPU usage is high they may need to close down or uninstall software)
  • Safe Mode needs to be off

The website can be coded in any language JS, PHP, Python etc.

Thanks.

2

Answers


  1. Most of this is not possible due to security concerns, however some browsers have implemented web APIs that can access some of this information. What Web Can Do Today has some great information about what sorts of device specific data can be accessed using APIs that were mostly designed for Progressive Web Applications.

    Update: There is information on how to access the OS version in JavaScript here

    Login or Signup to reply.
  2. Well, You can actually get the OS information of a device with PHP. It can tell if the user is using, Windows 7 or Windows 8 or Windows 10 or Android or Mac OS or IOS or more with this code:

    <?php
    
    $user_agent = $_SERVER['HTTP_USER_AGENT'];
    
    function getOS() { 
    
        global $user_agent;
    
        $os_platform  = "Unknown OS Platform";
    
        $os_array     = array(
                              '/windows nt 10/i'      =>  'Windows 10',
                              '/windows nt 6.3/i'     =>  'Windows 8.1',
                              '/windows nt 6.2/i'     =>  'Windows 8',
                              '/windows nt 6.1/i'     =>  'Windows 7',
                              '/windows nt 6.0/i'     =>  'Windows Vista',
                              '/windows nt 5.2/i'     =>  'Windows Server 2003/XP x64',
                              '/windows nt 5.1/i'     =>  'Windows XP',
                              '/windows xp/i'         =>  'Windows XP',
                              '/windows nt 5.0/i'     =>  'Windows 2000',
                              '/windows me/i'         =>  'Windows ME',
                              '/win98/i'              =>  'Windows 98',
                              '/win95/i'              =>  'Windows 95',
                              '/win16/i'              =>  'Windows 3.11',
                              '/macintosh|mac os x/i' =>  'Mac OS X',
                              '/mac_powerpc/i'        =>  'Mac OS 9',
                              '/linux/i'              =>  'Linux',
                              '/ubuntu/i'             =>  'Ubuntu',
                              '/iphone/i'             =>  'iPhone',
                              '/ipod/i'               =>  'iPod',
                              '/ipad/i'               =>  'iPad',
                              '/android/i'            =>  'Android',
                              '/blackberry/i'         =>  'BlackBerry',
                              '/webos/i'              =>  'Mobile'
                        );
    
        foreach ($os_array as $regex => $value)
            if (preg_match($regex, $user_agent))
                $os_platform = $value;
    
        return $os_platform;
    }
    
    $user_os        = getOS();
    
    $device_details = "<strong>Operating System: </strong>".$user_os."";
    
    print_r($device_details);
    
    ?>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search