-
Notifications
You must be signed in to change notification settings - Fork 36
/
reset-windows-password.sh
executable file
·39 lines (35 loc) · 1.72 KB
/
reset-windows-password.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bash
##############################################################
### _ _ _ ###
### __ _ __| |___ _ _ __| |_ _(_)__ _ ###
### / _` / _| / _ \ || / _` | '_| / _` | ###
### \__, \__|_\___/\_,_\__,_|_| |_\__, | ###
### |___/ |___/ ###
### ###
### reset-windows-password.sh ###
### ###
### if you forget your password or are like me and don't ###
### bother to remember it at all, run this to reset it. ###
### note you will have to provide the new password to ###
### autologin - once you remote in, update autologin via ###
### Start > Run > 'control userpasswords2' and toggle the ###
### "Users require a password to login to this computer" ###
### checkbox. ###
### ###
##############################################################
# bash "what directory am i" dance
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
# shellcheck source=./globals.sh
source "$DIR/globals.sh"
##############################################################
init_gcloudrig;
INSTANCE="$(gcloudrig_get_instance_from_group "$INSTANCEGROUP")"
ZONE="$(gcloudrig_get_instance_zone_from_group "$INSTANCEGROUP")"
# set/reset windows credentials
gcloudrig_reset_windows_password