Duplicate computers

(imported topic written by SystemAdmin)

Hi,

I need to make a report to find duplicate machines, but also comparing the domain, because we have machines with the same name but in a different environment, is this possible?

(imported comment written by cstoneba)

here’s a way to identify the computers, not sure how to add the domain property though.

http://www.ibm.com/developerworks/forums/thread.jspa?threadID=477221

(imported comment written by Lee Wei)

Can you give more information about “domain”?

What property do you have that information in, and what are some example values?

If I know where you are getting that information from, we should be able to put together a statement to get the duplicates unique across domains.

Lee Wei

(imported comment written by SystemAdmin)

Hi Lee,

I attach a screenshot of the console where I highlight in red the domain.

I need to know if it is possible to find the duplicate computer name and domain name as well, because there are computers with the same name, but the domain is different.

example:

DNS Name: T0001SC6100.tsuc.tbna.net (this domain is Test)

DNS Name: S0001SC2748.suc.bna.net (this domain is Prod)

where:

T0001SC6100 (is computer Name) and “tsuc.tbna.net” (is the domain)

S0001SC2748 (is computer Name) and “suc.bna.net” (is the domain)

thanks!

(imported comment written by Lee Wei)

So it looks like we can just check for the uniqueness of the DNS Name property.

“Computer Name” is a built-in property for the BES Computer object, which is why the statement looks simple.

The following form however, will help you retrieve any properties available from BES Computers.

values of results from (bes computers) of bes property whose (name of it = 
"DNS Name")

To get the values that are duplicated

(it, multiplicity of it) of unique values whose (multiplicity of it > 1) of (

if (it = 
"") then 
"Missing DNS Name" 

else (it)) of values of results from (bes computers) of bes property whose (name of it = 
"DNS Name")

With some HTML formatting

(html 
"<table border=1 style=%22border-collapse: collapse; border: medium none;%22>" & html (
"<th>DNS Name</th><th>Duplicates</th>") & it & html 
"</table>") of concatenation of trs of (td of it & td of  (multiplicity of it as string)) of unique values whose (multiplicity of it > 1) of (

if (it = 
"") then 
"Missing DNS Name" 

else (it)) of values of results from (bes computers) of bes property whose (name of it = 
"DNS Name")

Finally a statement suitable as a custom report in Web Reports.

You create it by going to Web Reports --> Explore Data --> Custom --> paste the statement then Save Report

<?relevance (html 
"<table border=1 style=%22border-collapse: collapse; border: medium none;%22>" & html (
"<th>DNS Name</th><th>Duplicates</th>") & it & html 
"</table>") of concatenation of trs of (td of it & td of  (multiplicity of it as string)) of unique values whose (multiplicity of it > 1) of (

if (it = 
"") then 
"Missing DNS Name" 

else (it)) of values of results from (bes computers) of bes property whose (name of it = 
"DNS Name") ?>

Lee Wei

2 Likes

(imported comment written by SystemAdmin)

thanks, works perfectly, is what I needed

Saludos.

I have a similar issue, but I can’t seem to do this the same way. The OP’s was resolved because DNS name was unique when Computer name was not. I need to be able to check multiplicity of two values.

So I probably cannot execute the duplicate computer remover today because I cannot use just Computer Name or IP, but Computer Name + BES Client’s Parent Relay would work. Is there a good way to do that?

I am trying:
concatenation ", " of (values of (results (bes property “Computer Name”)) ; values of (results (bes property “BES Client’s Parent Relay”)))

But it is undefined.

Hi,

It looks like you are just missing the “of” between results and bes property: results of (bes property "Computer Name")

1 Like