Skip to main content
Question

Custom Report to collect User Information

  • January 4, 2013
  • 9 replies
  • 20 views

Forum|alt.badge.img+2

Greetings all;

I am looking/needing a report to go against the JSS that will report back the users on mac's and the size of their home directories. If anyone has created one and is willing to share it would help from reinventing the wheel.

9 replies

bentoms
Forum|alt.badge.img+35
  • Hall of Fame
  • January 4, 2013

Would like this too.


Forum|alt.badge.img+7
  • Contributor
  • January 4, 2013
#!/bin/bash

cd /users/
alias=`ls | grep [0-9a-z][0-9a-z][0-9a-z] | grep -v "_spotlight" | grep -v "root" | grep -v "_" | grep -v "shared" | grep -v "Shared" | grep -v ".localized"`
cd /users/"$alias"/
hdsize=`du -h -s /users/"$alias"/ | awk {'print $1'}`

echo "$hdsize"
exit 0

this is an old script I wrote when I first started scripting so it probably could be better, but this will echo out the home directory size. you can return the variable in an extension attribute, then create a search that displays the result of the extension attribute and that should hopefully do the trick


Forum|alt.badge.img+12
  • Contributor
  • January 4, 2013

In another thread started by donmontalvo, there is a discussion about creating an Extension Attribute for Outlook 2011 identities folder size. I bet that you can use that information to help you with your request.

http://jamfnation.jamfsoftware.com/discussion.html?id=3970


jhbush
Forum|alt.badge.img+27
  • Esteemed Contributor
  • January 4, 2013

This may need cleaned up, but it's based off of Don's script.

#!/bin/bash

echo "<result>"

UserList=`dscl . list /Users UniqueID | awk '$2 > 501 { print $1 }'` 

for u in $UserList ; 
do
if [ -d /Users/$u/ ]; then
results=`du -sh /Users/$u/ | grep -v "[Back" | grep -v ".plist" | awk '{print $1}'`
else continue
fi
echo $u $results

done
echo "</result>"
exit 0

Forum|alt.badge.img+23
  • Employee
  • January 4, 2013

Thanks for posting that script Jason. It looks like we are just missing a in the du -sh command.

du -sh /Users/$u/ | grep -v "[Back" | grep -v ".plist" | awk '{print $1}'`

Other than that your script worked great.

Thanks,
Joel


donmontalvo
Forum|alt.badge.img+36
  • Hall of Fame
  • January 5, 2013

@Joel.Peasley I just went back and added a second slash to the line since it looks like some slashes aren't showing up when posted the way they show up in the Edit window (to precede a left bracket with a backslash, need to add a second backslash). :(

So there's two issues with the Edit window...(1) all quoted text getting BOLDED, and (2) backslash needing to be escaped with a backslash.

This line should be bolded This line should not be bolded

XL t-shirt please. :b

Don


mm2270
Forum|alt.badge.img+24
  • Legendary Contributor
  • January 5, 2013

There's already a FR from rmanly on that issue:
https://jamfnation.jamfsoftware.com/featureRequest.html?id=799


donmontalvo
Forum|alt.badge.img+36
  • Hall of Fame
  • January 5, 2013

@mm2270 There goes my XL t-shirt. :.(

<tongue in cheek>


Forum|alt.badge.img+2
  • Author
  • New Contributor
  • January 7, 2013

Thank You for the responses will try this out.