WINDOWS - Supression/Ajout des mots de passe réseau enregistré
Ce tutorial est OK sous W10, W8.1 et 8, W7, VISTA et XP ...
Pour lancer le gestionnaire de mot de passe réseau :
Entrer au clavier : CTRL+X
Dans la boite de dialogue s'ouvrant tapez : cmd + ENTER
Sur la ligne de commande tapez : rundll32.exe keymgr.dll, KRShowKeyMgr + ENTER
Vous aurez ainis la possibilité d'ajouter et/ou supprimer les mots de passe réseau enregistrer.
Un peu de scripting (en cas de GPO et/ou de parc en migration
). Un script VBS ajoutant des comptes d'accès serveur aux machines de votre reseau :
Pour W7/8/10 :
############################################################
'REGISTER USER AND PASS FOR NETWORK ACCESS IN THE WINDOWS OS
set WshShell = WScript.CreateObject("WScript.Shell")
appp=WshShell.Run ("rundll32.exe keymgr.dll,KRShowKeyMgr")
'We take the username of the local machine
strUser = CreateObject("WScript.Network").UserName
'We ask the user password
strPassword = InputBox("Mot de passe" )
appp=WshShell.Run ("rundll32.exe keymgr.dll,KRShowKeyMgr")
'For some reasons (keyboard sequences), we ask the windows to be selected !
'Be carefull -> Here i'm in French ! Enter here the REAL name of your windows in your language !
WshShell.AppActivate "Noms et mots de passe utilisateur enregistrés"
WScript.Sleep(200)
'We move arround the divers buton/label with tab ... yes it's not ideal, but if you have better send your job to me !
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys("~")
WScript.Sleep(200)
WshShell.SendKeys("SERVER-1")
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
'Here we create an acces for a user who is in the 'my-domain' doamin
WshShell.SendKeys("my-domain\"&strUser)
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
'We put the password
WshShell.SendKeys(strPassword)
WScript.Sleep(200)
WshShell.SendKeys("~")
WScript.Sleep(200)
'Next for another server and account !
WshShell.AppActivate "Noms et mots de passe utilisateur enregistrés"
WshShell.SendKeys("%j")
WshShell.SendKeys("SERVER-2")
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys("my-domain\"&strUser)
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys(strPassword)
WScript.Sleep(200)
WshShell.SendKeys("~")
WScript.Sleep(200)
WshShell.AppActivate "Noms et mots de passe utilisateur enregistrés"
WshShell.SendKeys("%j")
WshShell.SendKeys("SERVER-3")
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys("my-domain\"&strUser)
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys(strPassword)
WScript.Sleep(200)
WshShell.SendKeys("~")
WScript.Sleep(200)
WshShell.AppActivate "Noms et mots de passe utilisateur enregistrés"
WshShell.SendKeys("%j")
WshShell.SendKeys("SERVER-4")
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys("my-domain\"&strUser)
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys(strPassword)
WScript.Sleep(200)
WshShell.SendKeys("~")
WScript.Sleep(200)
WshShell.SendKeys("%{F4}")
############################################################
For WIN XP/2000
############################################################
SEE THE UPPER SCRIPT SAMPLE FOR COMMENT !
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run ("rundll32.exe keymgr.dll,KRShowKeyMgr")
strUser = CreateObject("WScript.Network").UserName
strPassword = InputBox("Mot de passe" )
WshShell.Run ("rundll32.exe keymgr.dll,KRShowKeyMgr")
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys("~")
WScript.Sleep(200)
WshShell.SendKeys("SERVER-1")
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys("my-domain\"&strUser)
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys(strPassword)
WScript.Sleep(200)
WshShell.SendKeys("~")
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys("~")
WScript.Sleep(200)
WshShell.SendKeys("SERVER-2ql")
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys("my-domain\"&strUser)
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys(strPassword)
WScript.Sleep(200)
WshShell.SendKeys("~")
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys("~")
WScript.Sleep(200)
WshShell.SendKeys("SERVER-3")
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys("my-domain\"&strUser)
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys(strPassword)
WScript.Sleep(200)
WshShell.SendKeys("~")
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys("~")
WScript.Sleep(200)
WshShell.SendKeys("SERVER-4")
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys("my-domaine\"&strUser)
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys(strPassword)
WScript.Sleep(200)
WshShell.SendKeys("~")
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys("{TAB}")
WScript.Sleep(200)
WshShell.SendKeys("~")
