#52566 - 2000-12-05 10:32 PM
Re: Pull SMTP email address from an exchange server
|
Paul_Berquam
Hey THIS is FUN
Registered: 2000-08-02
Posts: 310
Loc: Sacramento, CA USA
|
Sorry Bryce, it may not be the best solution. Depends on where your server is located. Even if you poll it, you may spend the next month recounting the poll.  ------------------ "He was a good little monkey and always very curious..."
_________________________
He was a good little monkey and always very curious...
|
|
Top
|
|
|
|
#52567 - 2000-12-05 10:35 PM
Re: Pull SMTP email address from an exchange server
|
Paul_Berquam
Hey THIS is FUN
Registered: 2000-08-02
Posts: 310
Loc: Sacramento, CA USA
|
Seriously though. I was looking for the same kind of thing. Not for the Email addy since we have standardized them. I was interested in doing something on the intranet here. Anyway, found some info hereI haven't had time to look into it, hopefully someone else has some insight. ------------------ "He was a good little monkey and always very curious..." [This message has been edited by Paul_Berquam (edited 05 December 2000).]
_________________________
He was a good little monkey and always very curious...
|
|
Top
|
|
|
|
#52568 - 2000-12-06 01:24 PM
Re: Pull SMTP email address from an exchange server
|
Anonymous
Anonymous
Unregistered
|
Hey that reminded of something I was workign on a while ago....ADSI!!! Or Active Directory Service Interface. With ADSI you can create/delete users and user info, as well as create/delete/update mailbox information. The problem is how to get kixtart communicating with ADSI. But ADSI supports Visual Basic Scripting, so it shouldn't be impossible. I would be worth a look, because it is really a powerfull toy. Read more about it here: http://www.microsoft.com/windows2000/library/howitworks/activedirectory/adsilinks.asp If you find out how to use it with kixtart, please post some examples
|
|
Top
|
|
|
|
#52571 - 2000-12-06 05:24 PM
Re: Pull SMTP email address from an exchange server
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Super idea ! A sort of "roll your own" Quota Manager" ! I could use something like that. I've got some user communities that definitely push the bounds of "reasonable" disk usage. I could see this service of yours initializing itself from an INI file - sort of a "list of shares" thing - and each share would have a quota and an email address attached to it. Then all you'd need to do is use one of those automatic mailer thingy programs (BLAT?) - and wow ! - great idea ! Shawn.
|
|
Top
|
|
|
|
#52575 - 2000-12-06 09:02 PM
Re: Pull SMTP email address from an exchange server
|
Bryce
KiX Supporter
   
Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
|
I have 338 user shares  using this code, to build a database/ini file code:
break on cls$path = "d:\users" $tempfile = "%temp%\temp.dat" $database = "d:\diruse.ini" if exist($database) = 0 $nul = open(1,$database,5) $nul = close(1) endif ? "Building $Database" $return = dir("$path\*.*") while @error = 0 select case $return = "." or $return = ".." ;ignore case (getfileattr("$path\$return") & 16) = 16 ; $return will equal a dir or a file, ; depending on how $dirfileflag was set shell '%comspec% /c diruse /m "$path\$return" | find /i " total:" > $tempfile' $nul = open(1,$tempfile,2) $data = readline(1) $nul = close(1) $foldersize = ltrim(substr($data,1,13)) $nul = writeprofilestring("$database","DIRUSE","$return","$foldersize") "." endselect $return = dir() loop
It took a total of 00:01:50.765 to run. Bryce
|
|
Top
|
|
|
|
#52577 - 2000-12-06 09:43 PM
Re: Pull SMTP email address from an exchange server
|
Bryce
KiX Supporter
   
Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
|
Don't know. I have been thinking about what would be the best way to run this.I am thinking about breaking it up in to 2 time groups. Group 1 is ran once every 10 min, but this scan will only check the users that are close to and or over the limit (only using the information that is supplied from the database, and not doing a full diruse scan). Group 2 would run once every 2 hours and it would run doing a full diruse scan Thinking about using a 3 strikes your out rule too. You will have to be over your limit for 3 scans in a row before write access is removed. This is where I would like to use email as a warning tool. I would like to have some way of notifying the user that their user folder is over it's size limit, and i can only use their USERID to do this. If all my users were NT i would just do a "net send" message, but.... this is not the case. Bryce
|
|
Top
|
|
|
|
#52578 - 2000-12-06 10:15 PM
Re: Pull SMTP email address from an exchange server
|
Paul_Berquam
Hey THIS is FUN
Registered: 2000-08-02
Posts: 310
Loc: Sacramento, CA USA
|
Question on the Exchange setup that you have. Do you have all of the users in a single container or do you have multiple containers? If in multiple containers, is there a way you can tell which one they are in? Because if you knew which container they were in you could use the exchange admin program and do a command line export of the GAL and parse through it line by line searching for a matching First Name and last name, then when you find it, go to the SMTP portion of the line and extract it to get the addy.I have included sample code below. The only assumption is that you have the Exchange admin program loaded on the machine that this is being run on code:
break on$fname = "Paul" ;The user's first name $Lname = "Berquam" ; $exch = "Y" ; ? "Searching for $fname $lname" ? ;options.txt is a file with the following ; ;[Export] ;Subcontainers=Yes ;Basepoint=/o=<ORGNAME>/ou=<SITENAME>/cn=<CONTAINERNAME> ; ;End of options.txt ;note: The container is optional, if you don't enter it it should go to the GAL if $exch = "Y" $exchadminpath = readvalue("HKEY_LOCAL_MACHINE\Software\Microsoft\Exchange\Setup","AdminDest")
$exchfile = "c:\temp\testexch.csv" $options = "c:\options.txt" $DSNAME = "YOUREXCHANGESERVERNAME" ;Directory server name if exist($exchfile) del "$exchfile" endif $nul = open (7,$exchfile,1) $nul = close(7) shell "$exchadminpath\admin.exe /e $exchfile /d $DSNAME /o $options" ;for export ;Note that you can include a /n switch so that it doesn't display the gui export screen. ;I kept it so that I could be sure that it was it was doing something $found = 0 $found2 = 0 $count = 0 $countfirst = 0 $countlast = 0 $line = "none" $nul = open(7,$exchfile,2) ? "Searching..." while $line <> "" $line = readline(7) "." $count = $count + 1 $found = instr($line,$fname) ; ? "$fname $line" if $found <> 0 $countfirst = $countfirst + 1 $found2 = instr($line,$lname) if $found2 <> 0 $mailstart = instr($line,"SMTP:") $linelen = len($line) $line2 = substr($line,$mailstart,$linelen - $mailstart) $mailend = instr($line2,"%") $mailaddy = substr($line2,6,$mailend-6) $countlast = $countlast + 1 endif endif loop $nul = close(7) ? "$count records searched" if $countlast > 0 ? "$fname $lname found" ? "Mail address is $mailaddy" else ? "$fname $lname not found" endif endif ? ? "$countfirst name(s) matching $fname" ? "$countlast name(s) matching $lname" ? "End" get $c
------------------ "He was a good little monkey and always very curious..." [This message has been edited by Paul_Berquam (edited 06 December 2000).] [This message has been edited by Paul_Berquam (edited 06 December 2000).]
_________________________
He was a good little monkey and always very curious...
|
|
Top
|
|
|
|
#52579 - 2000-12-06 10:19 PM
Re: Pull SMTP email address from an exchange server
|
Paul_Berquam
Hey THIS is FUN
Registered: 2000-08-02
Posts: 310
Loc: Sacramento, CA USA
|
Instead of running this each time you could also do a check date and if it's not current, it reexports the data for the most current list. Then parse it for each glutton user.------------------ "He was a good little monkey and always very curious..."
_________________________
He was a good little monkey and always very curious...
|
|
Top
|
|
|
|
#52581 - 2000-12-06 10:39 PM
Re: Pull SMTP email address from an exchange server
|
Paul_Berquam
Hey THIS is FUN
Registered: 2000-08-02
Posts: 310
Loc: Sacramento, CA USA
|
In that case, in the options file, leave the \cn=... portion out, or just set it to the single container name.Tested it here with a few names and it seems to work. Of course performance will depend on how big the GAL is. In fact my script for screating the user accounts uses the import mode of admin.exe to create the mailboxes. One of these days I'll get around to cleaning it up and posting it. ------------------ "He was a good little monkey and always very curious..."
_________________________
He was a good little monkey and always very curious...
|
|
Top
|
|
|
|
#52582 - 2000-12-06 10:52 PM
Re: Pull SMTP email address from an exchange server
|
Paul_Berquam
Hey THIS is FUN
Registered: 2000-08-02
Posts: 310
Loc: Sacramento, CA USA
|
I just updated the code. I found a record that I couldn't find for some reason. I changed it so that it had a separate counter for the fname and lname instances.------------------ "He was a good little monkey and always very curious..."
_________________________
He was a good little monkey and always very curious...
|
|
Top
|
|
|
|
#52584 - 2000-12-06 11:19 PM
Re: Pull SMTP email address from an exchange server
|
Paul_Berquam
Hey THIS is FUN
Registered: 2000-08-02
Posts: 310
Loc: Sacramento, CA USA
|
I would definitely have ot agree with you there.If I may ask, what's the db for? Are you using it so that you can use the addy as a UPN for 2k users or something? ------------------ "He was a good little monkey and always very curious..."
_________________________
He was a good little monkey and always very curious...
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 580 anonymous users online.
|
|
|