½Ã½ºÅÛ °ü¸®ÀÚ¸¦ À§ÇÑ VBS ¿øº» - ¾î¶»°Ô ÀÚµ¿ÀÇ Áö¿ø Àü¸Á ÀüÀÚ ¿ìÆí¿¡ ·Î±×ÀÎ ¶Ç´Â Á¢¼Ó ³¡ ¿øº»¿¡¼
2007³â3¿ù 13ÀÏ 8:11 AM¿¡ ¿¡ ¹èÄ¡ÇÏ´Â
´ç½ÅÀÌ ´ç½ÅÀÇ È¸»ç¸¦ À§ÇÑ ½Ã½ºÅÛ °ü¸®ÀÚÀÌ°í ¸ðµÎ°¡ Àü¸Á ¶Ç´Â ´Ù¸¥ ¾î¶² Ź»ó¿ë ÀüÀÚ ¿ìÆí ÇÁ·Î±×·¥À» »ç¿ëÇÏ´Â °æ¿ì¿¡, ´ç½ÅÀº ´©±¸°¡ »ç¿ëÀÚÀÇ ÄÄÇ»ÅÍ¿Í ÁÖ¿ä ¼¹ö¿¡ ¾Æ´Õ´Ï´Ù ÇöÁö¿¡ ÀúÀåÇß´Ù ´Â »ç½Ç ¶§¹®¿¡ ±×µéÀÇ ÀüÀÚ ¿ìÆí ÀüºÎ¸¦ ÀÒÀº »óȲÀ¸·Î ¾Æ¸¶ ´Þ·È´Ù. ÀÌ·¸°Ô ´ç½ÅÀÌ ÀÛÀº »óÁ¡ÀÌ°í ±³È¯ ¼¹ö¸¦ ¾ò´Â °ÍÀ» ¿©À¯°¡ ÀÖÀ» ¼ö ¾ø´Â °æ¿ì¿¡, ±× ÈÄ¿¡ ·Î±×ÀÎ ¶Ç´Â Á¢¼Ó ³¡ ¿øº»¿¡ ÀÖ´Â ´ç½ÅÀÇ ¼¹ö¿¡ »ç¿ëÀÚÀÇ Àü¸Á PST ÆÄÀÏÀÇ ¹é¾÷À» ÀÚµ¿ÈÇÏ´Â ¹æ¹ýÀº °£´ÜÇÏ°Ô ¿©±â¿¡¼ ÀÌ´Ù.
ºÎÈ£´Â ¿©±â¿¡¼ ù°·Î ÀÖ°í ±× ¶§ ³ª´Â ±×°ÍÀ» ¼³¸íÇÒ °ÍÀÌ´Ù:
³õÀ¸½Ê½Ã¿À shell= WScript.CreateObject (" WScript.Shell")¸¦
strUserName = shell.ExpandEnvironmentStrings (" %USERNAME%")
Èñ¹ÌÇÑ fso
³õÀ¸½Ê½Ã¿À fso = CreateObject (" Scripting.FileSystemObject")¸¦
lnDayOfWeek = ÆòÀÏ (Áö±Ý ())
¸¸¾à¿¡ lnDayOfWeekÀÎ °æ¿ì¿¡ = 5 ±× ÈÄ¿¡
¸¸¾à¿¡ fso.DriveExists (" GÀÎ °æ¿ì¿¡: ") ±× ÈÄ¿¡
Èñ¹ÌÇÑ lcDrive
°íÁ¤µÇ´Â lcDrive = fso.GetDrive (" G: ")
¸¸¾à¿¡ ±× ¶§ lcDrive.IsReadyÀÎ °æ¿ì¿¡
newfolderpath = "\ \ servername \ »ç¿ëÀÚ \" & strUserName & "\ EmailBackup"
±×·¸Áö ¾ÊÀ¸¸é fso.FolderExists (newfolderpath) ±× ÈÄ¿¡
³õÀ¸½Ê½Ã¿À newfolder = fso.CreateFolder (newfolderpath)¸¦
³¡³»´Â °æ¿ì¿¡
Èñ¹ÌÇÑ ÆÄÀÏ
ÆÄÀÏ = "C:\Documents and Settings\" & strUserName & "\ ÇöÁö Á¶Á¤ \ ÀÀ¿ë ÇÁ·Î±×·¥ µ¥ÀÌÅÍ \ ¸¶ÀÌÅ©·Î¼ÒÇÁÆ® \ Àü¸Á \ Outlook.pst"
¸¸¾à¿¡ fso.FileExists (ÆÄÀÏÀÎ °æ¿ì¿¡) ±× ÈÄ¿¡
fso.CopyFile "C:\Documents and Settings\" & strUserName & "\ ÇöÁö Á¶Á¤ \ ÀÀ¿ë ÇÁ·Î±×·¥ µ¥ÀÌÅÍ \ ¸¶ÀÌÅ©·Î¼ÒÇÁÆ® \ Àü¸Á \ Outlook.pst", "\ \ servername \ »ç¿ëÀÚ \" & strUserName & "\ EmailBackup \ Outlook.pst"
fso¸¦ = ¾Æ¹«°Íµµ ³õÀ¸½Ê½Ã¿À
wscript.echo´Â "´ç½ÅÀÇ ÀüÀÚ ¿ìÆí º¸¿ÏµÇ¾ú¾ú´Ù!"
³¡³»´Â °æ¿ì¿¡
³¡³»´Â °æ¿ì¿¡
³¡³»´Â °æ¿ì¿¡
³¡³»´Â °æ¿ì¿¡
Unforunately´Â, ºÎÈ£ ¿©±â¿¡¼ ¾ÆÁÖ Àß ¸¸ÀԽñâÁö ¾Ê´Â´Ù, ±×·¡¼ ´ç½ÅÀÌ ±×°ÍÀ» Á¤È®ÇÏ°Ô ÀÐÀ» ¼ö ÀÖ´Ù ±×·¡¾ß ´ç½ÅÀº ±×°ÍÀ» º£³¢°í °íÃÄ¾ß ÇÒ °ÍÀÌ´Ù. ±âº»ÀûÀ¸·Î, ±×°ÍÀº ½ÃÀÛÇØ ¼¹ö¿¡ ÆÄÀÏÀ» º£³¢±â¸¦ ´Ù·ê ÆÄÀϽýºÅÛ ¸ñÇ¥¸¦ âÁ¶ÇÑ. ±× ¶§ ³ª´Â ¿øº»ÀÌ ´ÜÁö ÀÏÁÖÀÏ¿¡ ÇÑ ¹ø ´Þ¸°´Ù ±×·¡¾ß ¾î´À ¿äÀÏ ÀÌ°í ³ª°¡ 5°³¸¦ (±Ý¿äÀÏ) »ç¿ëÇÏ´ÂÁö º¸±â À§ÇÏ¿© üũ¸¦ ÇÑ´Ù. ³ª´Â ¶ÇÇÑ ³ª°¡ º£³¥ ¾ò±â Àü¿¡ G µå¶óÀ̺갡 À¯È¿ÇÏ´Ù´Â °ÍÀ» È®ÀÎÇϱâ À§ÇÏ¿© üũ¸¦ ÇÑ´Ù (³×Æ®¿öÅ© µå¶óÀÌºê ³ª´Â ÀڷḦ º£³¢±â À§ÇÏ¿© ·Á°í Çϰí ÀÖ´Ù).
±× ¶§ ³ª´Â ³ª´Â ±×·¸Áö ¾ÊÀ¸¸é¿¡ º£³¢°í ½Í´Ù Æú´õ°¡, ³ª ÃßÁøÇÏ°í ¼¹ö¿¡ »ç¿ëÀÚÀÇ Æú´õ¿¡ Àִ âÁ¶ÇÑ´Ù Àú Æú´õ¸¦ Á¸ÀçÇϰí´ÂÁö º¸±â À§ÇÏ¿© °Ë»çÇÑ´Ù. ³ª´Â ¶ÇÇÑ ÆÄÀÏÀÌ ¸¸ÀÏ ±×·¸´Ù¸é ³×Æ®¿öÅ©¿¡ »ç¿ëÀÚÀÇ Æú´õ¿¡, ³ª ±× ¶§ º£³¤¤¤´Ù´Â °ÍÀ» ±×°ÍÀ» Á¸ÀçÇѤ¤´Ù´Â °ÍÀ» È®ÀÎÇϱâ À§ÇÏ¿© °Ë»çÇÑ´Ù. ³ª´Â shell.ExpandEnvironmentStrings (" %USERNAME%") ÇöÀç »ç¿ëÀÚÀÇ »ç¿ëÀÚ À̸§À» ¾ò±â À§ÇÏ¿© ¹æ¹ýÀ» ÀÌ¿ëÇÑ´Ù.
´ç½ÅÀº ±×·ì Á¤Ã¥À» »ç¿ëÇÏ¿© ·Î±×¿Â ¶Ç´Â Á¢¼Ó ³¡ ¿øº»À¸·Î ±× ¶§ À̰ÍÀ» Àû¿ëÇÒ ¼ö ÀÖ´Ù!
°ü·Ã Æ÷½ºÆ®:
VBS´Â ´õ ½Ã½ºÅÛ °ü¸®ÀÚ¸¦ À§ÇØ ´ëº»À» ¾´´Ù
»ç¹«½Ç ÀÛ¾÷´É·ü - Ź»ó¿ë ¿öÅ©½ºÅ×À̼ǿ¡ ÀÏÀÇ À§Çè ¹× ±×µéÀ» ÇÇÇÏ´Â ¹æ¹ý
Gliffy - ÀÚÀ¯·Î¿îÀ» À§ÇÑ µµÇ¥¸¦ âÁ¶ÇÏ°í °øÀ¯ÇÏ´Â ¿Â¶óÀÎ °ø±¸
µµ¿ò¸» µ¥½ºÅ© ¶Ç´Â ü°è Admintrator Àü¹®°¡¸¦ À§ÇÑ Áß´ëÇÑ °ø±¸ - ºÐ¼® Áø´Ü ±â±¸¸¦ ¹Ù²Ù½Ê½Ã¿À
» Filed Under IT Job Stuff
Save this page |
Stir it up on Mixx |
|
Add to Reddit |
Related Posts
- More VBS Scripts for System Administrators
- Top things Windows System Administrators should and should not do!
- How to move or change the location of My Documents folder
- How to create secured Outlook data files
- How to set away message in Outlook
6 Responses to ¡°VBS Script for System Administrators - How to backup Outlook email automatically in a login or logoff script¡±
Pingbacks
-
Backup Outlook, Outlook Express email using Amic Email backup Says:
[...] next release as Thunderbird is quite popular! I had also written a post way back about how you can write a script in Windows to automatically backup your email. Source: Ghacks Technorati Tags: email backup, backup email, backup outlook email, email backup [...]
April 9th, 2008 at 5:02 am
Please post your comments/suggestions!
[...] next release as Thunderbird is quite popular! I had also written a post way back about how you can write a script in Windows to automatically backup your email. Source: Ghacks Technorati Tags: email backup, backup email, backup outlook email, email backup [...]
April 9th, 2008 at 5:02 am
Save this page
Stir it up on Mixx
Add to Reddit






















Like your script, for home user how can I modify it to do a backup to external hard drive on a daily basis. Thanks
very useful post, i was wondering if there is code to do the same thing every night?
Many thanks
Ameneh
How can I implement when the user is log off from the system?
Is there any possible thatI could take backup of any folder on daily basis on LAN environment?
what happens if some paths contains international characters.. ?
for example c:\documents and settings\george\?? ??????? ???\
Need to know how to set it up to run everyday monday thur Friday. I also would like to know if I can directed to copy the users profile instead of just their pst. That is what I need to run the srcipt for thanks.