Bağlantısı kesilen mailboxların purge edilmesi scripti

April 9, 2007
Share on Twitter

“˜ On Error Resume Next
Dim cComputerName
Dim objWMIService
Dim oDisMbox
Dim mBox
Dim dmBoxes
Dim strAnswer
Const cWMINameSpace = “œroot/MicrosoftExchangeV2″³
Const cWMIInstance = “œExchange_Mailbox”
cComputerName = “œSRVEXC01″³

strWinMgmts = “œwinmgmts:{impersonationLevel=impersonate}!//”& _
cComputerName & “œ/” & cWMINameSpace
Set objWMIService = GetObject(strWinMgmts)
Set oDisMbox = objWMIService.ExecQuery(“Select * from Exchange_Mailbox WHERE DateDiscoveredAbsentInDS IS NOT Null”)
if oDisMbox.count > 0 then
Set objExplorer = WScript.CreateObject(“InternetExplorer.Application”)
objExplorer.Navigate “œabout:blank”
objExplorer.ToolBar = 0
objExplorer.StatusBar = 0
objExplorer.Width=400
objExplorer.Height = 100
objExplorer.Left = 0
objExplorer.Top = 0

Do While (objExplorer.Busy)
Wscript.Sleep 200
Loop

objExplorer.Visible = 1
objExplorer.Document.Body.InnerHTML = “œMailboxen worden ingelezen, moment”¦.”

For each mBox in oDisMbox
dmBoxes = dmBoxes & mBox.MailboxDisplayName & “œ, “
Next

strAnswer = MsgBox(“Volgende disconnected Mailboxen gevonden: “ & vbCr & vbCr & dmBoxes & vbCr & vbCr & “ DOORGAAN ?” , 20, “œPurgen ?”)
If strAnswer = 6 Then
For each mBox in oDisMbox
objExplorer.Document.Body.InnerHTML = “œMailbox being purged: “ & mBox.MailboxDisplayName
mBox.Purge
Next
objExplorer.Document.Body.InnerHTML = “œVolgende disconnected mailboxen zijn purged :” & vbCr & vbCr & dmBoxes
Else
objExplorer.Quit
Msgbox “œNothing done”¦”
Wscript.quit
End If
else
Wscript.echo “œNo Disconnected Mailboxes found !”
End if
Wscript.Echo “œDone !”
Wscript.Sleep 3000
objExplorer.Quit

Share
Share on Twitter

posted in Scriptler by Anıl ERDURAN

Follow comments via the RSS Feed | Leave a comment | Trackback URL

1 Comment to "Bağlantısı kesilen mailboxların purge edilmesi scripti"

  1. [...] Bağlantısı kesilen mailboxların purge edilmesi scripti [...] wrote:

    [...] Bağlantısı kesilen mailboxların purge edilmesi scripti [...]

Leave Your Comment

 
Powered by Wordpress and MySQL. Theme by Shlomi Noach, openark.org