惩戒的场外发展的Active Directory [英] Mocking an Active Directory for off site development

查看:189
本文介绍了惩戒的场外发展的Active Directory的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我接到一个客户端应用程序,使用SQL Server 2005,其中包含许多看法加入到他们的活动目录。他们这样做是为了保护什么人都可以在数据库中看到。我需要能够从我的远程开发环境中运行这些观点,我期待的建议,就如何做到这一点。

我不能重复他们的AD服务器,即在虚拟机中运行它。
我想我可以重新写取出加入到AD的意见,但似乎只是时间的腰部。

我读到 Active Directory轻型目录服务在<一个href="http://stackoverflow.com/questions/1300695/how-to-replicate-and-set-up-a-test-active-directory-dc/1300882#1300882">this SO质疑,可以说实现了我对查询的环境?

我不并列,以建立一个虚拟机使用Active Directory服务,但它可能会导致很多额外的配置时间,在一个简单的LDAP服务器可以很好的工作(耸肩)。

下面是用于访问AD查询的例子(大部分领域都没有使用,但是这是一个工作的另一天):

  ...
FROM OPENQUERY(ADSI,
   选择锡,给定名称,通过UserPrincipalName,姓名,公司,physicalDeliveryOfficeName,
    部门的StreetAddress,L,ST,邮政code,钴,邮件,telephoneNumber,
    facsimileTelephoneNumber,经理,Sam帐户名,extensionattribute1
    从''的LDAP:// OU = EPPPPUsers,DC = EPPPP,DC = COM''
    WHERE对象类=''用户''或对象类=''接触''')AS RS1
LEFT OUTER JOIN
  (SELECT'EPPPP \'+ SUBSTRING(UserPrincipalName进行,0,CHARINDEX('@',serPrincipalName))用户名,CN
从
  OPENQUERY(ADSI,选择的UserPrincipalName,CN
  从''的LDAP:// OU = EPPPPUsers,DC = EPPPP,DC = COM''')AS Rowset_1)AS mUsr
    ON mUsr.CN = LEFT(SUBSTRING(经理,CHARINDEX('=',经理)+ 1,LEN(经理)),CHARINDEX(',',SUBSTRING(经理,CHARINDEX('=',经理)+ 1,LEN (经理))) -  1)
 

解决方案

你能复制,你需要用<一个广告内容href="http://www.microsoft.com/downloads/details.aspx?FamilyId=9688F8B9-1034-4EF6-A3E5-2A2A57B5C8E4&displaylang=en">ADAM? 我用它在XP,以及2003。

I received a client application, using SQL Server 2005, which contains many views with joins to their active directory. They do this to secure what people can see in the database. I need to be able to run these view from my remote development environment and I am looking for suggestion on how to do this.

I cannot duplicate their AD server, i.e. run it in a VM.
I guess I could re-write the views removing the joins to AD, but that seems to be a waist of time.

I read about Active Directory Lightweight Directory Services in this SO question, could that achieve an environment for me to query against?

I am not apposed to setting up a VM with Active Directory services, but it could lead to a lot of extra configuration time, where a simpler LDAP server may work just as well (shrug).

Here is an example of a query used for accessing the AD (Most of the fields aren't used but that's a job for another day):

...   
FROM    OPENQUERY(ADSI, 
   'SELECT  Sn, givenName, userPrincipalName, Name, company, physicalDeliveryOfficeName,
    department, streetAddress, L, St, postalCode, Co, Mail, telephoneNumber,
    facsimileTelephoneNumber, manager, samaccountname, extensionattribute1    
    FROM ''LDAP://OU=EPPPPUsers, DC=EPPPP, DC=COM''
    WHERE objectClass=''user'' OR objectClass=''contact''') AS rs1    
LEFT OUTER JOIN     
  (SELECT  'EPPPP\' + SUBSTRING(userPrincipalName, 0, CHARINDEX('@', serPrincipalName)) AS UserName, CN    
FROM     
  OPENQUERY(ADSI, 'SELECT userPrincipalName,    CN    
  FROM ''LDAP://OU=EPPPPUsers, DC=EPPPP, DC=COM''') AS Rowset_1) AS mUsr    
    ON mUsr.CN = LEFT(SUBSTRING(manager, CHARINDEX('=', manager) + 1, LEN(manager)), CHARINDEX(',', SUBSTRING(manager, CHARINDEX('=', manager) + 1, LEN(manager))) - 1)

解决方案

Can you replicate the AD content that you need with ADAM? I've used it on XP, as well as 2003.

这篇关于惩戒的场外发展的Active Directory的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆