Exchange 2010 da subject ve body yazan bilgiye göre tüm mailboxlardaki mailleri silme
Get-Mailbox -resultsize unlimited | Search-Mailbox -SearchQuery 'Subject:"*XXXX*" and Body:"*hello*"' -DeleteContent
8 Haziran 2012 Cuma
Deleting specific email subject from All Users Mailboxes Exchange 2010
Exchange 2010 da
subject yazan bilgiye göre tüm mailboxlardaki mailleri silme
Get-Mailbox -resultsize unlimited | Search-Mailbox -SearchQuery "subject:XXx yy ZZ" -DeleteContent -force
Get-Mailbox -resultsize unlimited | Search-Mailbox -SearchQuery "subject:XXx yy ZZ" -DeleteContent -force
21 Mayıs 2012 Pazartesi
Error : Event Viewer Security policies were propagated with warning. 0x4b8 : An extended error has occurred
Log dosyasında güvenlik kurallarının tutulduğu veritabanı dosyası ile ilgili hata veriyordu.Log dosyasında Security policies were propagated with warning. 0x4b8 : An extended error has occurred." şeklinde hata aldığınızda aşağıdaki komutu uygulayın
"esentutl /p %Windir%\security\Database\Secedit.sdb"
Bu komut çalıştırılarak security kayıtlarının tutulduğu veritabanı repair edilir.
26 Aralık 2011 Pazartesi
Deleting Files in a Specific Size Script
Belirli bir boyuttan küçük dosyaları silme Script
---------
On Error Resume Next
Function ShowFileList
Klasor = "c:\test_folder\" 'klasor yolu
Limit = 1000000 'silinecek max dosya limiti kb
Uzanti = "log" 'silenecek dosya uzantisi
Dim fso, f, f1, fc
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(Klasor)
Set fc = f.Files
For Each f1 in fc
yol=Klasor&f1.name
Set Dosya = fso.GetFile(yol)
D_Uzanti = right(f1.name,len(f1.name)-instrrev(f1.name,"."))
if Dosya.Size > limit and (ucase(D_Uzanti) = Uzanti or lcase(D_Uzanti) = Uzanti) then
Set Dosya_sil = fso.GetFile(yol)
Dosya_sil.Delete
end if
Next
ShowFileList = s
End Function
ShowFileList
--------
---------
On Error Resume Next
Function ShowFileList
Klasor = "c:\test_folder\" 'klasor yolu
Limit = 1000000 'silinecek max dosya limiti kb
Uzanti = "log" 'silenecek dosya uzantisi
Dim fso, f, f1, fc
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(Klasor)
Set fc = f.Files
For Each f1 in fc
yol=Klasor&f1.name
Set Dosya = fso.GetFile(yol)
D_Uzanti = right(f1.name,len(f1.name)-instrrev(f1.name,"."))
if Dosya.Size > limit and (ucase(D_Uzanti) = Uzanti or lcase(D_Uzanti) = Uzanti) then
Set Dosya_sil = fso.GetFile(yol)
Dosya_sil.Delete
end if
Next
ShowFileList = s
End Function
ShowFileList
--------
Delete folders/files older than a specific day Script
Belli bir günden daha eski klasör/Dosyaları silme Script
----------
' X_TarihdenEskiDosyaSil.vbs Cem 2010
' ***************************************************
' * Bu vbs belirledigimiz tarihden eski file'leri
' * folder ve alt folder'ına bakarak siler
' *
' * Silmek istediğiniz path ve lifetime degiskenlerini girmeniz gerekir
' * Example : path = "\\Dosya\backup"
' * Example : path = "N:\Logfiles"
Path = "C:\WINDOWS\system32\LogFiles"
' * AltFolder'ların içinide silmek için Example : Subfolders = True
' * Sadece tek folder'ı silmek için Example : Subfolders = False
Subfolders = True
' * kac günden eski file'leri silecegiz
' * Example : lifetime = date() - 20
Lifetime = date() - 7
' *******************************************************
FilesArray = Array()
set fso = createobject("scripting.filesystemobject")
SelectFiles path, lifetime, FilesArray, Subfolders
numDeleted = 0
for n = 0 to ubound(FilesArray)
on error resume next
FilesArray(n).delete true
on error goto 0
next
sub SelectFiles(sPath,vlifetime,FilesArrayToKill,bIncludeSubFolders)
on error resume next
set folder = fso.getfolder(sPath)
set files = folder.files
for each file in files
dtlastmodified = null
on error resume Next
dtlastmodified = file.datelastmodified
on error goto 0
if not isnull(dtlastmodified) Then
if dtlastmodified < vlifetime then
count = ubound(FilesArrayToKill) + 1
redim preserve FilesArrayToKill(count)
set FilesArrayToKill(count) = file
end if
end if
next
if bIncludeSubFolders then
for each fldr in folder.subfolders
SelectFiles fldr.path,vlifetime,FilesArrayToKill,true
next
end if
end sub
----------
Copy File Script
Dosya Kopyalama Script
Bir dosyayı farklı bir yere kopyalamak için aşağıdaki script'i kullanabilirsiniz.
----------
Dim systemPath
systemPath = CreateObject("WScript.Shell").ExpandEnvironmentStrings("%WINDIR%")
Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
FSO.CopyFile "c:\foldername\test.txt", "\\SharingName\test.txt"
---------
Bir dosyayı farklı bir yere kopyalamak için aşağıdaki script'i kullanabilirsiniz.
----------
Dim systemPath
systemPath = CreateObject("WScript.Shell").ExpandEnvironmentStrings("%WINDIR%")
Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
FSO.CopyFile "c:\foldername\test.txt", "\\SharingName\test.txt"
---------
Install Fonts Windows Script
Windows Font Yükleme Script
Yeni bir font'u işletim sistemine yüklemek ve group policy ile deploy etmek için kullanılabilecek script.
----------
Option Explicit
'Windows yeni font install edilmesi
DIM objShell,objFolder,objFSO,objFile,fso
Const FONTS = &H14&
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(FONTS)
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set fso = CreateObject("Scripting.FileSystemObject")
'c disk inde fonts.txt var ise kurulum yapmadan çık
If (fso.FileExists("C:\fonts.txt")) Then
WScript.Quit()
Else
'c disk inde fonts.txt yok ise kurulum yap sonra fonts.txt yarat
objFolder.CopyHere "\\SharingName\font_name.ttf"
Set objFile = objFSO.CreateTextFile("C:\fonts.txt")
End If
WScript.Quit()
----------
Kaydol:
Kayıtlar (Atom)