dgardin
asked on
Domino Mail file inventory/Cleanup
We have several hundred user that have left , How can I find out who has person documents vs mail files on the server. We don't have a access to mailfile acl. I would like to create a list of mail files with no person documents, and a list of person document with no mail file.
Is there such an agent. The help software by "Power Tools" require admin access to the database. P.S. This is an AIX env.
Is there such an agent. The help software by "Power Tools" require admin access to the database. P.S. This is an AIX env.
You can use the DbDirectory object to get a list of files, and match them up. or, you can use catalog or statlog data.
Note: DbDirectory will not show items that have "show in open file dialog" turned off in database properties. However, the catalog and statlog ALWAYS show ALL files.
Correctoon: The catalog always CONTAINS al files, but the regular views in the catalog do not show item that have ben marked as "do not show in catalog" in database properties.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Const serverName = "your server"
Const dbFiles = "c:\mail_dbs.txt" 'for running on a windows PC
Const malUserFiles = "c:\mailuser.txt" 'ditto, for output of listed filenames on person docs
Dim db as new notesDatabase (serverName , "log.nsf" )
Dim view as notesView
Open dbFiles for output as #1
set view = db.getView("DatabaseSizes" )
dim doc as notesDOcument
set doc = view.getFirstDocument
Dim fileName as string
Do Until doc is nothing
fileName = lcase(doc.PathName(0))
if Left$(fileName, 5) = "mail/" Then Print #1, fileName
set doc = view.getNextDocument(doc)
Loop
Close #1
dim nab as new notesDatabase ( servername , "names.nsf" )
set view = nab.getView("Mail Users")
open mailUserFiles for output as #2
set doc = view.getFirstDocument
Do Until doc is nothing
fileName = lcase(doc.MailFile(0))
if fileName <> "" Then Print #1, fileName
set doc = view.getNextDocument(doc)
Loop
Close #1
Now, srt the two files, and compare. the differences will show where there is a file in the mail directory with no user, or a mail user with no mail file. This assumes you have a single server, consistently use / instead of \ in person doc mail file names, and all mail files are in the mail directory.
While this will not identify teh USER NAME with the missing mail file directly, you can probably find those pretty easily based on the reported file name. Being a Unix shop, I'm sure youknow how to use the shell commands to sort and compare the files. The Windows eqivalents are sort.exe and fc.exe
Const dbFiles = "c:\mail_dbs.txt" 'for running on a windows PC
Const malUserFiles = "c:\mailuser.txt" 'ditto, for output of listed filenames on person docs
Dim db as new notesDatabase (serverName , "log.nsf" )
Dim view as notesView
Open dbFiles for output as #1
set view = db.getView("DatabaseSizes"
dim doc as notesDOcument
set doc = view.getFirstDocument
Dim fileName as string
Do Until doc is nothing
fileName = lcase(doc.PathName(0))
if Left$(fileName, 5) = "mail/" Then Print #1, fileName
set doc = view.getNextDocument(doc)
Loop
Close #1
dim nab as new notesDatabase ( servername , "names.nsf" )
set view = nab.getView("Mail Users")
open mailUserFiles for output as #2
set doc = view.getFirstDocument
Do Until doc is nothing
fileName = lcase(doc.MailFile(0))
if fileName <> "" Then Print #1, fileName
set doc = view.getNextDocument(doc)
Loop
Close #1
Now, srt the two files, and compare. the differences will show where there is a file in the mail directory with no user, or a mail user with no mail file. This assumes you have a single server, consistently use / instead of \ in person doc mail file names, and all mail files are in the mail directory.
While this will not identify teh USER NAME with the missing mail file directly, you can probably find those pretty easily based on the reported file name. Being a Unix shop, I'm sure youknow how to use the shell commands to sort and compare the files. The Windows eqivalents are sort.exe and fc.exe
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Qwalette,
You seem to be too busy today in EE
CHeers
Partha
You seem to be too busy today in EE
CHeers
Partha
Find somebody to pay me, I'll go away.
ASKER
Yes You guys are great. Ive never been to a forum so responsive.
ASKER
One other thing I forgot to mention, this is a clustered env.
dgardin,
CLustering adds a bit of complexity, but nothing terrible. Run the script against both servers. The user list will be identical, becaus ethe NABs should be identical. The dbs files MAY be identical, because typically in a clistered environment, you try to have all files on all servers (well, in a two-server cluster, anyway; on a three way, you may be load balancing and providing failover for each user to only one of the other servers).
I would actually identify the clustrer file differences first, and validate the "missing" fles from each server. They may bemissing because someone got rid of a user, but only deleted one of the replicas instead of both... or it may help you find users you forgot to cluster or whose cluster creation failed.
Once you figure out what to do with the clustr imbalances, re-run the script, sort and merge the db lists, and compare to the sorted user list, as described above. Any mismatches are an indicator of a file without a useror a user without a file.
CLustering adds a bit of complexity, but nothing terrible. Run the script against both servers. The user list will be identical, becaus ethe NABs should be identical. The dbs files MAY be identical, because typically in a clistered environment, you try to have all files on all servers (well, in a two-server cluster, anyway; on a three way, you may be load balancing and providing failover for each user to only one of the other servers).
I would actually identify the clustrer file differences first, and validate the "missing" fles from each server. They may bemissing because someone got rid of a user, but only deleted one of the replicas instead of both... or it may help you find users you forgot to cluster or whose cluster creation failed.
Once you figure out what to do with the clustr imbalances, re-run the script, sort and merge the db lists, and compare to the sorted user list, as described above. Any mismatches are an indicator of a file without a useror a user without a file.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
And if you save your agents with the server.id, you can have admin access to all your databases.
I generally don't recommend saving agents using a server id, but in this case (on R5, I presume), it's a good way to do it.
If you are on R6 by any chance, you can use the Full Access Administrator feature to examine the mailfiles more closely ... You won't need to save your agent with a server.id then, either, since you can use the 'Run on behalf of' feature
cheers,
Tom
I generally don't recommend saving agents using a server id, but in this case (on R5, I presume), it's a good way to do it.
If you are on R6 by any chance, you can use the Full Access Administrator feature to examine the mailfiles more closely ... You won't need to save your agent with a server.id then, either, since you can use the 'Run on behalf of' feature
cheers,
Tom
Bozzie4,
I've seen that tool. Pretty good, but there are a few things coded to either IEEE's or Sumitomo's server configuration.
I've seen that tool. Pretty good, but there are a few things coded to either IEEE's or Sumitomo's server configuration.
Can't remember, it's been 2 years since I used it myself (modified it to incorporate in a bigger analysis tool)
It does the job ...
cheers,
Tom
It does the job ...
cheers,
Tom