Video Screencast Help
Search Video Help Close Back
to help
New in the Rewards Catalog: Vouchers for "Symantec Technical Specialist" and "Symantec Certified Specialist" exams.

Collection based on AD Description Field?

Updated: 21 May 2010 | 18 comments
durkinr's picture
+1 1 Vote
Login to vote
This issue has been solved. See solution.

I would like to build a computer collection based on the AD description field for a computer. For example, the description contains the word Conference. We do a full AD import every month and update weekly. I'm not sure where this information is stored in the Altiris DB. Anyone have any ideas?

Comments

KSchroeder's picture
26
Oct
2009
0 Votes 0
Login to vote

Is this the Comment field?

Hi durkinr,
Is this the same as the "Comment" or "Computer description" field you see when you open the System control panel and click the "Computer Name" tab?  If it is there is a custom inventory already created for that.  If it is an AD computer object property, we can work with that too without too much trouble.

Let me know; I can point you to the existing Custom Inventory or work with you to generate a custom inventory for the machine's computer object properties in AD.

Thanks,
Kyle
Symantec Trusted Advisor

For Forum threads, please click "Mark as Solution" if answered.
For all content, please give a thumbs up if you agree with or support the post.

durkinr's picture
26
Oct
2009
0 Votes 0
Login to vote

It is the AD computer object

It is the AD computer object description.

I'd like to see the custom inventory you are talking about as well, that might be useful for other purposes.

Thanks!

KSchroeder's picture
26
Oct
2009
1 Vote +1
Login to vote

Computer Description custom inventory

This thread has the custom inventory with the Computer description field.  I'll have to do a little digging to get the computer description value, but I'll see what I can find.

Thanks,
Kyle
Symantec Trusted Advisor

For Forum threads, please click "Mark as Solution" if answered.
For all content, please give a thumbs up if you agree with or support the post.

KSchroeder's picture
26
Oct
2009
3 Votes +3
Login to vote

This should work

OK, save the following as GetADDescription.vbs, save it to your \\nsserver\nscap\bin\win32\x86\Inventory Solution\ folder, and add it to your AeXInvSolnAdm1.ini file before the final line:
wscript.exe GetADDescription.vbs
 

Option Explicit
On Error Resume Next  ' fail silently
 
Dim oShell, oAdSysInfo,o
Dim sDN, sDescription

Set oShell = CreateObject("WScript.Shell")
Set oAdSysInfo = CreateObject("ADSystemInfo")
sDN = oAdSysInfo.ComputerName
Set o = GetObject("LDAP://" & sDN)

sDescription = o.Description
oShell.RegWrite "HKLM\Software\MyCompany\Inventory\AD-Comp-Description", sDescription, "REG_SZ"

Set oShell = Nothing
Set oAdSysInfo = Nothing
Set o = Nothing

WScript.Quit(0)

Once that is done, you'll need to create a custom inventory template XML file, borrowing from the previous thread:

<InventoryClasses>
  <InventoryClass name='AeX AD Computer Description' manufacturer='Altiris' description='This data class contains the description of the computer as seen in Active Directory' version='1.0' platform='Win32' mifClass='Altiris|AD_Comp_Desc|1.0'>
<xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
   <s:Schema id="RowsetSchema">
      <s:ElementType name="row" content="eltOnly" rs:updatable="true">
<s:AttributeType name="c0" rs:name="Description" rs:number="1" rs:nullable="true" mifAttrId="1">
    <s:datatype dt:type="string" dt:maxLength="255"/>
</s:AttributeType>
      </s:ElementType>
   </s:Schema>
<rs:data>
<%set path="HKEY_LOCAL_MACHINE\Software\MyCompany\Inventory"%>
<z:row c0="<%writexml "reg:%path%\AD-Comp-Description"%>"/>
</rs:data>
 </xml>
 </InventoryClass> </InventoryClasses>

Save that as AeXAdCompInfo.xml in your Inventory Solution directory, then add the following line beneath the wscript.exe line above:
AeXCustInv.exe /in .\AeXAdCompInfo.xml /out AeXAdCompInfo.nsi
 

Thanks,
Kyle
Symantec Trusted Advisor

For Forum threads, please click "Mark as Solution" if answered.
For all content, please give a thumbs up if you agree with or support the post.

KSchroeder's picture
26
Oct
2009
0 Votes 0
Login to vote

I created a download

durkinr:
I created your request as a Connect Download; hopefully you can access it (though it hasn't been "published" yet).  You can check it out here.

Thanks,
Kyle
Symantec Trusted Advisor

For Forum threads, please click "Mark as Solution" if answered.
For all content, please give a thumbs up if you agree with or support the post.

durkinr's picture
26
Oct
2009
1 Vote +1
Login to vote

Download access

Can't get the download yet, but I'll keep trying. Thanks for all the help,

  -Rob
 

KSchroeder's picture
26
Oct
2009
0 Votes 0
Login to vote

I'll update the thread

I'll update this thread when the download is approved.  usually that happens within 24 hours.  Otherwise, just copy/paste the info in the "Code" blocks above and save them as suggested and it will work fine.

I did make some minor changes to the .XML file and script in the download (to avoid writing a value if nothing is set for a particular object), but it shouldn't hurt anything except you'll have items in the report which don't have any value defined.

Thanks,
Kyle
Symantec Trusted Advisor

For Forum threads, please click "Mark as Solution" if answered.
For all content, please give a thumbs up if you agree with or support the post.

ohzone's picture
26
Oct
2009
2 Votes +2
Login to vote

I've just published the

I've just published the download http://www.symantec.com/connect/downloads/custom-i...

How's that for snappy service?

Endpoint Management,
Endpoint Virtualization
Community Manager
www.twitter.com/EMnV_symc
Need Altiris help? IRC chat #Altiris

KSchroeder's picture
27
Oct
2009
0 Votes 0
Login to vote

Thanks Cheryl, you rule! :)

Thanks Cheryl, you rule! :)

Thanks,
Kyle
Symantec Trusted Advisor

For Forum threads, please click "Mark as Solution" if answered.
For all content, please give a thumbs up if you agree with or support the post.

durkinr's picture
26
Oct
2009
1 Vote +1
Login to vote

I take back all the bad things I said about Symantec

Wow, that is the fast service! Thanks again for the help.

Now if you could just speedup the release of Asset Management for NS7...

durkinr's picture
27
Oct
2009
0 Votes 0
Login to vote

Partial Success - But No New Table

The hardware inventory job runs with exit code 0, and the registry key is created with the AD-Comp-Description value, but the upload of the inventory file fails.

Here is the error on the client:

Oct 27 12:59:29 CompressFile AeXNetComms.dll Error while compressing file: C:\Program Files\Altiris\Altiris Agent\Queue\pdcnt31\NSE18E0.tmp: Cannot open input file: The process cannot access the file because it is being used by another process. (-2147024864) AeXNSAgent.exe

It seems the compression and upload can't run because it is in-use by another process.

Here is my AeXInvSolnAdm1.ini file contents:

aexmachinv.exe /ini MachInvAdm.ini
aexcustinv.exe /in .\AeXCustInvStd.cit /out AeXCustInvStd.nsi
aexsnplus.exe /output xml
wscript.exe //B GetADDescription.vbs
aexcustinv.exe /in .\AeXADCompDesc.xml
aexnsinvcollector.exe /hidden /nsctransport /v default /useguid

Any ideas on how to make the compress and upload work?

KSchroeder's picture
27
Oct
2009
0 Votes 0
Login to vote

Hmm, strange

Well, you could try putting AeXSNPlus.exe after the Aexcustinv.exe in case it is not yet done with creating that file somehow...but that would be rather strange.  Try running FileMon with a filter set for AeX AD Comp Desc.ini to see if you can pick up what app is locking the file.  Or shut down your AV as a test when the inventory job runs.  We've seen similar issues (but on the NS in the \NSCap\EvtQFast\Process folder) when our AV was too slow in closing the file and the Altiris process was trying to load it into the database.

Thanks,
Kyle
Symantec Trusted Advisor

For Forum threads, please click "Mark as Solution" if answered.
For all content, please give a thumbs up if you agree with or support the post.

durkinr's picture
27
Oct
2009
0 Votes 0
Login to vote

Getting Closer

OK, overcame the file in use error, now the event log on the client is clean, as well as on the server, however it is still not creating the table. Exit code is 0 on the client and there is nothing in the log on the server. \\server\NSCap\EvtQFast\Process has been removed from scanning by AV already, but that is a good tip.

KSchroeder's picture
28
Oct
2009
0 Votes 0
Login to vote

What about the .nsi/.bak file?

Hmm, OK.  Take a look at the .NSI file in the \altiris\express\inventory folder; can you paste it in here?  Did it generate a .bak file? Maybe something is off in the formatting somehow.  Try re-running it again, then after the file clears the EvtQFast, check the "Bad" folder (or just watch the NS Log using LogViewer.exe) to see if it is rejecting the value for some reason.

Thanks,
Kyle
Symantec Trusted Advisor

For Forum threads, please click "Mark as Solution" if answered.
For all content, please give a thumbs up if you agree with or support the post.

KSchroeder's picture
28
Oct
2009
2 Votes +2
Login to vote

Doh..I think I know why it is

Doh..I think I know why it is failing.  I have updated the download.  I forgot (somehow) one of the XML tags (specifically  <InventoryClasses>) and that broke it, although it processed fine by the AeXCustInv.exe...

Thanks,
Kyle
Symantec Trusted Advisor

For Forum threads, please click "Mark as Solution" if answered.
For all content, please give a thumbs up if you agree with or support the post.

durkinr's picture
28
Oct
2009
0 Votes 0
Login to vote

AD Computer Description Inventory - Working now

The updated file did the trick, and I did catch that as well, but it took me a while to figure out what was wrong, becuase I am getting weird results from one of my main test machine. That is a whole different subject but the summary is it does not process the .nsi files properly every time it runs an inventory. It often leaves the .nsi and .bak files in the express\inventory folder, for no reason I have been able to detect yet.

So in order to test this I created a new inventory job (instead of using the hardware inventory), and ran it against a group of 5 or so machines and they all worked perfectly the first time. That would have saved me about 3 hours had I used more than one test machine!

This is the custom inventory  file, AeXCompCustInv.ini:

wscript.exe //B GetADDescription.vbs
aexcustinv.exe /in .\AeXADCompDesc.xml
aexnsinvcollector.exe /hidden /nsctransport /v default /useguid

And I created a new inventory job with the command line:
AeXInvSoln.exe /hidden /s AeXCompCustInv.ini

In case anyone else wants to give it a shot.

BTW, you can also test this from a batch file to verify it works before running it in Altiris. The contents of the batch file would look exactly like the contents of the ini file above. Just make sure you have a copy of AeXCustInv.exe and AeXNSInvCollector.exe in your test folder, along with the script and XML file.

Thanks for sticking with it, Kyle-

  -Rob

manassong's picture
25
Nov
2009
0 Votes 0
Login to vote

Hi Kyle      I try to

Hi Kyle
     I try to customize inventory 7.0 to capture computer description. Do you have any idea.

Thanks
Manas

KSchroeder's picture
25
Nov
2009
0 Votes 0
Login to vote

Manas, You should probably

Manas,
You should probably start a new thread about this issue, and link back to this one for reference.

Custom Inventory in IS7 is a bit different from NS6 (though there are ways to run your NS6 custom inventory in NS7).  There are soem KB articles about this.  Otherwise you would need to modify the script I posted to the Downloads section (linked above) to output the data in NS7 format.  The added benefit is you can use the script directly as the custom inventory, and not have to worry about the .XML file to gather the data.

Thanks,
Kyle
Symantec Trusted Advisor

For Forum threads, please click "Mark as Solution" if answered.
For all content, please give a thumbs up if you agree with or support the post.