2014年1月13日 星期一

啟用或停用信箱稽核記錄




Set-Mailbox -Identity "Ben Smith" -AuditEnabled $true

Set-Mailbox -Identity "Ben Smith" -AuditEnabled $false





啟用信箱的信箱稽核記錄時,系統僅會記錄信箱稽核記錄設定中所指定之系統管理員、代理人和擁有者的行為。
這個範例指定會為 Ben Smith 信箱記錄委派使用者執行的 SendAsSendOnBehalf 動作。
Set-Mailbox -Identity "Ben Smith" -AuditDelegate SendAs,SendOnBehalf -AuditEnabled $true
這個範例指定會為 Ben Smith 的信箱記錄系統管理員執行的 MessageBindFolderBind 動作。
Set-Mailbox -Identity "Ben Smith" -AuditAdmin MessageBind,FolderBind -AuditEnabled $true
這個範例指定將會為 Ben Smith 信箱記錄信箱擁有者執行的 HardDelete 動作。
Set-Mailbox -Identity "Ben Smith" -AuditOwner HardDelete -AuditEnabled $true

2014年1月1日 星期三

WSUS Script to delete duplicate SID created by Disk Imaging / Disk Cloning

WSUS: Script to delete duplicate SID created by Disk Imaging / Disk Cloning


You might notice that some computers are appearing multiple times in WSUSAdmin - Computers and some of them disappear very often. This is due to duplicate SUS client IDs. Take a look at this script which deletes duplicate SUS client IDs found on a computer. These IDs are often found on computers where the operating system was installed using an image-based setup.

 

Script Code

============================================

@echo off
Echo Save the batch file "AU_Clean_SID.cmd". This batch file will do the following:
Echo 1.    Stops the wuauserv service
Echo 2.    Deletes the AccountDomainSid registry key (if it exists)
Echo 3.    Deletes the PingID registry key (if it exists)
Echo 4.    Deletes the SusClientId registry key (if it exists)
Echo 5.    Restarts the wuauserv service
Echo 6.    Resets the Authorization Cookie
Echo 7.    More information on http://msmvps.com/Athif
Pause
@echo on
net stop wuauserv
REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v AccountDomainSid /f
REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v PingID /f
REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v SusClientId /f
net start wuauserv
wuauclt /resetauthorization /detectnow
Pause

============================================
SUS client ID will be generated at next detection.
Delete Duplicate SUS Client IDs
http://www.microsoft.com/technet/scriptcenter/csc/scripts/software/update/cscsw027.mspx