» Site Navigation |
|
|
» Stats |
Members: 9,489
Threads: 11,748
Posts: 55,279
Top Poster: Nick (4,981)
|
| Welcome our newest member, jbwex |
» 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
| 1 | 2 | 3 |
|
 |
04-30-2005, 02:13 AM
|
#1 (permalink)
|
Status: Altiris Admin
Join Date: 04-30-2005
Location: Virginia
Age: 39
Posts: 37
|
Move computer objects DS from a client
Does anyone know how a machine can move from the New Computer container in DS into a more suitable Computer Container (custom group) either through a DOS or Windows script while it's being "deployed"?
I already have a script that will modify the aclient.inp file for a machine that already has an Windows OS and has never been discovered by the DS server and of coarse will put itself into the right Computer Container; however, what about new computers purchased and bootup via PXE. Once they bootup, DS will put it in the New Computers container and that's where it will remain unless an admin moved the object into what container it should finally reside in.
Any ideas? Thanks.
|
|
|
04-30-2005, 09:49 AM
|
#2 (permalink)
|
Status: Altiris Architect (Site Founder)
Join Date: 01-01-2005
Location: RDU, North Carolina, USA
Posts: 4,981
|
There are a couple of ideas that come to mind.
The easiest is to create virtual computers for the workstations that are coming in new, dependant on you knowing some basic information about them to do this. You can then stage them into the groups of your choice.
The second and one would be to run a query against the express database and move the workstations to a group based on something like the naming convention or the IP address. This method could be run on a schedule and would be the best approach for an automated solution.
__________________
Scire potentia est (knowledge is power)
|
|
|
04-30-2005, 10:45 AM
|
#4 (permalink)
|
Status: Altiris Architect (Site Founder)
Join Date: 01-01-2005
Location: RDU, North Carolina, USA
Posts: 4,981
|
Posted the code here for reference.
Note that it is a script that would be server side (in the advanced options of a run script)
OSQL -E -deXpress -Q"Update computer where computer_id='%ID%' set group_id =NULL"
Change the group_id value from NULL to whatever the group_id of the group you want to move them to. NULL will put them in the root of the tree and -7 is the new computers group.
If you dont know the group name then it gets a little bit tricky. You can try this script and let me know if it works. Note that you have to have the group name set in the batch file and that if there is multiple groups with the same name the computers will go in to the last one with that name that returns from the query.
This is also a server side script. Be aware of wordwrap as it could cause you problems here.
------------------------------------------------------------------------
SET COMPUTERGROUPNAME=GROUP1
for /f "delims=" %%i in ('osql -E -dexpress -h-1 -Q "SET NOCOUNT ON;SELECT group_id from computer_group where name = '%COMPUTERGROUPNAME%'"') do CALL :QUERY "%%i"
GOTO:EOF
:QUERY
set temp1=%~1
REM This statement has to be put in since OSQL passes in blank lines, but is simple
REM to deal with because the value we are looking for is numeric
if %temp1% GEQ -7 OSQL -E -deXpress -Q"Update computer set group_id ='%temp1%' where computer_id='%ID%'"
GOTO:EOF
*Note: Code created by NKeith
__________________
Scire potentia est (knowledge is power)
|
|
|
04-30-2005, 06:56 PM
|
#5 (permalink)
|
Status: Altiris Admin
Join Date: 04-30-2005
Location: Virginia
Age: 39
Posts: 37
|
Thanks dudes, I'll give this a shot on Monday.
|
|
|
05-01-2005, 11:30 PM
|
#6 (permalink)
|
Status: Altiris Architect (Site Founder)
Join Date: 01-01-2005
Location: RDU, North Carolina, USA
Posts: 4,981
|
I just tested the scripts and they work as described.
__________________
Scire potentia est (knowledge is power)
|
|
|
 |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
All times are GMT -4. The time now is 06:15 AM.