Affichage des articles dont le libellé est migration. Afficher tous les articles
Affichage des articles dont le libellé est migration. Afficher tous les articles

jeudi 26 avril 2018

Migration

Si vous devez sauvegarder le profil d'un utilisateur (W7-10), voici un petit script:

mkdir %~dp0%username%\

net use > %~dp0%username%\lecteurs_reseau.txt
%~dp0%Listeimprimante.vbs

move "%~dp0imprimante.txt" "%~dp0%username%\"
move "%~dp0imprimanteDefault.txt" "%~dp0%username%\"

rem echo %~dp0

cls
@echo Office va se fermer . sauvegarder vos document avant d aller plus loin
pause
taskkill /IM outlook.exe
taskkill /IM excel.exe
taskkill /IM word.exe



rem xcopy /S /Q /H /Y "%userprofile%\OneDrive\*" "%~dp0%username%\OneDrive\"
rem xcopy /S /Q /H /Y "%userprofile%\OneDrive Entreprise – Modifications *\*" "%~dp0%username%\OneDrive Entreprise – Modifications non synchronisées\"

xcopy /S /Q /H /Y "%userprofile%\Contacts\*" "%~dp0%username%\Contacts\"
xcopy /S /Q /H /Y "%userprofile%\Favorites\*" "%~dp0%username%\Favorites\"

xcopy /S /Q /H /Y "%userprofile%\AppData\Roaming\Microsoft\Sticky Notes\*" "%~dp0%username%\AppData\Roaming\Microsoft\Sticky Notes\"
xcopy /S /Q /H /Y "%userprofile%\AppData\Roaming\Microsoft\Excel\*" "%~dp0%username%\AppData\Roaming\Microsoft\Excel\"
xcopy /S /Q /H /Y "%userprofile%\AppData\Roaming\Microsoft\Proof\*" "%~dp0%username%\AppData\Roaming\Microsoft\Proof\"
xcopy /S /Q /H /Y "%userprofile%\AppData\Roaming\Microsoft\Signatures\*" "%~dp0%username%\AppData\Roaming\Microsoft\Signatures\"
xcopy /S /Q /H /Y "%userprofile%\AppData\Roaming\Microsoft\Templates\*" "%~dp0%username%\AppData\Roaming\Microsoft\Templates\"
xcopy /S /Q /H /Y "%userprofile%\AppData\Roaming\Microsoft\UProof\*" "%~dp0%username%\AppData\Roaming\Microsoft\UProof\"

xcopy /S /Q /H /Y "%userprofile%\AppData\Roaming\Mozilla\*" "%~dp0%username%\AppData\Roaming\Mozilla\"
xcopy /S /Q /H /Y "%userprofile%\AppData\Local\Google\*" "%~dp0%username%\AppData\Local\Google\"
xcopy /S /Q /H /Y "%userprofile%\AppData\Roaming\Apple\*" "%~dp0%username%\AppData\Roaming\Apple\"

xcopy /S /Q /H /Y "%userprofile%\Desktop\*" "%~dp0%username%\Desktop\"
xcopy /S /Q /H /Y "%userprofile%\Documents\*" "%~dp0%username%\Documents\"
xcopy /S /Q /H /Y "%userprofile%\Pictures\*" "%~dp0%username%\Pictures\"
xcopy /S /Q /H /Y "%userprofile%\Music\*" "%~dp0%username%\Music\"
xcopy /S /Q /H /Y "%userprofile%\downloads\*" "%~dp0%username%\downloads\"
xcopy /S /Q /H /Y "%userprofile%\Videos\*" "%~dp0%username%\Videos\"
xcopy /S /Q /H /Y "%userprofile%\AppData\Local\Microsoft\Outlook\*.pst" "%~dp0%username%\AppData\Local\Microsoft\Outlook\*.pst"



pause
cls
pause
echo pensez aux lecteurs reseau
echo pensez aux imprimantes
echo pensez signatures par défaut
Et le script ListeImprimante à mettre au meme :
Const ForWriting = 2
Dim fso, f  
strComputer = "."

Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colInstalledPrinters = objWMIService.ExecQuery ("Select * from Win32_Printer")

Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile(".\imprimante.txt", ForWriting,true)
set f2 = fso.OpenTextFile(".\imprimanteDefault.txt", ForWriting,true)

For Each objPrinter in colInstalledPrinters

if (objPrinter.Name <> "Fax") and (objPrinter.Name <> "Microsoft Office Live Meeting 2007 Document Writer") and (objPrinter.Name <> "Microsoft XPS Document Writer")  Then
        f.write(objPrinter.Name & vbnewline)
    end if

if (objPrinter.Default = true) then
    f2.write(objPrinter.Name & vbnewline)
end if


Next

mardi 13 février 2018

Migration de poste: mots de passe enregistrés

rundll32.exe keymgr.dll, KRShowKeyMgr

Exportez et réimportez depuis l'outil

Sinon:
control /name Microsoft.CredentialManager
control keymgr.dll

en ligne de commande:
cmdkey.exe

[Ajout au 16/05/18]
Ci-dessous un script PowerShell pour vider les informations (ne fonctionne pas pour les cible ayant des espaces, ou les OC1)


cmdkey /list | ForEach-Object{if($_ -like "*Cible*"){cmdkey /del:($_ -replace " ","" -replace "Cible:","")}}

ou

cmdkey /list | where {$_ -match 'LegacyGeneric'} | foreach { cmdkey /delete "$($_.split()[-1])" }

Et en Batch:

for /F "tokens=1,* delims=: " %G in ('cmdkey /list ^|findstr Cible') do cmdkey /delete %H

Migration de poste: Epingles en barre des tâches

Vite sauvez moi ces raccourcis en barre de tâches :

Récupérer ce répertoire :
 %appdata%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar


Récupérer cette clef de registre 


HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ Taskband


Copiez et remettez les fichiers et clef de registre puis :
Killez le Process explorer et relancez le :

TASKKILL /IM explorer.exe
explorer.exe