Extension Attributes for finding disk space that is less than 2x their Microsoft User Data Size.

Not applicable

Hi All, I am tring to create an Extension Attribute for finding the Macs in JSS that have available disk space is less then 2X of there Microsoft User Data folder size.
I can get the disk space using this Unix cammand :-
admin$ df -h
and Microsoft User Data Folder size. using du -sh /Users/$user/Documents/Microsoft User Data
If any one can help with shell script?

Regards,
Vinay

7 REPLIES 7

tlarkin
Honored Contributor

Something like this

#!/bin/bash

# loop through local users

for u in `dscl . list /Users UniqueID | awk '$2 > 500 { print $1 }'` ; do

echo "<result> $(du -sh /Users/$u/Documents/Microsoft User Data)</result> done

exit 0

I cannot remember if you need the word "result" or "results," not enough coffee today :(

Not applicable

Thanks for your help,

But it’s not what i want i would like to find the Mac which has less space than the 2x of their Microsoft User Data size.
Below given script can give the size of Microsoft User Data folder size
I need to multiply it by 2 (Microsoft User Data folder size) and then need to compare it which the available disk space if it is less than the size of 2x of Microsoft User Data folder size.

I am having an extension attribute which give the size of Microsoft User Data Folder and its working fine.

#!/bin/bash

echo "<result>"

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

for u in $UserList ; do results=du -sh /Users/$u/Documents/Microsoft User Data/Office 2008 Identities/* echo $u $results

done

echo "</result>"

exit 0

Regards,
Vinay

Date: Wed, 6 Apr 2011 13:06:05 -0500

donmontalvo
Esteemed Contributor III

Hi Vinay,

Chasing a red herring...I believe what you need to find is computers with disk space less than 2x their *database* size, excluding any backup folders:

~/Documents/Microsoft User Data/Office X Identities/Main Identity/Database ~/Documents/Microsoft User Data/Office 2004 Identities/Main Identity/Database ~/Documents/Microsoft User Data/Office 2008 Identities/Main Identity/Database

(exclude any backup folders of course)

If there are multiple identities, the calculation needs to factor those in as well. So if there are two identities, such as Main Identity" (that has a 10G database) and "Alternate Identity" (that has database size of 20G), the total disk space taken by those active databases is 30G. So if the computer has less than 60G of available space, the Extension Attribute needs to flag.
Don

--
https://donmontalvo.com

Not applicable

Hi Don,

Thanks for your suggestion.

Regards,
Vinay

Not applicable

Hi Thomas,

Microsoft system requirements don't take into account import space requirements. We tested and found that for a 10G Entourage database, we need at least 20G of available space. Of course these numbers are an example, so arbitrary.

Turns out this is not going to be possible, since JSS is unable to determine which of the existing profiles are the main/current one. Even if it could, not possible to produce output that would be usable (witness the <BR> issue in previous examples).

We're going to find a different approach for now. Thanks for your input.

Regards,
Vinay Washimkar

Date: Fri, 8 Apr 2011 13:40:57 -0500

tlarkin
Honored Contributor

Ah gotcha, well good luck. I guess you could always do a preflight
install script to check how much current free space there is, or create
a policy that notifies the user when their free space is under say 15%
drive capacity.

Thanks,

Tom

tlarkin
Honored Contributor

I am not quite sure what you are asking here....do you?

1) Want to compare the data folder for MS office and double it, then
compare it to the total size of the HD? 2) double the size of the data folder and then if it is a certain
percentage of the HD space then execute a policy? 3) If the data folder when doubled is taking up a certain percentage
do something?

Could you clearly with as many words as possible explain exactly the
goal here? Then maybe I can help you figure it out.

Thanks,

Tom