1
我在用户变量中获取空值..我在想什么?将网络服务用户添加到管理组
PrincipalContext pc = new PrincipalContext(ContextType.Machine);
GroupPrincipal user = GroupPrincipal.FindByIdentity(pc, @"NT AUTHORITY\NETWORK SERVICE");
GroupPrincipal group = GroupPrincipal.FindByIdentity(pc, "Administrators");
group.Members.Add(user);
group.Save();