Windows 7 XPまたはVista用のMicrosoft EFS暗号化を自動化する方法

数日前、スクリプトを作成する必要がありました。職場のエンドユーザーのフォルダーを暗号化します。以下のコードを作成し、それをログインスクリプトにスローし、ユーザーがシステムにログオンしたときに実行されます。暗号化の目的は、デスクトップやラップトップに保存されている企業の機密データを保護することです。プロセスはうまくいきましたが、展開する前に徹底的にテストすることをお勧めします!

以下のコードは、いくつかのことを行う簡単なプロセスです。

  1. ログインしたユーザーの「マイドキュメント」フォルダー内のすべてのデータを暗号化します。
  2. ログインしたユーザーの「Outlook」フォルダー内のすべてのデータを暗号化します。これは、Outlook 2000およびOutlook 2003が.pstおよび.ostファイルを保存するデフォルトの場所です。
  3. 後で収集するために、スクリプトからのすべての出力をファイルにパイプします。ファイルは、ログインしているユーザーの「マイドキュメント」の下にあります。ファイルの名前は%computername%.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!

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!
0

類似の記事

コメントを残す