Registered member login:
Register Now
Altirigos » Notification Server and Solutions » Notification Server » Here's a Script to Merge Duplicate Computers

» Current Poll
Do you leave the Aclient enabled?
YES - 82.81%
106 Votes
NO - 17.19%
22 Votes
Total Votes: 128
You may not vote on this poll.
» Stats
Members: 9,488
Threads: 11,748
Posts: 55,279
Top Poster: Nick (4,981)
Welcome our newest member, johno
» Online Users: 42
3 members and 39 guests
Gaute, lomac, Onion
Most users online at once 294, 06-30-2007 at 12:24 PM.
» March 2010
S M T W T F S
28 1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31 123
Reply
Old 03-22-2007, 06:02 PM   #51 (permalink)
 
JeffreyJRiggs's Avatar
 
Status: Super Altiris Admin
Join Date: 02-22-2006
Location: Williamstown, NJ
Age: 37
Posts: 504


Quote:
Originally Posted by shawn.m
the problem with this merge script is it only lets you merge computers with that considered duplicates by name and domain. If you have a dual domain environment - ugh I have it- then you need to merge on the name only.
does that include the machine name?
anotherwords.. we have dupes in our NS and it will be one with the domain name and the second for domain says computer name...


so
mydomainpc would be under domain and
mycomputernamepc would be under domain too...

we also have a workaround... I will try and compare this with our code......
but hey this may help alot!!!!!
__________________
SQL Fundamentals 101:
SELECT * FROM dbo.User WHERE Clue > '0'
Query batch completed, 0 rows
JeffreyJRiggs is offline   Reply With Quote
Old 03-23-2007, 10:06 AM   #52 (permalink)
 
chopper18's Avatar
 
Status: Super Altiris Admin
Join Date: 04-03-2006
Location: Gainesville, FL
Age: 41
Posts: 180


Lightbulb Maybe a merge script of 'duplicate names only' could be written...

Just a quick bump as I’m swamped right now…

For those who have more than one domain:

Steven’s last import of reports and a merge, includes the report that shows the resources that have duplicate names but could come from different domains, etc. (see my screenshot below for what the imported items look like in the console tree)

heres-script-merge-duplicate-computers-steven-oakes-dup-merge-import-menu.jpg

That report has come in very handy for me to identify PCs that say, have been moved from one domain to another with the same name and need to have their old counterparts cleaned up from the other domain’s Active Directory. I can see how even for my own environment, I may one day want to keep a resource’s Altiris history together from moves across domains, over time.

So although I’m no SQL guru at this point, it occurred to me that Steven or someone else could build on the ‘duplicate name only’ report to create another new report that could be scheduled that would actually do an additional merge function for those. Also, maybe some extra tricks could be included in the process, to do proper merges for the Asset Management serial number / bar code concerns that I heard mentioned earlier.

Does that make any sense?

Mike
__________________
Windows Server 2003 R2 Ent sp2
MS SQL 2005
.NET 1.1, Helpdesk 6 sp5
NS 6.0.6074 sp3+R7
Deployment Solution 6.9.164
All other solutions in Client Management Suite I
3,000 PC nodes
chopper18 is offline   Reply With Quote
Old 03-26-2007, 02:56 PM   #53 (permalink)
 
Status: Altiris Admin
Join Date: 08-15-2006
Location: London, Sydney
Posts: 92


Auto merge for name only.

Ive got only one domain here at the company I am working, but I am getting duplicates of machines with "WORKGROUP".

So - why dont I just make a report that does the same for name only?

I wouldnt want to enable this out of the box.. chances are this might stuff things up in companies with many domains (IE Computer records like "LAPTOP" and so on..) but it could be useful..

Steve
__________________
Steven Oakes
------------------
NS Guru
Steven_Oakes is offline   Reply With Quote
Old 07-17-2007, 03:30 PM   #54 (permalink)
 
Status: Altiris Admin
Join Date: 05-31-2005
Location: Ashburn, VA
Posts: 37


Complex duplicate matching

So here's the deal:
We've Re-imaged machines from 2000 to XP
And changed the naming convention
and changed the domain

(And we have multiple domains in our infrastructure).

We're doing this at 25 sites - thousands of PCs, so the whole manual merge is virtually impossible to manage.

Any suggestions on how to tweak the script for this setup?
What should be the same:
the first 2 octets of the IP
10.133.x.x
The location
The machine's serial number

(I would be happy to manually enter the old domain and the new domain in the SQL script somewhere, if possible, to ensure that I'm only changing the machines at the correct site).

Would it also be possible to put in an error check on the serial number field?
We have a couple know bogus serial numbers that show up for some reason:
VLRR is one of them.


I would appreciate any help.

Also, how does this work with synchronization with the helpdesk piece?
Anybody have any experience with that as well?

TIA.

Last edited by gurnles; 07-17-2007 at 03:32 PM..
gurnles is offline   Reply With Quote
Old 07-17-2007, 08:48 PM   #55 (permalink)
 
shawn.m's Avatar
 
Status: Altiris Admin
Join Date: 05-02-2005
Location: sac,ca
Posts: 72


use my serial number merge script. or use the stock altiris serial number merge script

before you do this go find all your known bad serial numbers and fix those.
I would almost advise doing this on your test server. also be aware you will lose all history on the old machine as Altiris considers the newer invenotry record as primary. You might lose other stuff also, which is why i advise testing in the test enviroment.
__________________
Altiris Admin
shawn.m is offline   Reply With Quote
Old 07-24-2007, 05:08 PM   #56 (permalink)
 
Status: Junior Altiris Admin
Join Date: 04-02-2007
Location: San Antonio, TX
Posts: 4


Smile Try this one...

Try this one. I modified the v2.4 and added another report to merge computers on name regardless of their respective domains. I don't know if it works "properly", as it got rid of all my duplicates while "debugging". I never tested it on a "test environment", just on my production environment. Let me know if it works out for you.
Attached Files
File Type: xml Duplicate computers.xml (36.4 KB, 143 views)
suedeworthey is offline   Reply With Quote
Old 07-25-2007, 08:35 AM   #57 (permalink)
 
Status: Altiris Admin
Join Date: 05-31-2005
Location: Ashburn, VA
Posts: 37


Merge / update helpdesk records?

Thanks, I'll give it a try.

Does anyone have a merge script that will update the helpdesk assets?

I've been running a report manually to find assets at the location with linked incidents and then running this script to change the incidents linked to the old asset to the new asset.

Code:
UPDATE [Altiris_Incidents].[dbo].[workitem_only_view]
/*Set to new asset id*/
SET [workitem_managed_object_id]='200329'
/* WHERE workitem_managed_object_id = old object id*/
WHERE [workitem_managed_object_id]='8643'
It would be awesome if someone made a merge script that had this as part of the subroutine.
gurnles is offline   Reply With Quote
Old 07-27-2007, 05:24 AM   #58 (permalink)
 
Status: Altiris Admin
Join Date: 08-15-2006
Location: London, Sydney
Posts: 92


Hey everyone

Sorry,

I usually listen for requests on the merge script and try to get it updated soon afterwards.
Im taking a break from work and at the moment I am travelling in a rally from London to Mongolia, so I cant work on anything until this is over.

If you are interested to find out more information about the rally.. go to www.teamtouchy.com. The rally's official site is also here: www.teamtouchy.com

I finish up sometime after August.. Hope everything works out in the meantime.

Steven
__________________
Steven Oakes
------------------
NS Guru
Steven_Oakes is offline   Reply With Quote
Old 07-27-2007, 10:30 AM   #59 (permalink)
 
dominique's Avatar
 
Status: Sticky...
Join Date: 03-04-2005
Location: Culver City, CA
Age: 53
Posts: 3,394


Enjoy your trip...

Hope everything is going well so far from home...
__________________
Thanks
Dom
http://www.altirigos.com

"Helping somebody else may help you"
dominique is offline   Reply With Quote
Old 09-06-2007, 04:45 PM   #60 (permalink)
 
Shadrach's Avatar
 
Status: Altiris Engineer (Super Mod)
Join Date: 02-21-2005
Location: San Antonio, Texas, USA
Posts: 242


It may just be me but is the Steven guy INSANELY SMART?

I ran the script today and it merged 1000+ machines for me.. Thank you so much for your work on this!
__________________
Scott Reopelle
Microsoft Certified Professional
altiris-got-yer-goat-goat2.gif





"Work saves us from three great evils: boredom, vice and need." - Voltaire

Shadrach is offline   Reply With Quote
Old 09-06-2007, 04:52 PM   #61 (permalink)
 
Nick's Avatar
 
Status: Altiris Architect (Site Founder)
Join Date: 01-01-2005
Location: RDU, North Carolina, USA
Posts: 4,981


Yeah Steven definitely knows his way around the Altiris product.
__________________
Scire potentia est (knowledge is power)
Nick is offline   Reply With Quote
Old 09-11-2007, 06:37 AM   #62 (permalink)
 
Status: Altiris Admin
Join Date: 08-15-2006
Location: London, Sydney
Posts: 92


I wouldnt use a merge script ?

I understand the problem.. but for all intents and purposes, Altiris will think these machines are entirely different, unless you have serial numbers populated with Assett installed.

Even with Assett installed, I would highly doubt that all of the serial number information is entered.. therefore making that solution less than 100%.

There are a few other options here:

- Leave the machines as they are in the database:
This will mean that the machines will eventually get purged as they grow old. You can use a domain filter in all of your reports, so that you are only seeing counts of migrated machines in your reporting environment.

- Another approach to this is to delete all of the old machines.. and start with new clean data?

- I suppose a merge could be done, but this would be a completely custom way to merge these machines and would require (probably) alot of development time. I have only thought about this for a few moments, but it seems quite involved. I am currently on holidays, and dont really have the environment to develop something like this right now.

What do you think about these other ideas?

I can provide something reasonably quickly which puts machines into a collection if they havent reported in a while, and then a script to retire or delete these? (Or just manually as the collection fills up) I think something like that might be a better way to go.





Quote:
Originally Posted by gurnles
So here's the deal:
We've Re-imaged machines from 2000 to XP
And changed the naming convention
and changed the domain

(And we have multiple domains in our infrastructure).

We're doing this at 25 sites - thousands of PCs, so the whole manual merge is virtually impossible to manage.

Any suggestions on how to tweak the script for this setup?
What should be the same:
the first 2 octets of the IP
10.133.x.x
The location
The machine's serial number

(I would be happy to manually enter the old domain and the new domain in the SQL script somewhere, if possible, to ensure that I'm only changing the machines at the correct site).

Would it also be possible to put in an error check on the serial number field?
We have a couple know bogus serial numbers that show up for some reason:
VLRR is one of them.


I would appreciate any help.

Also, how does this work with synchronization with the helpdesk piece?
Anybody have any experience with that as well?

TIA.
__________________
Steven Oakes
------------------
NS Guru
Steven_Oakes is offline   Reply With Quote
Old 09-11-2007, 09:03 AM   #63 (permalink)
 
Status: Altiris Admin
Join Date: 05-31-2005
Location: Ashburn, VA
Posts: 37


The serial numbers are 95% populated or so, more or less enough to do a merge on them.

However, the merge process orphans the ticket links. (So it's really not so much of a merge, as it is pick which one you want to survive).

I believe that the asset merge script should include a process to migrate helpdesk info and update the link from the old asset to the new one created by the merge.
It seems that Altiris should have developed a solution for this problem, as they say their systems work in synch, but most of the time work as truly separate solutions.

I wound up just deleting the assets in NS ( filtered by OS, and then delete). That eventually synch's over to helpdesk and makes the assets inactive.

I tried (and succeeded) to delete all the inactive assets in helpdesk. That was a big mistake. I've restored most of them now, including the default (none) asset that is required to create a trouble ticket.

Quote:
Originally Posted by Steven_Oakes
I understand the problem.. but for all intents and purposes, Altiris will think these machines are entirely different, unless you have serial numbers populated with Assett installed.

Even with Assett installed, I would highly doubt that all of the serial number information is entered.. therefore making that solution less than 100%.

There are a few other options here:

- Leave the machines as they are in the database:
This will mean that the machines will eventually get purged as they grow old. You can use a domain filter in all of your reports, so that you are only seeing counts of migrated machines in your reporting environment.

- Another approach to this is to delete all of the old machines.. and start with new clean data?

- I suppose a merge could be done, but this would be a completely custom way to merge these machines and would require (probably) alot of development time. I have only thought about this for a few moments, but it seems quite involved. I am currently on holidays, and dont really have the environment to develop something like this right now.

What do you think about these other ideas?

I can provide something reasonably quickly which puts machines into a collection if they havent reported in a while, and then a script to retire or delete these? (Or just manually as the collection fills up) I think something like that might be a better way to go.
gurnles is offline   Reply With Quote
Old 09-12-2007, 07:01 AM   #64 (permalink)
 
Status: Altiris Admin
Join Date: 08-15-2006
Location: London, Sydney
Posts: 92


Okay.

I can understand your problem, however really its becoming such an issue it should be fed back into the product as a workitem, so that these issues can be addressed in future versions of the product.

I recommend that you take that course of action, as any repairs on the forums would be outside of Altiris' development cycle, and will continue to be a problem for other customers.





Quote:
Originally Posted by gurnles
The serial numbers are 95% populated or so, more or less enough to do a merge on them.

However, the merge process orphans the ticket links. (So it's really not so much of a merge, as it is pick which one you want to survive).

I believe that the asset merge script should include a process to migrate helpdesk info and update the link from the old asset to the new one created by the merge.
It seems that Altiris should have developed a solution for this problem, as they say their systems work in synch, but most of the time work as truly separate solutions.

I wound up just deleting the assets in NS ( filtered by OS, and then delete). That eventually synch's over to helpdesk and makes the assets inactive.

I tried (and succeeded) to delete all the inactive assets in helpdesk. That was a big mistake. I've restored most of them now, including the default (none) asset that is required to create a trouble ticket.
__________________
Steven Oakes
------------------
NS Guru
Steven_Oakes is offline   Reply With Quote
Old 05-21-2008, 03:53 PM   #65 (permalink)
 
dbush's Avatar
 
Status: Super Altiris Admin
Join Date: 01-25-2006
Location: Dallas
Age: 30
Posts: 427


Curious if anyone has configured a report (or any other mechanism) to automatically merge based on Serial #, or if there's an obvious reason I wouldn't want to that I'm missing. Wanting to do this on a box that doesn't have Asset installed.
dbush is offline   Reply With Quote
Old 05-21-2008, 04:39 PM   #66 (permalink)
 
shawn.m's Avatar
 
Status: Altiris Admin
Join Date: 05-02-2005
Location: sac,ca
Posts: 72


use this script or the other 4 that i previously posted here. search on my name
__________________
Altiris Admin
shawn.m is offline   Reply With Quote
Old 05-21-2008, 05:53 PM   #67 (permalink)
 
dbush's Avatar
 
Status: Super Altiris Admin
Join Date: 01-25-2006
Location: Dallas
Age: 30
Posts: 427


Thanks for the quick reply Shawn...

Interesting thing is (the latest version) of this script only has an automatic merge based on name or name.domain. I ended up reading through all of your other posts and found 1 where you are merging duplicate network inv items based on the snmp table and one more where you did serial #, but it was inv_serial_number and not the inv_aex_hw_serial_number. I gave it a blow through anyways, but it didn't merge the computers returned from the report 'Duplicte Computers - by Serial Number (Inv_AeX_HW_Serial_Number) included in this post.

I'm going to schedule and automate the merging of computers returned in that report and just wondered if anyone else had already done it.

Feel free to chime back...
dbush is offline   Reply With Quote
Old 05-21-2008, 06:02 PM   #68 (permalink)
 
shawn.m's Avatar
 
Status: Altiris Admin
Join Date: 05-02-2005
Location: sac,ca
Posts: 72


read my previous comments on if you have a dual GUID creation server setup. Asset, Contract and Barcode on one server and inventory on a other server.

It is better to glance at your duplicates before auto merging them. Merge will DELETE purchase data in the current version of NS 6X. I have put in a enhancement request to not do this in future releases
__________________
Altiris Admin
shawn.m is offline   Reply With Quote
Old 05-21-2008, 06:03 PM   #69 (permalink)
 
shawn.m's Avatar
 
Status: Altiris Admin
Join Date: 05-02-2005
Location: sac,ca
Posts: 72


also just replace Inv_AeX_HW_Serial_Number instead of Inv_Serial_Number in my script.
__________________
Altiris Admin
shawn.m is offline   Reply With Quote
Old 05-22-2008, 12:22 AM   #70 (permalink)
 
dbush's Avatar
 
Status: Super Altiris Admin
Join Date: 01-25-2006
Location: Dallas
Age: 30
Posts: 427


:-) Yeah...I hear you. There's a few things like that I'd prefer to see enhanced in the 'next version.' Hopefully they'll get in there.

Thanks for the feedback...this was really a post as a sidethought since I was tied up, but I'll give that a whirl tomorrow and see what happens. I tried one script that had the hw table that didn't do the trick, but it's probably me.

I'm sure doing too many things at once makes you crazy...
dbush is offline   Reply With Quote
Old 05-22-2008, 10:08 PM   #71 (permalink)
 
Status: Altiris Admin
Join Date: 08-15-2006
Location: London, Sydney
Posts: 92


Hey Guys -

I can make a new xml file that includes my newest versions, and I can add the merging by duplicate on Inv_AeX_HW_Serial_Number, if people still have a need for it?

Steve
__________________
Steven Oakes
------------------
NS Guru
Steven_Oakes is offline   Reply With Quote
Old 07-23-2008, 06:41 AM   #72 (permalink)
 
Status: Altiris Engineer (Super Mod)
Join Date: 08-26-2005
Location: Germany
Posts: 28


Wink Report run

Hello Steve,

I take it that as soon as this report is run, it performs the merge and just displays what it has done?

As a report, it would be nice for it to display what it will do, and then do it when you run it a second time.

Obviously, for automation purposes, the first scenario is better.
AltirisAE is offline   Reply With Quote
Old 08-12-2008, 12:09 PM   #73 (permalink)
 
Status: Junior Altiris Admin
Join Date: 01-29-2008
Location: St. Louis
Posts: 6


New Version??

Steve do you have a new version? I haven't seen it posted anywhere.

Thanks!

Quote:
Originally Posted by Steven_Oakes View Post
Hey Guys -

I can make a new xml file that includes my newest versions, and I can add the merging by duplicate on Inv_AeX_HW_Serial_Number, if people still have a need for it?

Steve
ksteiner is offline   Reply With Quote
Old 05-21-2009, 06:20 PM   #74 (permalink)
 
Status: Junior Altiris Admin
Join Date: 11-26-2008
Location: Saskatchewan
Posts: 6


Post of newest XML?

I, too, am quite interested in the updated XML if that's ever been done.

I'm not sure if Steve is still monitoring this thread or not, and I realize it's age. I apologize for digging something this old back up..

Thanks!

Quote:
Originally Posted by ksteiner View Post
Steve do you have a new version? I haven't seen it posted anywhere.

Thanks!
newalloy is offline   Reply With Quote
Old 05-28-2009, 08:29 PM   #75 (permalink)
 
Status: Altiris Admin
Join Date: 08-15-2006
Location: London, Sydney
Posts: 92


Hey :D

Im still around guys.

What were the updates that people were looking for?

I should be able to put a new version together.
__________________
Steven Oakes
------------------
NS Guru
Steven_Oakes is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Powered by vBadvanced CMPS v3.0 RC2

All times are GMT -4. The time now is 02:54 AM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
vB.Sponsors
Altirigos