5 source $
(dirname $0)/utils.sh
7 PRINCIPAL
=$
(get_principal
$1)
8 PASSWORD
=$
(get_password
$1)
10 NT_DOM
=$
(get_nt_dom
$1)
15 ${NET} ads search
'(objectCategory=user)' sAMAccountName
-k --configfile=$CONFIG_FILE -S ${SERVER} >/dev
/null
17 if [ $RET -ne 0 ]; then
18 echo "${NET} returned error: $RET"
25 ${NET} ads search
'(objectCategory=group)' sAMAccountName
-k --configfile=$CONFIG_FILE -S ${SERVER} >/dev
/null
26 if [ $RET -ne 0 ]; then
27 echo "${NET} returned error: $RET"
34 ${NET} ads search
'(objectCategory=computer)' sAMAccountName
-k --configfile=$CONFIG_FILE -S ${SERVER} >/dev
/null
35 if [ $RET -ne 0 ]; then
36 echo "${NET} returned error: $RET"
43 ${NET} ads search
'(objectCategory=*)' sAMAccountName
-k --configfile=$CONFIG_FILE -S ${SERVER} >/dev
/null
44 if [ $RET -ne 0 ]; then
45 echo "${NET} returned error: $RET"
52 ${NET} ads search
'(description=Built-in account for adminstering the computer/domain)' sAMAccountName
-k --configfile=$CONFIG_FILE -S ${SERVER} >/dev
/null
53 if [ $RET -ne 0 ]; then
54 echo "${NET} returned error: $RET"
63 call_kinit
"${PRINCIPAL}" "${PASSWORD}"
64 write_configfile
"${REALM}" "${NT_DOM}"
75 echo -e "\tSEARCH INDEXED $2"
77 START_TIME
=$
(start_timer
)
80 for i
in $
(${SEQ} 1 $ITERATIONS); do
88 STOP_TIME
=$
(stop_timer
)
90 TOTAL_TIME
=$
(total_time
$START_TIME $STOP_TIME)
92 echo -e "\t\ttotal time:\t\t${TOTAL_TIME}s"
94 LOGINS_PER_MINUTE
=$
(iterations_per_minute
$START_TIME $STOP_TIME $ITERATIONS)
96 echo -e "\t\titerations/min:\t\t$LOGINS_PER_MINUTE"
98 ########################
100 echo -e "\tSEARCH WILDCARD $2"
102 START_TIME
=$
(start_timer
)
105 for i
in $
(${SEQ} 1 $ITERATIONS); do
111 STOP_TIME
=$
(stop_timer
)
113 TOTAL_TIME
=$
(total_time
$START_TIME $STOP_TIME)
115 echo -e "\t\ttotal time:\t\t${TOTAL_TIME}s"
117 LOGINS_PER_MINUTE
=$
(iterations_per_minute
$START_TIME $STOP_TIME $ITERATIONS)
119 echo -e "\t\titerations/min:\t\t$LOGINS_PER_MINUTE"
121 ########################
123 echo -e "\tSEARCH UNINDEXED $2"
125 START_TIME
=$
(start_timer
)
128 for i
in $
(${SEQ} 1 $ITERATIONS); do
134 STOP_TIME
=$
(stop_timer
)
136 TOTAL_TIME
=$
(total_time
$START_TIME $STOP_TIME)
138 echo -e "\t\ttotal time:\t\t${TOTAL_TIME}s"
140 LOGINS_PER_MINUTE
=$
(iterations_per_minute
$START_TIME $STOP_TIME $ITERATIONS)
142 echo -e "\t\titerations/min:\t\t$LOGINS_PER_MINUTE"