5 source `dirname $0`/utils.sh
7 PRINCIPAL
=$
(get_principal
$1)
8 PASSWORD
=$
(get_password
$1)
10 NT_DOM
=$
(get_nt_dom
$1)
14 ${NET} ads search
'(objectCategory=user)' sAMAccountName
-k -s $CONFIG_FILE -S ${SERVER} > /dev
/null
16 if [ $RET -ne 0 ]; then
17 echo "${NET} returned error: $RET"
23 ${NET} ads search
'(objectCategory=group)' sAMAccountName
-k -s $CONFIG_FILE -S ${SERVER} > /dev
/null
24 if [ $RET -ne 0 ]; then
25 echo "${NET} returned error: $RET"
31 ${NET} ads search
'(objectCategory=computer)' sAMAccountName
-k -s $CONFIG_FILE -S ${SERVER} > /dev
/null
32 if [ $RET -ne 0 ]; then
33 echo "${NET} returned error: $RET"
39 ${NET} ads search
'(objectCategory=*)' sAMAccountName
-k -s $CONFIG_FILE -S ${SERVER} > /dev
/null
40 if [ $RET -ne 0 ]; then
41 echo "${NET} returned error: $RET"
47 ${NET} ads search
'(description=Built-in account for adminstering the computer/domain)' sAMAccountName
-k -s $CONFIG_FILE -S ${SERVER} > /dev
/null
48 if [ $RET -ne 0 ]; then
49 echo "${NET} returned error: $RET"
57 call_kinit
"${PRINCIPAL}" "${PASSWORD}"
58 write_configfile
"${REALM}" "${NT_DOM}"
68 echo -e "\tSEARCH INDEXED $2"
70 START_TIME
=$
(start_timer
)
73 for i
in $
( ${SEQ} 1 $ITERATIONS ); do
81 STOP_TIME
=$
(stop_timer
)
83 TOTAL_TIME
=$
( total_time
$START_TIME $STOP_TIME )
85 echo -e "\t\ttotal time:\t\t${TOTAL_TIME}s"
87 LOGINS_PER_MINUTE
=$
(iterations_per_minute
$START_TIME $STOP_TIME $ITERATIONS)
89 echo -e "\t\titerations/min:\t\t$LOGINS_PER_MINUTE"
91 ########################
93 echo -e "\tSEARCH WILDCARD $2"
95 START_TIME
=$
(start_timer
)
98 for i
in $
( ${SEQ} 1 $ITERATIONS ); do
104 STOP_TIME
=$
(stop_timer
)
106 TOTAL_TIME
=$
( total_time
$START_TIME $STOP_TIME )
108 echo -e "\t\ttotal time:\t\t${TOTAL_TIME}s"
110 LOGINS_PER_MINUTE
=$
(iterations_per_minute
$START_TIME $STOP_TIME $ITERATIONS)
112 echo -e "\t\titerations/min:\t\t$LOGINS_PER_MINUTE"
114 ########################
116 echo -e "\tSEARCH UNINDEXED $2"
118 START_TIME
=$
(start_timer
)
121 for i
in $
( ${SEQ} 1 $ITERATIONS ); do
127 STOP_TIME
=$
(stop_timer
)
129 TOTAL_TIME
=$
( total_time
$START_TIME $STOP_TIME )
131 echo -e "\t\ttotal time:\t\t${TOTAL_TIME}s"
133 LOGINS_PER_MINUTE
=$
(iterations_per_minute
$START_TIME $STOP_TIME $ITERATIONS)
135 echo -e "\t\titerations/min:\t\t$LOGINS_PER_MINUTE"