Photo Gallery
Member List
Search
Calendars
FAQ
Ticket List
Log Out
Forums
Register
Login
My Profile
Inbox
Address Book
My Subscription
My Forums
Exchange Mailbox Enumerator
Logged in as: Guest
arrSession:exec spGetSession 2,16,50960
Active Users: There are
0
members and
0
guests.
Users viewing this topic: none
Printable Version
All Forums
>>
[Scripting]
>>
Post a VBScript
>> Exchange Mailbox Enumerator
Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page:
[1]
Login
Message
<< Older Topic
Newer Topic >>
Exchange Mailbox Enumerator -
8/19/2007 8:54:39 PM
4scriptmoni
Posts: 184
Score: 0
Joined: 5/3/2007
Status:
offline
Edit the correct format for the servername, DB, SG and it works really nice!
Does about 12k in 8min.
enjoy it...
'Scipt to enumerate users (total Mailboxes) in Excahnge SGs and DBs 'Authour: Felipe Ferreira 'Date: 20/08/2007 'Version 2.0 Option Explicit Dim t1, runtime,k,i,SG,DB,SGp,DBp, count Dim strScriptFile, strScriptPath, strComputer Dim objWMIService, colItems, objItem t1 = Timer 'time the script strScriptFile = WScript.ScriptFullname strScriptPath = Left(strScriptFile, Len(strScriptFile) - Len(WScript.Scriptname)) 'used to define the path from where the script file is located Dim objFSO : Set objFSO = CreateObject("Scripting.FileSystemObject") Dim oFile2 : Set oFile2 = objFSO.CreateTextFile(strScriptPath & "\EnumMBX_Totals.txt", True) For k=9 to 9 ' ciclo per i cluster For i=1 to 1 ' ciclo per i server For SG=1 to 1 ' ciclo per StorageGroup For DB=2 to 4 ' ciclo per Db On Error Resume Next strComputer = "SERVERMBX0" & K & "V0" & i 'SERVERNAME FIRST LETTERS Dim objTextFile : Set objTextFile = objFSO.CreateTextFile(strScriptPath & strComputer & "_SG" & SG & "_DB" & DB & "_" & day(now) & "_" & month(now) & "_" & year(now) & " .txt", True) objTextFile.WriteLine "Servername; SG; DB; MailboxName; Size; Total Emails" Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & _ "\ROOT\MicrosoftExchangeV2") 'FORMAT DB AND SG NAMES SGp = "SG" & SG SGp = "'" & SGp & "'" DBp = "DB" & DB DBp = "'" & DBp & "'" 'QUERY SERVER JUST EACH SG DBs Set colItems = objWMIService.ExecQuery _ ("Select * from Exchange_Mailbox WHERE ((StoreName="& DBp &") And (StorageGroupName="& SGp &"))") wscript.echo strComputer & " SG: " & SGp & " DB: " & DBp & " Please wait..." 'PULL INFO For Each objItem in colItems objTextFile.WriteLine(objItem.ServerName & ";" & objItem.StorageGroupName & ";" & objItem.StoreName & ";" & objItem.MailboxDisplayName & ";" & objItem.Size & ";" & objItem.TotalItems) count = count + 1 Wscript.StdOut.Write(".") Next RunTime = Timer - t1 RunTime = Left(RunTime, 4) RunTime = RunTime / 60 RunTime = Left(RunTime, 4) wscript.echo VbCrLf & strComputer & ";" & SGp & ";" & DBp & "; Total Mailbox: " & count & " in: " & RunTime & " min" & VbCrLf oFile2.writeline strComputer & ";" & SGp & ";" & DBp & ";" & count count = 0 objTextFile.Close Set objTextFile= Nothing next ' ciclo per Db next ' ciclo per StorageGroup next ' Server Loop next ' Cluster Loop wscript.quit
_____________________________
Enterprise Microsoft Scripts
Exchange, Login/Logout Monitor,TS, Monitoring, Security, AD, etc...
http://www.xoroz.com
Post #: 1
If you found our site useful please link to us
<a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>
.
All Forums
>>
[Scripting]
>>
Post a VBScript
>> Exchange Mailbox Enumerator
Page:
[1]
Jump to:
Select a Forum
All Forums
----------------------
[Welcome]
- - Forum Rules
- - Test Posting Messages
- - New Member Area/Introduction
[Scripting]
- - WSH & Client Side VBScript
- - WSH & Client Side VBScript Tutorial
- - Post a VBScript
- - Windows PowerShell
- - ASP
- - ASP.NET
- - Windows Script Components
[General Forum]
- - Other Programming/Scripting Languages
- - Suggestions & Feedback
- - Off-Topic Lounge
New Messages
No New Messages
Hot Topic w/ New Messages
Hot Topic w/o New Messages
Locked w/ New Messages
Locked w/o New Messages
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
Forum Software ©
ASPPlayground.NET
Advanced Edition
2.5.5 ANSI