13 février 2017 1 13 /02 /février /2017 12:01

[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
$POSTE=Read-Host "Nom du poste à checker?"
$RAM = [Math]::Round((Get-WmiObject -Class win32_computersystem -ComputerName $POSTE).TotalPhysicalMemory/1Gb)
[System.Windows.MessageBox]::Show("Il y a $RAM Giga de RAM sur le poste")

Partager cet article

Repost 0
2 septembre 2016 5 02 /09 /septembre /2016 17:31
[DOS] Script de sauvegarde de profil Windows

@echo off title Sauvegarde de %computername% vers Machine de Geekers 77.56 color 0A :home cls echo. SET DATE=%date:/=-% REM set /p Login= Hi, Fournissez moi un compte admin sous la forme prenom.nom : REM set /p Pass= indiquer votre mot de passe echo cree par Geekers, en date du 02/09/2016 echo. echo Choisissez une tache: echo ===================================================== echo. echo 1) SAVE: Sauvegardes de Profil echo. echo 2) RESTORE: Restauration de Profil echo. echo ===================================================== echo. echo. set /p errorlevel=Type option: if "%errorlevel%"=="1" goto SAVE if "%errorlevel%"=="2" goto RESTORE :SAVE robocopy "%appdata%\microsoft\signatures" "\\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%computername%\signatures" /e robocopy "%AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar" "\\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%computername%\TaskBar" /e robocopy "%appdata%\microsoft\outlook" "\\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%computername%\outlook" /e robocopy %userprofile%\Favorites\ \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%computername%\Favorites\ /e robocopy %userprofile%\downloads\ \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%computername%\downloads\ /e robocopy %userprofile%\pictures\ \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%computername%\pictures\ /e robocopy %userprofile%\videos\ \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%computername%\videos\ /e robocopy %userprofile%\music\ \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%computername%\music\ /e robocopy %userprofile%\virtual machines \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%computername%\virtual_machines\ /e robocopy %userprofile%\links\ \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%computername%\links\ /e robocopy %userprofile%\contacts\ \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%computername%\contacts\ /e robocopy %userprofile%\Desktop\ \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%computername%\desktop\ /e robocopy %userprofile%\Documents\ \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%computername%\Documents\ /e REM SAUVEGARDE D'ELEMENT DE LA BASE DE REGISTRE REG EXPORT "HKCU\Software\Microsoft\Office\12.0\Outlook" D:\Sauvegardes\Save_Profils\%username%\%computername%\OutCfg.reg REG EXPORT "HKCU\Software\Microsoft\Internet Explorer" D:\Sauvegardes\Save_Profils\%username%\%computername%\IECfg.reg REG EXPORT "HKCU\Network" D:\Sauvegardes\Save_Profils\%username%\%computername%\LctRsx.reg REG EXPORT "HKCU\Printers" D:\Sauvegardes\Save_Profils\%username%\%computername%\ImprRsx.reg REG EXPORT "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows" D:\Sauvegardes\Save_Profils\%username%\%computername%\ImprDft.reg Echo FIN pause EXIT :RESTORE set /p Poste= indiquer le nom du PC d'origine: robocopy "\\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%Poste%\signatures" "%appdata%\microsoft\signatures" /s /e /y /i robocopy "\\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%Poste%\TaskBar" "%AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar" /s /e /y /i robocopy "\\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%Poste%\outlook" "%appdata%\microsoft\outlook" /s /e /y /i robocopy \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%Poste%\Favorites\ %userprofile%\Favorites\ /e robocopy \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%Poste%\Favorites\ %userprofile%\Favoris\ /e robocopy \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%Poste%\downloads\ %userprofile%\downloads\ /e robocopy \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%Poste%\pictures\ %userprofile%\pictures\ /e robocopy \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%Poste%\videos\ %userprofile%\videos\ /e robocopy \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%Poste%\music\ %userprofile%\music\ /e robocopy \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%Poste%\virtual machines\ %userprofile%\virtual machines\ /e robocopy \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%Poste%\links\ %userprofile%\links\ /e robocopy \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%Poste%\saved games\ %userprofile%\saved games\ /e robocopy \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%Poste%\contacts\ %userprofile%\contacts\ /e robocopy \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%Poste%\desktop\ %userprofile%\Desktop\ /e robocopy \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%Poste%\My Documents\ %userprofile%\Documents\ /e REM REG IMPORT HKCU\Software\Microsoft\Office\12.0\Outlook" D:\Sauvegardes\Save_Profils\%username%\%computername%\OutCfg.reg REM REG IMPORT HKCU\Software\Microsoft\Internet Explorer" D:\Sauvegardes\Save_Profils\%username%\%computername%\IECfg.reg REM REG IMPORT HKCU\Network" D:\Sauvegardes\Save_Profils\%username%\%computername%\LctRsx.reg REM REG IMPORT HKCU\Printers" D:\Sauvegardes\Save_Profils\%username%\%computername%\ImprRsx.reg REM REG IMPORT HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows" D:\Sauvegardes\Save_Profils\%username%\%computername%\ImprDft.reg Echo FIN pause EXIT

Partager cet article

Repost 0
18 juin 2015 4 18 /06 /juin /2015 23:16

@echo off
Menu by GEEKERS : myster.geek@gmail.com
color 0c
:home
cls
echo.
rem set /p Login= Hi, Fournissez moi un compte admin sous la forme prenom.nom :
ECHO.
ECHO.
ECHO ###########################################################
ECHO # Script de sauvegardes et de restauration d'un poste #
ECHO # #
ECHO # Auteur d'origine : GEEKERS #
ECHO # Date de creation : 27/01/2015 #
ECHO # #
ECHO ###########################################################
ECHO.
ECHO.
ECHO.
echo Choisissez une tache:
echo ===============================================
echo.
echo 1) SAVE: sauvegardes du Profil local
echo 2) RESTORE: Restauration du Profil
ECHO.
ECHO.


set /p errorlevel=Type option:


if "%errorlevel%"=="1" goto SAVE
if "%errorlevel%"=="2" goto RESTORE


:SAVE
xcopy "%appdata%\microsoft\signatures" "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\signatures" /e /d /y /i /h
rem xcopy "%userprofile%" "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\profil" /s /e /d /y /i
xcopy "%AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar" "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\TaskBar" /s /e /d /y /i
xcopy "%appdata%\microsoft\outlook" "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\outlook" /e /d /y /i /h


XCOPY "%userprofile%\Favorites\"*.* "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\Favorites\" /S/Y
XCOPY "%userprofile%\downloads\"*.* "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\downloads\" /S/Y
XCOPY "%userprofile%\pictures\"*.* "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\pictures\" /S/Y
XCOPY "%userprofile%\videos\"*.* "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\videos\" /S/Y
XCOPY "%userprofile%\music\"*.* "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\music\" /S/Y
XCOPY "%userprofile%\virtual machines"\"*.* "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\"virtual machines"\" /S/Y
XCOPY "%userprofile%\links\"*.* "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\links\" /S/Y
XCOPY "%userprofile%\"saved games"\*.* "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\"saved games"\" /S/Y
XCOPY "%userprofile%\contacts\"*.* "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\contacts\" /S/Y
XCOPY "%userprofile%\Desktop\"*.* "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\desktop\" /S/Y
XCOPY "%userprofile%\Documents\"*.* "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\"My Documents"\" /S/Y
XCOPY "%localappdata%\Microsoft\Outlook\"*.pst "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\"Outlook PST"\" /S/Y
XCOPY "%appdata%"\Microsoft\Signatures\*.* "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\"Outlook Signature"\" /S/Y
XCOPY "%appdata%"\Microsoft\Outlook\*.* "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\outlook_name\" /S/Y


REGEDIT /S /e \\SERVEUR\transferts\GEEKERS\\sauvegardes\Save_Profils\%username%\%Poste%\\OutCfg.reg "HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook"
REGEDIT /S /e \\SERVEUR\transferts\GEEKERS\\sauvegardes\Save_Profils\%username%\%Poste%\\IECfg.reg "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer"
REGEDIT /S /e \\SERVEUR\transferts\GEEKERS\\sauvegardes\Save_Profils\%username%\%Poste%\\LctRsx.reg "HKEY_CURRENT_USER\Network"
REGEDIT /S /e \\SERVEUR\transferts\GEEKERS\\sauvegardes\Save_Profils\%username%\%Poste%\\ImprRsx.reg "HKEY_CURRENT_USER\Printers"
REGEDIT /S /e \\SERVEUR\transferts\GEEKERS\\sauvegardes\Save_Profils\%username%\%Poste%\\ImprDft.reg "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows"


pause
goto home


:RESTORE
rem set /p Poste= indiquer le nom du PC:
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\signatures" "%appdata%\microsoft\signatures\" /s /e /y /i
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%" "%userprofile%\" /s /e /y /i
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\TaskBar" "%AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar" /s /e /y /i
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\outlook" "%userprofile%\AppData\Roaming\Microsoft\Outlook"/s /e /y /i
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\Favorites\" "%userprofile%\Favorites\" /S/Y
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\downloads\" "%userprofile%\downloads\"*.* /S/Y
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\pictures\" "%userprofile%\pictures\"*.* /S/Y
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\videos\" "%userprofile%\videos\"*.* /S/Y
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\music\" "%userprofile%\music\"*.* /S/Y
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\"virtual machines"\" "%userprofile%\virtual machines"\"*.* /S/Y
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\links\" "%userprofile%\links\"*.* /S/Y
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\"saved games"\" "%userprofile%\"saved games"\*.* /S/Y
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\contacts\" "%userprofile%\contacts\"*.* /S/Y
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\desktop\" "%userprofile%\Desktop\"*.* /S/Y
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\"My Documents"\" "%userprofile%\Documents\"*.* /S/Y
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\"Outlook PST"\" "%localappdata%\Microsoft\Outlook\"*.pst /S/Y
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\"Outlook Signature"\" "%appdata%"\Microsoft\Signatures\*.* /S/Y
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\outlook_name\" "%appdata%"\Microsoft\Outlook\*.* /S/Y


REGEDIT /S \\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\%Poste%\\OutCfg.reg "HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook"
REGEDIT /S \\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\%Poste%\\IECfg.reg "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer"
REGEDIT /S \\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\%Poste%\\LctRsx.reg "HKEY_CURRENT_USER\Network"
REGEDIT /S \\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\%Poste%\\ImprRsx.reg "HKEY_CURRENT_USER\Printers"
REGEDIT /S \\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\%Poste%\\ImprDft.reg "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows"


pause


echo FINI
pause
goto home

Partager cet article

Repost 0
Publié par Vaks - dans DOS SCRIPTS TUTOS
commenter cet article
18 juin 2015 4 18 /06 /juin /2015 23:13

# PowerShell script de sauvegarde de profil by Geekers
# Requires -RunAsAdministrator
Enable-PSRemoting -Force
Clear-Host


Enable-PSRemoting


New-Item -Path "Registry::HKEY_CLASSES_ROOT\Microsoft.PowershellScript.1\Shell\runas\command" `
-Force -Name '' -Value '"c:\windows\system32\windowspowershell\v1.0\powershell.exe" -noexit "%1"'

Set-ExecutionPolicy Bypass


# Set-ExecutionPolicy Bypass -scope LocalMachine
# Set-ExecutionPolicy Bypass -scope MachinePolicy
# Set-ExecutionPolicy Bypass -scope UserPolicy
# Set-ExecutionPolicy Bypass -scope Process
# Set-ExecutionPolicy Bypass -scope CurrentUser


# memorise juste le nom du profil


$User = [Environment]::UserName
$Computer = [System.Net.Dns]::GetHostName()
$Desktop = "$ENV:USERPROFILE\desktop"
$Documents = "$ENV:USERPROFILE\documents"
$Pictures = "$ENV:USERPROFILE\Pictures"
$Downloads = "$ENV:USERPROFILE\Downloads"
$Favorites = "$ENV:USERPROFILE\Favorites"
#$AppMicrolocal = "$ENV:USERPROFILE\Appdata\Local\Microsoft\"
$LocalOutlook = "$ENV:USERPROFILE\Appdata\Local\Microsoft\Outlook"
#$AppMicroroaming = "$ENV:USERPROFILE\Appdata\Roaming\Microsoft"
$RoamOutlook = "$ENV:USERPROFILE\Appdata\Roaming\Microsoft\Outlook"
$Music = "$env:userprofile\music"
$profil = "$env:userprofile"
$contact = "$env:userprofile\contacts"


Invoke-Command -ComputerName $Computer -ScriptBlock {powershell \\moya\transferts\Geekers\Support\Save_Profil_ok.ps1}


#Enter-PSSession -ComputerName $Computer -Credential localhost\administrateur


# Logiciel divers


$Log_gmc = "$env:userprofile\gmc"
$Log_Promark = "$env:userprofile\.promark"
$Log_TT_logfiles = "c$\tt\logfiles"
$Log_TT_ttconfig = "c$\tt\datfiles\TTCONFIG"
$Log_TT_config = "c$\tt\config"


$Source = "$env:userprofile\"
# C:\Users\geekers\
$SourceFinal = "$env:userprofile\Desktop\" + [System.Net.Dns]::GetHostName()
# C:\Users\geekers\Desktop\pc-geekers
$DestFinal = "\\pc-geekers\PARTAGE\"
# \\pc-geekers\PARTAGE\
$Dest = "$ENV:USERPROFILE\desktop"
# C:\Users\geekers\desktop


# creer dossier dans dossier destination sous nom du profil


#$Dest1 = New-Item -path $Dest -Name $Computer -ItemType directory -force
$Dest1 = New-Item -path $DestFinal -Name $Computer -ItemType directory -force
$Dest2 = New-Item -path $Dest1 -Name $User -ItemType directory -force
$DestFinal2 = New-Item -path $DestFinal -Name $Computer -ItemType directory -force


# copie vers dest des dossiers suivants


Copy-Item $Music $Dest2 -Recurse
Copy-Item $Favorites $Dest2 -Recurse
Copy-Item $Desktop c:\apps\ -Recurse
Copy-Item $Documents $Dest2 -Recurse
Copy-Item $Pictures $Dest2 -Recurse
Copy-Item $Download $Dest2 -Recurse
Copy-Item $LocalOutlook $Dest2 -Recurse
Copy-Item $RoamOutlook $Dest2 -Recurse
Copy-Item $Log_gmc $Dest2 -Recurse
Copy-Item $Log_Promark $Dest2 -Recurse
Copy-Item $Log_TT_logfiles $Dest2 -Recurse
Copy-Item $Log_TT_ttconfig $Dest2 -Recurse
Copy-Item $Log_TT_config $Dest2 -Recurse


# Copy-Item $Dest2 $DestFinal2 -Recurse


# Remove-Item -path $SourceFinal -Force -Recurse

Partager cet article

Repost 0