mirror of
https://github.com/PierreGode/Linux-Active-Directory-join-script.git
synced 2025-12-21 16:50:13 +01:00
Addded flag: -u "(check user )"
This commit is contained in:
parent
bf146b58b6
commit
17e733cfc1
@ -1454,6 +1454,27 @@ exit
|
|||||||
fi
|
fi
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
checkuser(){
|
||||||
|
clear
|
||||||
|
export HOSTNAME
|
||||||
|
myhost=$( hostname | cut -d '.' -f1 )
|
||||||
|
#DOMAIN=$(realm discover | grep -i realm.name | awk '{print $2}' | tr "[:upper:]" "[:lower:]")
|
||||||
|
DOMAIN=lalala
|
||||||
|
if [ -d /home/"$DOMAIN" ]
|
||||||
|
then
|
||||||
|
ls /home/$DOMAIN/ | while read user
|
||||||
|
do
|
||||||
|
id "$user" | grep "$myhost"
|
||||||
|
echo "___________________________________________________________________________"
|
||||||
|
echo ""
|
||||||
|
done
|
||||||
|
else
|
||||||
|
echo "no user found on this system. try typing the user:"
|
||||||
|
read -r user
|
||||||
|
id "$user" | grep "$myhost"
|
||||||
|
fi
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
|
||||||
################################## info ##################################
|
################################## info ##################################
|
||||||
readmes(){
|
readmes(){
|
||||||
@ -1464,6 +1485,7 @@ echo " [-j admin domain (Simple direct join) ADconnecti
|
|||||||
echo " [-l (script output to log file)]"
|
echo " [-l (script output to log file)]"
|
||||||
echo " [-s (Discover domain)]"
|
echo " [-s (Discover domain)]"
|
||||||
echo " [-o (assign OU for computer object (-o OU=Clients,OU=Computers))"
|
echo " [-o (assign OU for computer object (-o OU=Clients,OU=Computers))"
|
||||||
|
echo " [-u (check user (looks up if computer can get user from AD))"
|
||||||
echo ""
|
echo ""
|
||||||
echo ""
|
echo ""
|
||||||
echo "${INTRO_TEXT} Active directory connection tool ${END}"
|
echo "${INTRO_TEXT} Active directory connection tool ${END}"
|
||||||
@ -1681,6 +1703,11 @@ while test $# -gt 0; do
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
-u|--u)
|
||||||
|
if test $# -gt 0; then
|
||||||
|
checkuser
|
||||||
|
exit
|
||||||
|
;;
|
||||||
-o|--o)
|
-o|--o)
|
||||||
if test $# -gt 0; then
|
if test $# -gt 0; then
|
||||||
desktop=$( sudo apt list --installed | grep -i desktop | grep -i ubuntu | cut -d '-' -f1 | grep -i desktop )
|
desktop=$( sudo apt list --installed | grep -i desktop | grep -i ubuntu | cut -d '-' -f1 | grep -i desktop )
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user