I would use a system like WSUS, Where I could provide a delimited list of groups I would like the system to appear in. This way I could produce inventory reports based on charge back code or System Type among others.
Another change that would be requred is that the System name is a uniq entry in AIS, so that new entries overwrite old entries if the system is updated (ie. OS or Department changes)
I've included a code sample of how we set the group for client machines in our system. We use this code along with a GPO (computer configuration side) to run the startup script each time the computer connects to the domain.
The Registy entry shold then get passed to AIS via the AIS client.
' Get the computerName of PC
set objNetwork = createobject("Wscript.Network")
computerName = objNetwork.ComputerName
ou = getGroupByComputerName(computerName)
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Policies\Microsoft\System Center Online\Client"
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath
strValueName = "ClientGroup"
strValue = ou
oReg.SetStringValue _
HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
function getGroupByComputerName(byval computerName)
' *** Function to find ou/container of computer object from computer name ***
DIM namingContext, ldapFilter, ou
DIM cn, cmd, rs
DIM objRootDSE
' Bind to the RootDSE to get the default naming context for
' the domain. e.g. dc=nada,dc=org
set objRootDSE = getobject("LDAP://RootDSE")
namingContext = objRootDSE.Get("defaultNamingContext")
set objRootDSE = nothing
' Construct an ldap filter to search for a computer object
' anywhere in the domain with a name of the value specified.
ldapFilter = "<LDAP://" & namingContext & _
">;(&(objectCategory=Computer)(name=" & computerName & "))" & _
";distinguishedName;subtree"
' Standard ADO code to query database
set cn = createobject("ADODB.Connection")
set cmd = createobject("ADODB.Command")
cn.open "Provider=ADsDSOObject;"
cmd.activeconnection = cn
cmd.commandtext = ldapFilter
set rs = cmd.execute
if rs.eof <> true and rs.bof <> true then
ou = rs(0)
'MODIFY THIS PART FOR YOUR DOMAIN
' Convert distinguished name into OU.
' e.g. cn=CLIENT01,OU=###-###,dc=nada, dc=nada.org
' to: ###-###,dc=nada,dc=org
ou = mid(ou,instr(ou,",")+4,len(ou)-instr(ou,","))
' to: ###-###
ouPieces = Split(ou, ",")
ou = ouPieces(0)
getGroupByComputerName = ou
end if
rs.close
cn.close
end function