I am looking at using the following vbs script to write a registry value which I can then collect using the custom data collection in the inventory;
Set objNetwork = CreateObject("Wscript.Network")
Set objShell = WScript.CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
strUserName = objNetwork.UserName
Set objFolder = objFSO.GetFolder("C:\DOCUMENTS AND sETTINGS\" &strUserName &"\my documents")
objShell.RegWrite "HKCU\Software\intel\LANDesk\MyDocs",Int(objFolder.Size/1048576), "REG_DWORD"
Any comments on whether you think this is the right way to go ?
Do you have multiple profiles per machine? If so you, depending on how you run this it may overwrite the value. Also, depending on how you run this, it may not work since LANDesk may run it under the local system account. So I suck in VB but maybe another spin on this is to transverse the entire doc and setting folder and calculate the aggregate size of all mydocs folders into one item. That way you can say this machine will have X amount of Gbs that will go to NAS.
The next question is how to run this. I would think a custom vulnerability looking for the custom registry key set to autofix.
Just a thought, numerous ways to do this.
that will only work if you use ldms_client to gather it -- LANDesk native tools can't see into HKCU because they're running as localsystem (unless you manually wrap it with runasuser.exe). To use your script, you'll need to have it write into HKLM. As Dave points out, you then have to worry about reading it. Since the regkey reader in ldappl3.template isn't able to variable-ize the key, you'd need to write a string value concatenating username and folder size, which means you couldn't usefully query it. Alternatively, you could gather totals only.
If you're willing to wait a bit (or hack together some perl) I can just add the feature to ldms_client. It would be a simple copy and modify of the PST file finder, and I could do per user folder size as well as total size. If you're not familiar with the tool, it's here.
Thanks Jack, I'll take a look and let you know how it works out.
Really appreciate the droppedpackets.org site, great stuff!
I know this has been a dormant post for quite sometime, but after I look through the docs on the most current ldms_client release I still don't see how to capture 'My Documents' like the original post was requesting. I'm in the same scenario that this thread was created for, but I'm having a hard time solving the problem of querying the appropriate folder, particularly since it's a dynamic path depending on which user you want to know about. Jack, was there a reason you abandoned 'My Documents' and just maded it 'User Profile Size'? Thanks for any help I receive.