/build/static/layout/Breadcrumb_cap_w.png

Naming Computers & Adding User To Group

I'm rather new to KACE, and very new to this website.

I have several new Dell Machines.

I have a database that contains the service tag of the machine, what the name of the computer will be, and the AD User name of the person the computer will be assigned to.

Is it possible to create a task that will name the machine by using the service tag to look up the desired name, name it that, then join the domain, and finally add the user the computer will be assigned to the local admin group?

Thanks.

0 Comments   [ + ] Show comments

Answers (4)

Posted by: dchristian 12 years ago
Red Belt
0
Wow,

Sounds like you got a lot going on there.

What i would do is break this up into smaller tasks.

Here's a link that'll give you an idea on how to rename the machine and join it to the domain.
[link]http://www.kace.com/support/kb/index.php?action=artikel&cat=54&id=763&artlang=en[/link]

Your definitely going to need to do some scripting to parse the text file.

Here's an old post that has an example:
[link]http://itninja.com/question/installing-sms-2.0-with-edirectory51&mpage=1[/link]

Once you get that figured out, it should be pretty easy to add the user to the local admin group.

Just curious what OS are you deploying?
Posted by: zhuo1005 12 years ago
Yellow Belt
0
ORIGINAL: gcoolong

I'm rather new to KACE, and very new to this website.

I have several new Dell Machines.

I have a database that contains the service tag of the machine, what the name of the computer will be, and the AD User name of the person the computer will be assigned to.

Is it possible to create a task that will name the machine by using the service tag to look up the desired name, name it that, then join the domain, and finally add the user the computer will be assigned to the local admin group?

Thanks.





Once again great post. You seem to have a good understanding of these themes.When I entering your topic,I felt this . Come on and keep your topic will be more attractive. To Your Success!

-----------------------------------------------------------------------------
[url=http://www.dressale.com/wedding-dresses-mermaidtrumpet-wedding-dresses-c-2_3_25.html]Trumpet Wedding Dresses[/url]|[url=http://www.dressale.com/wedding-dresses-new-style-wedding-dresses-c-2_3_18.html]New Style Wedding Dresses[/url]|[url=http://www.dressale.com/wedding-dresses-sheathcolumn-wedding-dresses-c-2_3_23.html]Column Wedding Dresses[/url]
Posted by: Roonerspism 12 years ago
Second Degree Brown Belt
0
gcoolong,

This is something that is actually pretty easy to do and we do it here.

In our environment as a part of our imaging process we do the following:

Query the local machine for BIOS Serial
Query the KACE Database for the machine name using the BIOS Serial
Query the KACE Database for the Assigned User using the BIOS Serial
Set the name and user in the local administrators group so that only the one user is an admin on the machine.

You can do this by creating a script/post install with the following information in it: (the below script has been slightly modified to what we use in order to allow easier access, test it thuroughly before use.) This VB script queries based upon the computer name, looking directly at the asset table.



YOURKACESERVERNAME = blabla@blabla.com
YOURKACEPORT = 3306
YOURKACEDATABASE = ORG1
YOURKACEUSER = R1
YOURKACEDBPASSWORD = box747

Set wshShell = WScript.CreateObject( "WScript.Shell" )
Set wshell = CreateObject("WScript.Shell")

strComputerName = wshShell.ExpandEnvironmentStrings( "%COMPUTERNAME%" )

WshShell.Run "net localgroup Administrators /add " & FetchHostOwner (strComputerName), 1, true

function FetchHostOwner (Hostname)
'This function will return the username for a given hostname from KACE
'on error resume next
Dim objConnection
Dim objCommand
Dim objResultSet
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
Set objResultSet = CreateObject("ADODB.recordset")

Dim ConnectString
ConnectString = "DRIVER={MySQL ODBC 5.1 Driver}; SERVER=" & YOURKACESERVERNAME & "; PORT=" & YOURKACEPORT & "; DATABASE=" & YOURKACEDATABASE & "; USER=" & YOURKACEUSER & "; PASSWORD=" & YOURKACEPASSWORD & "; OPTION=3;"

Dim ReturnVal

objConnection.Open ConnectString
With objCommand
.CommandType = 1
.ActiveConnection = objConnection
.CommandText = "select USER_NAME as Username from ASSET inner join USER on ASSET.OWNER_ID = USER.ID where ASSET.NAME = '" & hostname & "' limit 1"
Set objResultSet = .Execute
End With

if objResultSet.eof = true then
ReturnVal = "None Found"
else
ReturnVal = objResultSet("Username")
end if
Set objCommand = Nothing
Set objConnection = Nothing
FetchHostOwner = ReturnVal
end function


Alternately you can alter the query to search for BIOS Serial number instead of Computer name by pulling it with the following the WMI Query. There will be a table join or two, just let us know if you have any troubles with building the query.


Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colSMBIOS = objWMIService.ExecQuery ("Select * from Win32_BIOS")
For Each objSMBIOS in colSMBIOS
strSerial = objSMBIOS.SerialNumber
Next
Posted by: vineeta 12 years ago
Yellow Belt
0
Hello gcoolong,
Do you wish to install any specific OS on these dell machines or do you simply want to rename the machines to their service tags and join AD domain?

If the answer is yes to installing a specific OS on the dell machines,here's what you would do:

1.You could create a scripted install if you have the source media available.
2.Attach the following 3 pre-installation tasks:
-Create Single Partition
-Format C: as NTFS
-Install Vista/20008/7 MBR (Assuming you are installing either of these 3 Operating systems)

3.Create postinstall tasks (batch script)to retrieve service tag number:
a)wmic bios get serialnumber

b)Upload ,say the csv file (with columns service tag, computer name,AD user name) and parse file to get service tag.

c)Name computer to the username matching that service tag

d)Join domain.

Thanks,
Vineeta
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ