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

“˜ 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

One thought on “Bağlantısı kesilen mailboxların purge edilmesi scripti

Leave a Reply

Your email address will not be published. Required fields are marked *

3 + 3 =