Perl:访问域中或 Microsoft Outlook 中的用户和电子邮件
我最近从离开公司的人那里接手了一个脚本,但它最近开始失败。该代码查找特定用户并向他们发送一封电子邮件。
我已经确定了失败的罪魁祸首(用户和密码设置为我的个人帐户):
my $dbh = DBI->connect('dbi:ODBC:IDM', $idm_user, $idm_passwd)
从该数据库中,脚本从指定的用户登录名中选择电子邮件。
我似乎找不到任何有关数据库 IDM 的文档,想知道是否有人知道它? 它是内置的 Microsoft Exchange DB 还是 Windows 域 DB?
谢谢!
I've recently taken over a script from someone who's left the company and it recently started failing. The code looks up a specific user and sends them an e-mail.
I've nailed the culprit line that fails to be (user and passwords is set to my personal account):
my $dbh = DBI->connect('dbi:ODBC:IDM', $idm_user, $idm_passwd)
from this database the script selects the E-mail from a specified user login name.
I can't seem to find any documentation on the database IDM and was wondering if anyone knows of it?
Is it a built in Microsoft Exchange DB or Windows domain DB?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
该线路连接到一个名为 IDM 的 ODBC 数据源,该数据源是在该系统的 ODBC 数据源管理器中定义的。
That line is connecting to an ODBC data source called IDM defined in the ODBC data source administrator in that system.
Ewww...
我有一种感觉,这个人编写了自己的数据库来完成这个特定的任务,并维护了该数据库。
我必须做这样的事情并使用 Net:: LDAP 从 Windows Active Directory 读取用户的电子邮件地址,然后使用 Net::SMTP 编写电子邮件。当然,您的 Windows Active Directory 必须配置为允许 LDAP 访问,并且您的 Outlook 电子邮件必须配置为允许基于 SMTP 的邮件。
您可以尝试类似 Win32::AD::User 直接从 Active Directory 获取用户的电子邮件地址,但我感觉您没有对其的读/写访问权限。
如果您知道如何获取用户的信息,您可以尝试 Mail::Outlook 编写实际的电子邮件。
我从未使用过这两个模块。我想我很幸运,我的 Window 站点允许 LDAP 访问和 SMTP。
Ewww...
I have a feeling that the guy wrote his own database to do this particular task, and maintained that database.
I had to do something like this and used Net::LDAP to read the user's email address from the Windows Active Directory, then used Net::SMTP to write the email. Of course, your Windows Active Directory must be configured to allow for LDAP access, and your Outlook email must be configured to allow for SMTP based mail.
You can try something like Win32::AD::User to fetch the user's email address directly from Active Directory, but I have a feeling that you won't have read/write access to it.
If you can figure out how to fetch the user's information, you can try Mail::Outlook to write the actual email.
I never used either of these modules. I guess I've been lucky that my Window sites allow LDAP access and SMTP.