| Author |
Message |
![[Post New]](/Sysforums/templates/default/images/icon_minipost_new.gif) 23/04/2009 18:35:42
|
techguy
SysAid Mod

Joined: 11/06/2008
Messages: 1451
Location: England
Offline
|
Sorry it does not display the value of the registry key, all it does is filter the list so it only displays assets that contain that registry key.
|
Need help? Try the SysAid wiki first! - http://sites.google.com/site/sysaidwiki |
|
|
![[Post New]](/Sysforums/templates/default/images/icon_minipost_new.gif) 05/05/2009 11:24:32
|
EbroIN
Elite SysAider

Joined: 25/03/2009
Messages: 244
Offline
|
techguy wrote:Sorry it does not display the value of the registry key, all it does is filter the list so it only displays assets that contain that registry key.
Thanks for your follow up (I am sooooo late)...
Well - is there ANY way to display that values? Maybe I can create a view on database level?
Thanks for your feedback!
|
|
|
![[Post New]](/Sysforums/templates/default/images/icon_minipost_new.gif) 21/05/2009 07:02:37
|
michalp
SysAider
Joined: 18/06/2008
Messages: 26
Location: London, UK
Offline
|
We have same problem here. I am more than happy to use ODBC driver to database or basically ANY form of extracting that information from the system. Could somebody from SysAid point me/us into right direction, where this information about Key (I believe it is in main XML config file?) and Value (it has to be somewhere on the server?) is stored? It would help us a million, as it is great feature for pro active admins.
|
|
|
![[Post New]](/Sysforums/templates/default/images/icon_minipost_new.gif) 22/05/2009 04:05:22
|
michalp
SysAider
Joined: 18/06/2008
Messages: 26
Location: London, UK
Offline
|
I have found crude way of extracting that information using ODBC driver (MySQL in my case with MS QUERY).
Just use this SQL command:
LOCATE finds you position of first letter of Reg Key you are after.
47 is manually calculated length of Reg Key (use small macro TEXT TO COLUMNS in Excel) edit: or obviously you can use SQL LENGTH() function
39 seems to be a distance to value of that Reg Key
3 is manually determined length of value you are after, in most cases it would be constant or predictable
I am pretty sure this code could be better optimized, so please share your opinion/ideas. I used parameters with VBA and Excel in the past, so I think they can be used, to make process very automatic.
This message was edited 2 times. Last update was at 22/05/2009 04:30:40
|
|
|
![[Post New]](/Sysforums/templates/default/images/icon_minipost_new.gif) 22/05/2009 05:19:38
|
EbroIN
Elite SysAider

Joined: 25/03/2009
Messages: 244
Offline
|
Hi Michalp,
yeah, I also found out that the registry values are stored within the column 'inventory_xml' in 'sysaid.computer' like that way:
I dare to say that for SQL SERVER 2000 Users this might be a real pain in the ass (please excuse me). I can not rely on functions like LOCATE because they are not known as SQL2000 statement. But SQL SERVER 2000 can handle XML documents so my way of displaying these Values should be parsing the XML value, dump the relevant components into a temporary table and creating a VIEW that displays the data that I am looking for. Afterwards drop that table.
I'm working on this view right now and will post a valid TSQL Statement if I've finished my work.
@Ilient: Why don't you drop those values into a table?
Best regards - EbroIN
|
|
|
![[Post New]](/Sysforums/templates/default/images/icon_minipost_new.gif) 22/05/2009 07:08:24
|
EbroIN
Elite SysAider

Joined: 25/03/2009
Messages: 244
Offline
|
ok,
this one is a quite DIRTY HACK but this VBS drops all Values to the screen, tabseparated...
We have a SQL Server 2000 here although I expect that this script might also work with mySQL. You might have to adjust the ADVANCED_SETTINGS here (especially the connection string). This script uses your current NT logon credentials, so if you need to pass a user and password, you have to modify the SQL Connection string.
Instructions:
- CopyPaste the code into a textfile like C:\testDB.vbs
- Edit the "CONFIGURE YOUR SERVER SETTINGS HERE" section and enter your servername and DB Name
- run the script with CSCRIPT!
This hack is quite dirty but works good for me... I do not parse the xml file because I search the string quite featherbrained to locate the entries. This hack was quicker than implementing MSXMLDOM. Scripting.Dictionary might also do a good job especially dropping large tables directly to Excel files. I do not need such detailed output but there shouldn't be any problem to generate an excel file with VBScript.
But it would be even better if custom registry values are entered directly in the DBMS and not in this XML ntext column.
Hope this helps somebody out...
best regards,
EbroIN
This message was edited 1 time. Last update was at 22/05/2009 07:12:44
|
|
|
![[Post New]](/Sysforums/templates/default/images/icon_minipost_new.gif) 10/09/2011 19:03:00
|
ctprobate
SysAider
Joined: 06/09/2011
Messages: 2
Offline
|
Here is the SQL (SQL 200 :
DECLARE @computer VARCHAR(20)
DECLARE @xml XML
DECLARE @Registry TABLE (
ComputerName VARCHAR(20),
regName VARCHAR(500),
regValue VARCHAR(100)
)
DECLARE computer_cursor CURSOR FOR
SELECT computer_name FROM computer
OPEN computer_cursor
FETCH NEXT FROM computer_cursor
INTO @computer
WHILE @@FETCH_STATUS = 0
BEGIN
SELECT @xml = REPLACE(CAST(inventory_xml AS VARCHAR(MAX)),'agen:','') FROM dbo.computer c WHERE computer_name = @computer
INSERT @Registry
(ComputerName,regName,regValue)
SELECT
@computer,
doc.col.value('regName[1]', 'varchar(500)') [regName],
doc.col.value('regValue[1]', 'varchar(100)') [regValue]
FROM @xml.nodes('/inventory/registryValue') doc(col)
FETCH NEXT FROM computer_cursor
INTO @computer
END
CLOSE computer_cursor
DEALLOCATE computer_cursor
SELECT * FROM @Registry
|
|
|
![[Post New]](/Sysforums/templates/default/images/icon_minipost_new.gif) 01/05/2012 18:53:45
|
pdlp
Super SysAider

Joined: 25/11/2009
Messages: 83
Offline
|
This would be really useful....
Is it possible to use iReports for this?
This message was edited 1 time. Last update was at 01/05/2012 19:02:35
|
|
|