if you've enabled service desk and enabled the anonymous scope to post tickets from liveconnect, you'll get duplicates, because each machine is now in two scopes - the usual organization scope, and anonymous.
To filter out anounymous, alter the SQL as follows:
join vdb_Scopes_Machines foo on (foo.agentGuid = dbo.vCurrDiskInfo.agentGuid and foo.scope_ref = '".$scope_filter."')
I define $scope_filter in my dblogin.php file, so it is available to all scripts. In my case, the scope filter is my organization 'mytech-solutions'.
...in actual fact, ALL the NOC queries will need this line added, or you'll get duplicate data in all the queries.