Registered member login:
Register Now
Altirigos » Deployment Solution » Scripting/Tools/Docs » Substituting "Location" values

» Current Poll
Do you leave the Aclient enabled?
YES - 82.51%
217 Votes
NO - 17.49%
46 Votes
Total Votes: 263
You may not vote on this poll.
» Stats
Members: 10,094
Threads: 12,231
Posts: 57,325
Top Poster: Nick (4,991)
Welcome our newest member, hussamdabit
» Online Users: 31
2 members and 29 guests
GeoMac, netosv
Most users online at once 294, 06-30-2007 at 12:24 PM.
» September 2010
S M T W T F S
293031 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 12
Reply
Old 02-05-2009, 01:34 PM   #1 (permalink)
 
Status: Junior Altiris Admin
Join Date: 09-27-2006
Location: West Point, NY
Posts: 6


Substituting "Location" values

Hello, everyone! My thanks to Nick for straightening out my account issues.

I was researching how to write a job that <pushes> 'Location' values (found under computer properties) to a computer already in the database, rather than pull (using token variables). Specifically, I would like to push an entry like "Personnel" to %DEPT% or "Library" to %SITE% through a DS job.

My idea would be to flex the 'Location' information on demand, since there's constant internal shuffling and I frequently have to load new software based on duty assignment. If I was able to set 'Location' data easily, I could use condition codes to automate whether to run a given installation job or not. I do <NOT> want to prompt the users for 'Location' data, and I haven't found a way to use the Configure interface to set location information (only "General" and "User Account" settings would be similar).

I can see the elements I want to access in SQL using the following sort of statement, (but am very hesitant to muck about with the records directly):
USE eXpress
SELECT [eXpress].[dbo].[location].[dept], [eXpress].[dbo].[location].[site]
FROM [eXpress].[dbo].[location]
where [eXpress].[dbo].[location].[dept] LIKE 'Admin%'


I believe I found the preferred method using the running of this script:
REM Prepare tokenized computer configuration to be copied
REM ReplaceTokens .\temp\tokenized.cfg .\temp\%ID%.cfg


However, looking at the "tokenized.cfg", I can't identify where the correct syntax or placement of the location information; the elements are only those available through the regular Configure method.

My site uses Deployment Solution 6.8 and HelpDesk, but nothing else from Altiris. I suspect that this is relatively easy if you have Inventory or even Notification Server, but we won't be purchasing either.

Any suggestions?

Respectfully, jmervyn.

P.S. I neglected to mention that I saw something similar here already labeled "Import token into registry", but I need pretty much the opposite result of what that individual required.

Last edited by jmervyn; 02-05-2009 at 01:43 PM..
jmervyn is offline   Reply With Quote
Old 02-24-2009, 08:02 AM   #2 (permalink)
 
Status: Junior Altiris Admin
Join Date: 09-27-2006
Location: West Point, NY
Posts: 6


Anyone?
jmervyn is offline   Reply With Quote
Old 02-24-2009, 11:32 AM   #3 (permalink)
 
Jezz's Avatar
 
Status: Altiris Admin
Join Date: 02-20-2005
Location: Reading, , United Kingdom
Posts: 98


jmervyn

Look at this KB article. It is changing the DB from a DS job.

https://kb.altiris.com/article.asp?article=36659&p=1
Jezz is offline   Reply With Quote
Old 03-06-2009, 12:58 PM   #4 (permalink)
 
Status: Junior Altiris Admin
Join Date: 09-27-2006
Location: West Point, NY
Posts: 6


Thanks for the reply! That's definitely one piece of the puzzle (execution of a stored procedure from a DS job).

Unfortunately, not only do I get this error:
Server: Msg 2812, Level 16, State 13, Line 1
Could not find stored procedure 'wc_upd_computer_group'.

- but also, that's only going to apply to computer groups. I need to find wherever the stored procedures for the "department" might be. They've got to be somewhere out there, since the user can be prompted to enter them.

Don't they?
jmervyn is offline   Reply With Quote
Old 03-06-2009, 02:06 PM   #5 (permalink)
 
Status: Junior Altiris Admin
Join Date: 09-27-2006
Location: West Point, NY
Posts: 6


I found the correct stored procedure, labeled dbo.ins_location


SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO


create procedure ins_location
@computer_id int,
@site varchar( 128 ) = null,
@dept varchar( 128 ) = null,
@mailstop varchar( 128 ) = null,
@contact varchar( 128 ) = null,
@email varchar( 128 ) = null,
@phone varchar( 128 ) = null
as
begin transaction

delete from location where computer_id = @computer_id

insert into location
( computer_id, site, dept, mailstop, contact, email, phone )
values
( @computer_id, @site, @dept, @mailstop, @contact, @email, @phone )

if (@@error != 0)
begin
rollback transaction
end
else
begin
commit transaction
end

return @computer_id

GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
jmervyn 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 10:30 PM.


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