积极答复者
DHCP服务器的审核日志能否设置保留一个月?

问题
答案
-
還沒有內建功能去改變Log的保留期限
這位朋友以Powershell去改變昨天的Log名稱, 從而令Log File保存下來, 值得參考
http://patrickhoban.wordpress.com/2011/03/01/1352/
邊幫助, 邊鍛鍊
- 已标记为答案 Tom Zhang – MSFTModerator 2013年7月10日 8:59
全部回复
-
還沒有內建功能去改變Log的保留期限
這位朋友以Powershell去改變昨天的Log名稱, 從而令Log File保存下來, 值得參考
http://patrickhoban.wordpress.com/2011/03/01/1352/
邊幫助, 邊鍛鍊
- 已标记为答案 Tom Zhang – MSFTModerator 2013年7月10日 8:59
-
这个网址之前我也有搜索过,但好像打不开呀?
能否帮忙粘贴出来或者以其他方式保存发给我?
谢谢!
harry
-
我就轉貼出來噢, 你研究一下
#***************************************************************** # # Script Name: dhcpBackup.ps1 # Version: 1.0 # Author: Jason Carter # # Description: Used to backup DHCP logs from the DHCP server # to another location for archiving purposes. # #***************************************************************** #Get Yestedays Date In Month, Day, Year format $yesterday=(get-date (get-date).AddDays(-1) -uformat %Y%m%d) #Get the first 3 letters of the day name from yesterday $logdate=([string]((get-date).AddDays(-1).DayofWeek)).substring(0,3) #Change path to DHCP log folder, copy yesterdays log file to backup location cd C:\Windows\System32\dhcp copy "DhcpSrvLog-$logdate.log" \\SERVER\SHARE\DHCParchive #Rename log file with yesterdays date cd \\SERVER\SHARE\DHCParchive rename-item "DhcpSrvLog-$logdate.log" "$yesterday.log" #Dump DHCP database $today=(get-date -uformat %Y%m%d) $dumpfile="DHCP_DUMP-$today.txt" netsh dhcp server \\DC dump > \\SERVER\SHARE\DHCParchive\$dumpfile
邊幫助, 邊鍛鍊