The easiest way of doing this is to reenable the virtual drive M and then drill into it using a script. I wouldn't alter anything in there though.
We use a script below to count the number of items in the inbox and sent items by accessing the folder properties and then push the contents into a sql database.
On error resume next
Dim ConnLogin
Dim Username
Dim MailNickNameEx
Dim StoreInboxPath
Dim StoreSentItemsPath
Dim InboxItemsCount
Dim SentItemsCount
Dim StrSqlP1
Dim StrSqlP2
Dim StrSqlM1
set ConnLogin = CreateObject("ADODB.Connection") 'Define SQL Connection
ConnLogin.Open = "Provider=SQLOLEDB;Data Source=SQLSERVER;Initial Catalog=PCAudit;Uid=USER;pwd=PASSWORD" 'Open SQL connection for Input
StrSqlP1 = "INSERT into PCAudit.dbo.MailboxProcess (ProcessTypeDB, LastUpdate) VALUES ('Started', GetDate())"
ConnLogin.Execute StrSqlP1 'Record the process start
'wscript.echo StrSqlP1
Set objConnection = CreateObject("ADODB.Connection") ' Open ADODB Connection
Set objCommand = CreateObject("ADODB.Command") ' Open ADODB Command
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
objcommand.CommandText = "<LDAP://dc=DOMAINNAME,dc=Com>;(&(objectCategory=User)" & "(userAccountControl:1.2.840.113556.1.4.803:=0));mailNickName,sAMaccountname;Subtree"
' The =0 section at the end of the search string returns only enabled users. Changing this to =2 will only return disabled users.
' ObjectCategory=User only returns objects that are users.
' mailnickname is the only field we are interested in returning into the recordset.
set objrecordset = objcommand.Execute 'Open Active Directory and retrieve only users
Set objFSO = CreateObject("Scripting.FileSystemObject") 'Open the file system
objrecordset.movefirst
do until objrecordset.EOF
Username = "" 'Clear Variables
MailnickNameEx = ""
StoreInboxPath = ""
StoreSentItemsPath = ""
InboxItemCount = 0
StoreSentItemsCount = 0
MailNickNameEx = objRecordSet.Fields("mailNickName")
Username = objRecordSet.Fields("sAMaccountname")
If username <> "" Then 'Ignore users with no mail nickname
If MailNickNameEx <> "" Then
StoreInboxPath = "M:\DOMAINNAME.CO.UK\MBX\" & MailNickNameEx & "\Inbox" 'setup path to inbox
StoreSentItemsPath = "M:\DOMAINNAME.CO.UK\MBX\" & MailNickNameEx & "\Sent Items" 'setup path to sent items
Set objFolder = objFSO.GetFolder(StoreInboxPath)
InboxItemCount = objFolder.Files.Count 'Count Inbox Items
Set objFolder = objFSO.GetFolder(StoreSentItemsPath)
SentItemCount = objFolder.Files.Count 'Count Sent Items
StrSqlM1 = "INSERT into PCAudit.dbo.MailBoxFolderCount (UsernameDB, MailNickNameDB, InboxItemCountDB, SentItemsCountDB, LastUpdate) VALUES ('" & Username & "','" & MailNickNameEx & "','" & InboxItemCount & "','" & SentItemCount & "', GetDate())"
'wscript.echo StrSqlM1 'Use In Debug
ConnLogin.Execute StrSqlM1 'Record Data into SQL
End If
End If
objrecordSet.MoveNext
Loop
StrSqlP2 = "INSERT into PCAudit.dbo.MailboxProcess (ProcessTypeDB, LastUpdate) VALUES ('Finished', GetDate())"
ConnLogin.Execute StrSqlP2 'record process finishing
Chris Styles
NT4/2000 MCSE