Add Machines to Manual Label in bulk
Is there a good way to add about 400 machines to a manual label. These machines share nothing in common so I cannot use smart labels.
Answers (8)
One way I cheated with the manual label is by doing the following. I was needing to have about 700 machines in a manual label. I lucked out by having a list of machines in csv.
I took my csv and ran this formula on the cells where the machine names were listed ="'"&B1&"',". Assuming B1 is the start of your machine names. This will add ' ', to every cell after you click and drag down your list. Then copy and paste that new row into the SQL query below.
I created a dummy smart label. I then modified it to include an IN command in the SQL.
select MACHINE.*, C.CLIENT_CONNECTED, UNIX_TIMESTAMP(now()) - UNIX_TIMESTAMP(LAST_SYNC) as LAST_SYNC_TIME, UNIX_TIMESTAMP(LAST_SYNC) as LAST_SYNC_SECONDS from ORG1.MACHINE LEFT JOIN KBSYS.KUID_ORGANIZATION O ON O.KUID=MACHINE.KUID LEFT JOIN KBSYS.SMMP_CONNECTION C ON C.KUID = MACHINE.KUID AND O.ORGANIZATION_ID = 1 where ( MACHINE.NAME IN ('COMPUTER1','COMPUTER2', 'COMPUTER3'))
This will still be considered a smart label so you can still create a manual label afterwards. It does beat checkmarking 500 boxes though.
Comments:
-
Nice! - jverbosk 11 years ago
-
This idea does sound nice, but I'm not fluent in SQL. I can and do use MySQL workbench to run and test queries, but I have no idea how to "copy and paste that new row into the SQL query"... Paste it where, exactly? - MichaelMc 9 years ago
-
Copy and paste in place of 'COMPUTER1','COMPUTER2', 'COMPUTER3'. Make sure the names are in between ' '. - dugullett 9 years ago
Here's another idea. I'm assuming that you at least have the list of those computers that need the label in a file of some sort, perhaps a spreadsheet? You can use a field to the Computer Asset type to designate those included in the audit. So it would work something like this:
Export from the Inventory a list of all computers including the serial number and computer name.
Using Excel you should be able to filter that list down to just those machines from your "needs audited" list.
Now you have a list of the computer serial numbers that need to be included in the audit.
Add a column to the spreadsheet that will be imported to the asset database. You can either use the Notes column if it isn't already in use, or add a field to the Computers asset type. If you think this may happen in the future, then perhaps a generic "Include in Audits" would work and you can populate it with Yes answers for these assets.
Import the spreadsheet using the Asset Import function being sure to use the serial number as the primary key so that records are updated and not duplicated.
You can now perform an advanced search on the Inventory which allows you to search the Asset fields for the asset that matches the computer. You could actually even setup a smart label to search the same field if you wanted to.
Comments:
-
Sorry it took so long to reply. This did work. I got sidetracked on other projects. Thanks for your help. - dugullett 12 years ago
I'm curious why you are labeling them with the same label if they don't have anything in common.
Comments:
-
We're under a software audit and the want the report to run on just these machines. Not every machine will have the software, but if they do then it will catch it with a custom inventory.
There are other machines that will have this software, but those do not need to be included in the report. - dugullett 12 years ago -
Is the number of machines that will have the software but won't be included in the audit smaller? If so, you could manually apply a label to them (e.g. "No Software Audit") and then create a smart label that applies to machines with software but without designated label. - chucksteel 12 years ago
-
That is a great idea. Unfortunately there are 801 with the suite, and 400 that need to be audited. I guess is that number grows that will be the way I do it. I'm still waiting on the "official" word. - dugullett 12 years ago
If there's no common thread, I'd be prepared to start clicking. ^_^
If you have a text list of the machine names, you could dump that into a smart label's SQL code (MACHINE.NAME rike '123,456,789,etc') and hit them like that.
Or if you use ADUC and is this something that will need maintained/updated? If so, I would populate the computer object's Description field and pull them in via an LDAP label, so as more computers that meet this criteria can just be tagged as they are joined to the domain. I just did this yesterday for ~350 machines yesterday when I completely redid my patch setup.
If you decide to go the LDAP route and need steps, I have a writeup on that here:
http://www.itninja.com/question/ldap-patching-sql-reports-using-all-three-for-efficient-managed-patching-and-other-cool-tric
Just forgive the formatting as it's being affected by a bug that's supposed to be addressed soon. And ignore the patching section - I'll be doing a major rewrite on that.
John