We have been tasked to group everything in the Kace1000 to departments for assest tracking and billing purposes.  They want to be able to add a parameter to some reports that will group either hardware or software by department.  We have discussed labels (a lot of work and upkeep), and adding a department entry in the computer descriptions field for the windows 7 machines but will not cover the mac's.

Answer Summary:
0 Comments   [ - ] Hide Comments


Please log in to comment

Community Chosen Answer



This will do the same thing, but use a drop down for departments instead.


# Edit This item to change the DropDown Values


[array]$DropDownArray = "Finance", "IT", "HR"


function Return-DropDown {


$Choice = $DropDown.SelectedItem.ToString()


# Edit for registy path

    New-Item -Path HKLM:\Software\KACE\Dept -Value $choice –Force







$Form = New-Object System.Windows.Forms.Form


$Form.width = 300

$Form.height = 150

$Form.Text = ”Select Department”


$DropDown = new-object System.Windows.Forms.ComboBox

$DropDown.Location = new-object System.Drawing.Size(100,10)

$DropDown.Size = new-object System.Drawing.Size(130,30)


ForEach ($Item in $DropDownArray) {






$DropDownLabel = new-object System.Windows.Forms.Label

$DropDownLabel.Location = new-object System.Drawing.Size(10,10)

$DropDownLabel.size = new-object System.Drawing.Size(100,20)

$DropDownLabel.Text = "Departments"



$Button = new-object System.Windows.Forms.Button

$Button.Location = new-object System.Drawing.Size(100,50)

$Button.Size = new-object System.Drawing.Size(100,40)

$Button.Text = "Select a Department"





Answered 07/16/2012 by: dugullett
Red Belt

  • Thanks you saved me a ton of time, hopefully I can return the help sometime.
Please log in to comment
Answer this question or Comment on this question for clarity



I'll probably use some form of this. With Powershell. This will prompt the user, and set the reg key based on what they select. Now hopefully they know what department they are in.

$title = "Message from Admin"
$message = "Please Select Your Department"
$Finance = New-Object System.Management.Automation.Host.ChoiceDescription "&Finance", `

    "Sets Finance as Department"

$IT = New-Object System.Management.Automation.Host.ChoiceDescription "&IT", `

    "Sets IT as Department."

$HR = New-Object System.Management.Automation.Host.ChoiceDescription "&HR", `

    "Sets HR as Department."

$Maintenance = New-Object System.Management.Automation.Host.ChoiceDescription "&Maintenance", `

    "Sets Maintenance as Department"

$options = [System.Management.Automation.Host.ChoiceDescription[]]($Finance, $IT, $HR, $Maintenance)

$result = $host.ui.PromptForChoice($title, $message, $options, 0) 

switch ($result)

    {  0 {New-Item -Path HKLM:\Software\KACE\Dept -Value Finance –Force}
 1 {New-Item -Path HKLM:\Software\KACE\Dept -Value IT –Force}
        2 {New-Item -Path HKLM:\Software\KACE\Dept -Value HR –Force}

        3 {New-Item -Path HKLM:\Software\KACE\Dept -Value Maintenance –Force}

Answered 07/16/2012 by: dugullett
Red Belt

  • I just need a way to do a ldap read to AD I could pull their deparment from there. We set our AD fields from Human Resources thru a Peoplesoft connector. Hey thanks for the code. It has been years since I really wrote a lot of code, I am the only one who knows the K2000 and I am teir 3 hardware/software specialist so does not leave a lot of time to work on code.
    • Something like this should work for that. I cannot currently test this in my environment. So make sure you do before deploying.

      import-module ActiveDirectory
      $dept= Get-ADUser -identity $env:username -properties Department
      New-Item -Path HKLM:\Software\KACE\Dept -Value $dept –Force
  • vb or powershell?
    • Powershell
      • That will query AD with the current user credentials for their Department. Then set the reg key based on Deparment field. It does require "Active Directory Web Services". That's the reason I haven't tested it.
  • need to check with server crew to see if that is running.
Please log in to comment

We bit the bullet and organized our Active Directory OUs according to department. I then created the necessary LDAP labels based on those OUs. It took a lot of time up front but it has been worth it in the long run. There have been other instances where having the departments "automatically updated" based on the OU have come in handy. For instance, we can easily make custom patch schedules for departments and as long as the machines are placed in the proper OU everything works smoothly. Moving the machine into the proper OU is part of our deployment workflow now so it happens 99% of the time.

Answered 07/16/2012 by: chucksteel
Red Belt

  • Our OU's are structured by site/location. We do have machine groups for a lot of the departments because of using GPO's to push the network printers for the departments. Also we have user security groups for the departments. We do populate the Department field in AD from peoplesoft so it stays current.
Please log in to comment

Do you already have the asset info in a csv, or will you be flying blind?

Answered 07/13/2012 by: dugullett
Red Belt

  • Flying blind, new project, we have student workers answering phones, so entry work is possible in between calls
  • We do have software usage license's in excell by department for the big ones
    • I'm about to have to go through almost the same thing. I've thought about making a .reg file that will populate a key with the dept. Then have Kace inventory that key. I guess the hard part is getting it out there. I don't guess you have separate images for dept?
      • If you have the departments segmented by IP address, you could use a regex argument to limit your install by IP address range: http://www.kace.com/support/resources/kb/article/Tool-to-assist-in-building-REGEX-Inventory
  • No two images only for admin one 32 one 64.
    I was looking a using a phone person to run a utility from pstools (psexec) and creating a little c++ menu that you put the machine name in choose the department from a dropdown and let it attach to the box and change the registry key remotely
    • I'm sure you could probably work that into a post install task as well.
      • We will put the menu on a server and call it as a runonce so the tech will not spell the departments wrong. With it on the server we can update when needed.
        Do not know if you ever used psexec, it is powerful and can be dangerous
  • We will have staff set the key when they deploy any new image as part of the replacement proceedure.
Please log in to comment