Saturday, September 24, 2016

reset password on windows 7/ windows 10 over network

1- following the link below to create live iso for reset windows os.
http://www.atechnote.com/2016/09/create-live-cd-to-reset-windows-7.html

2- install necessary packages
$ sudo apt-get install pxelinux syslinux dnsmasq

3- create a directory to store all data
$ mkdir ~/resetpassword && cd ~/resetpassword

4- copy necessary file to our directory,
$ cp /usr/lib/PXELINUX/pxelinux.0 ~/resetpassword
$ cp /usr/lib/syslinux/modules/bios/*.c32 ~/resetpassword
$ cp /usr/lib/syslinux/memdisk ~/resetpassword


5- update boot menu
$ mkdir pxelinux.cfg

- create file ~/resetpassword/pxelinux.cfg/default with the following content

default menu.c32
prompt 0
timeout 300
ONTIMEOUT local
menu title ########## PXE Boot Menu ##########
label 1
menu label ^1) reset password windows7/windows10
insmod part_msdos
insmod ext2
set root='(hd0,msdos6)'
kernel memdisk iso raw
initrd resetpassword.iso
menu label ^2) reset password windows7/windows10




6- copy the iso that is produced in step 1 to directory ~/resetpassword with the name, resetpassword.iso

7- create bash script file to start our tftp and dhcp so we name it as dnsmasq-tftp.sh with content below
#/bin/bash
ifconfig vmnet2 192.168.13.1 up
dnsmasq -i vmnet2 --dhcp-range=192.168.13.100,192.168.13.200 \
    --dhcp-boot=pxelinux.0 \
    --enable-tftp --tftp-root=~/resetpassword -d -p0 -K --log-dhcp --bootp-dynamic


8- finally we run the script with the following command then start boot with network interface on the client that what to reset the password
$ sudo sh dnsmasq-tftp.sh

- snapshot of reset password administrator on windows 7


No comments:

Post a Comment