我已经解决了从Active Directory中读取一些内容的问题.但结果有一些"ResultPropertyCollection"作为属性.任何机构都知道如何将其转换为列表(如通用列表)?
DirectoryEntry de = new DirectoryEntry("LDAP://" + this.rootLDAP);
DirectorySearcher ds = new DirectorySearcher(de, "(& (objectcategory=Group))");
ds.PropertiesToLoad.Add("samaccountname");
ds.PropertiesToLoad.Add("memberof");
ds.PropertiesToLoad.Add("samaccounttype");
ds.PropertiesToLoad.Add("grouptype");
ds.PropertiesToLoad.Add("member");
ds.PropertiesToLoad.Add("objectcategory");
var r = ( from SearchResult sr in ds.FindAll() select sr ) .ToArray();
Run Code Online (Sandbox Code Playgroud)
谢谢Farzad
我正在尝试使用VSTS部署到我的数据库中,问题在于我需要获取dacpac文件并将其部署到Azure SQL服务器但其失败的步骤之一:在该步骤中,我正在使用" 执行Azure SQL:DacpacTask ",由Microsoft在VSTS中提供.有一个文件要做,它被称为" DACPAC文件 ",文档说使用它像这样:
$(agent.releaseDirectory)\ AdventureWorksLT.dacpac
但它给了我以下错误:
找不到使用搜索模式d:\ a\1\s\$(agent.releaseDirectory)\ AdventureWorksLT.dacpac部署的文件
所以我做了一个作弊并把以下值放在其中:
d:\一个\ 1\S\AdventureWorksLT.dacpac
它确实有效,但很明显,它不会永远工作,因为我需要使用环境变量,例如:
$(agent.releaseDirectory)\ AdventureWorksLT.dacpac
有什么建议吗?
我在Active Directory中使用C#查询:
DirectoryEntry de = new DirectoryEntry("LDAP://" + this.rootLDAP);
DirectorySearcher ds = new DirectorySearcher(de, "(&(objectcategory=Group))");
Run Code Online (Sandbox Code Playgroud)
它工作得很好.
但它返回的其中一个属性称为"samAccountType",它具有以下值:
268435456
268435457
536870912
Run Code Online (Sandbox Code Playgroud)
这是什么意思?