我正在使用System.DirectoryServices.AccountManagement命名空间来查找域用户及其相应的AD安全组.这很好用.
我也使用该命名空间来查询远程服务器上的本地安全组.我能够找到一个安全组,然后列出该组的用户没问题.
我遇到的问题是显示DOMAIN用户所属的LOCAL组:
PrincipalContext localmachine = new PrincipalContext(ContextType.Machine, "ServerName");
PrincipalContext domain = new PrincipalContext(ContextType.Domain);
// find the user using the domain context (Works fine)
UserPrincipal user = UserPrincipal.FindByIdentity(domain, userName);
// if found - grab its groups
if (user != null)
{
// The get groups method is the only method that would accept a new context
PrincipalSearchResult<Principal> groups = user.GetGroups(localMachine);
// no groups are returned .... removed rest of code
}
Run Code Online (Sandbox Code Playgroud)
我正在尝试使用传入localMachine PrincipalContext的GetGroups方法,但不返回任何组.
用户仅存在于域AD中.localMachine上的本地用户中没有此用户的条目.域用户将添加到本地安全组.
有任何想法吗?我希望能够提取此域用户所属的所有本地组的列表,然后查看该列表中是否存在某些组.现在唯一可行的选项是我搜索系统上的某些组,并查看域用户是否属于该组.
我正在为应用程序商店开发的应用程序很少需要网络连接.我已经实现了一种在没有网络连接时处理/通知用户的方法,但这只有在他们发起请求时才会发生(单击按钮进行Web服务调用).
我的问题是,苹果是否需要连续检查网络连接,即它们的可达性示例,或者我实施的方法(仅在触发某些操作时检查网络连接)是否可以接受应用商店提交?
提前致谢.
我对Angular的指令很新,并试图弄清楚使用它们的正确方法.我正在使用ng-repeat来填充元素列表.一旦加载了转发器,我想查看每个元素并找到哪个是最高的(其中包含最多的文本),然后强制所有元素达到该大小.
在jQuery中实现这一点的方法是这样的:
var tallest = 0;
// Loop through each element
$('.element-class').each(function () {
var thisHeight = $(this).height();
if (thisHeight > tallest)
tallest = thisHeight;
});
// Apply height to all elements
$('.element-class').height(tallest);
Run Code Online (Sandbox Code Playgroud)
有人能够指导我如何使用指令(或其他更合适的Angular方式)来实现这一目标.转发器看起来像这样.
<div class="element-class" ng-repeat="item in items">
<div class="element-title" ng-bind="item.title"></div>
<p class="element-text" ng-bind="item.description"></p>
</div>
Run Code Online (Sandbox Code Playgroud)