[IMP] Some improvements
This commit is contained in:
+1
-2
@@ -28,8 +28,7 @@ convertToHex() {
|
||||
realm=$(grep -i realm /etc/samba/smb.conf | awk '{print $3}' | tr '[:upper:]' '[:lower:]')
|
||||
dc=$(echo $realm | awk -F '.' '{for(i = 1; i <= NF; i++) {printf ",DC=" $i}}')
|
||||
base="OU=Domain Controllers${dc}"
|
||||
cn=$(hostname -s)
|
||||
#cn=$(srvads2)
|
||||
cn=$1
|
||||
GUID=$(ldbsearch -H /var/lib/samba/private/sam.ldb --basedn="$base" "CN=${cn}" objectGUID \
|
||||
| grep '^objectGUID:' \
|
||||
| awk '{print $2}' \
|
||||
|
||||
Reference in New Issue
Block a user