Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- net ads user info USERNAME@DOMAIN.COM -S DC_SERVER_NAME -U USERNAME
- ads_pull_uint32 failed
- #!/bin/bash
- # author: Tim Wahrendorff 2016
- # licence: Public Domain - https://wiki.creativecommons.org/wiki/Public_domain
- #
- # To use this script you need at least:
- # sudo apt-get install libnotify-bin rpcclient
- #
- # Please set your account, password and domaincontroller to use this script
- USER="username" # Domain accountname
- PASS="Pa$$W0rd" # Domain password
- DC="vmdc01" # Domaincontroller
- ### START RPCCLIENT query
- if [ "x$USERDCID" == "x" ]; then
- RPCLOOKUPID=$(rpcclient -U $USER%$PASS -c "lookupnames $USER" $DC 2> ./rpc_errFile)
- USERDCID=$(echo "$RPCLOOKUPID" | grep -e '[0-9]{4,9} ' -o)
- fi
- QUERYUSER=$(rpcclient -U $USER%$PASS -c "queryuser $USERDCID" $DC 2> ./rpc_errFile)
- EXPDATE=$(echo "$QUERYUSER" | grep 'Password must change Time' | grep -e '[a-Z]{2}, [0-9]{2} [a-Z]{3} [0-9]{4} [0-9]{2}:[0-9]{2}' -o)
- ## Load rpc error Message
- RPCERR=$(<./rpc_errFile)
- ## send notifications to Unity Desktop
- if [ "x$RPCERR" != "x" ]; then
- notify-send -i /usr/share/icons/gnome/48x48/status/dialog-error.png "Error while fetching expiration date of your domain password" "$RPCERR"
- else
- notify-send -i /usr/share/icons/gnome/48x48/status/dialog-information.png "your domain password expires at " "$EXPDATE h"
- fi
- ### END RPCCLIENT query
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement