Jak zautomatyzować szyfrowanie Microsoft EFS dla Windows 7 XP lub Vista
Kilka dni temu musiałem stworzyć skrypt, któryszyfruje foldery dla moich użytkowników końcowych w pracy. Napisałem poniższy kod, a następnie wrzuciłem go do skryptu logowania, który działałby wtedy, gdy moi użytkownicy logowali się do swoich systemów. Celem szyfrowania jest ochrona poufnych danych firmy przechowywanych na komputerach stacjonarnych i laptopach. Chociaż ten proces działał dla mnie, zalecamy jego dokładne przetestowanie przed wdrożeniem!
Poniższy kod to prosty proces, który wykonuje kilka czynności:
- Szyfruje wszystkie dane w folderze „Moje dokumenty” zalogowanych użytkowników.
- Szyfruje wszystkie dane w folderze „Outlook” zalogowanych użytkowników. Jest to domyślna lokalizacja programów Outlook 2000 i Outlook 2003 przechowujących pliki pst i ost.
- Przenosi wszystkie dane wyjściowe ze skryptu do pliku w celu późniejszego pobrania. Plik może znajdować się pod „Moje dokumenty” zalogowanego użytkownika. Plik będzie się nazywał% nazwa_komputera% .efs.
Windows XP
REM @echo off REM EFS MyDoc & Outlook EFS Encryption Script Version 1.1 REM https://www.groovypost.com REM REM Script Created by MrGroove (groovyPost.com) REM REM This program is free software; not to be redistributed REM without permission of groovyPost.com REM echo ***** >> "%userprofile%my documents%computername%.efs" REM EFS Encryption Script Version 1.1 REM ====================================================== REM First, let"s create a file to store all the work were doing and for history echo ****** >> "%userprofile%my documents%computername%.efs" echo ****** >> "%userprofile%my documents%computername%.efs" REM ====================================================== echo %date% %time% >> "%userprofile%My documents%computername%.efs" REM =================================================== REM Now were going to update all files to ensure no files are encrypted with old keys cipher /u >> "%userprofile%My documents%computername%.efs" REM =================================================== REM Begin encryption of the "My Documents" folder cipher /a /e /h /i /q /s:"%userprofile%My Documents" >> "%userprofile%My documents%computername%.efs" REM ====================================================== REM Begin encrption of the "Outlook" folder where the OST and PST files are stored cipher /a /e /h /i /q /s:"%userprofile%Local SettingsApplication DataMicrosoftOutlook" >> "%userprofile%My documents%computername%.efs" REM ================================================== REM More House Keeping echo %date% %time% >> "%userprofile%My documents%computername%.efs" echo ****** >> "%userprofile%My documents%computername%.efs" echo ****** >> "%userprofile%My documents%computername%.efs" REM ================================================== REM ================================================== REM All Done!
System Windows 7
REM @echo off REM EFS MyDoc & Outlook EFS Encryption Script Version 1.1 REM https://www.groovypost.com REM REM Script Created by MrGroove (groovyPost.com) REM REM This program is free software; not to be redistributed REM without permission of groovyPost.com REM echo ***** >> "%userprofile%documents%computername%.efs" REM EFS Encryption Script Version 1.1 REM ====================================================== REM First, let"s create a file to store all the work were doing and for history echo ****** >> "%userprofile%documents%computername%.efs" echo ****** >> "%userprofile%documents%computername%.efs" REM ====================================================== echo %date% %time% >> "%userprofile%documents%computername%.efs" REM =================================================== REM Now were going to update all files to ensure no files are encrypted with old keys cipher /u >> "%userprofile%documents%computername%.efs" REM =================================================== REM Begin encryption of the "Documents" folder cipher /a /e /h /i /q /s:"%userprofile%Documents" >> "%userprofile%documents%computername%.efs" REM ====================================================== REM Begin encrption of the "Outlook" folder where the OST and PST files are stored cipher /a /e /h /i /q /s:"%userprofile%Local SettingsApplication DataMicrosoftOutlook" >> "%userprofile%documents%computername%.efs" REM ================================================== REM More House Keeping echo %date% %time% >> "%userprofile%documents%computername%.efs" echo ****** >> "%userprofile%documents%computername%.efs" echo ****** >> "%userprofile%documents%computername%.efs" REM ================================================== REM ================================================== REM All Done!
zostaw komentarz