Ejemplo n.º 1
0
 public void TestGroupObjectFindOneWithIP()
 {
     using (var adObject = ADObject.FindOneByObjectGUID(this.IPADOperator, this.GroupGuid))
     {
         var groupObject = adObject as GroupObject;
         Assert.NotNull(groupObject);
         Assert.AreEqual(this.GroupSid, groupObject.ObjectSid);
     }
 }
        public void TestChangeCN()
        {
            Guid   contactId = Guid.Empty;
            string newCN     = "pangcontactnew";

            using (var contactObject = ContactObject.FindOneByCN(this.ADOperator, this.ContactCN))
            {
                contactObject.CN = newCN;
                contactId        = contactObject.ObjectGuid;
                contactObject.Save();
            }
            using (var contactObject = ADObject.FindOneByObjectGUID(this.ADOperator, contactId))
            {
                Assert.AreEqual(newCN, contactObject.CN);
            }
            using (var contactObject = ContactObject.FindOneByCN(this.ADOperator, newCN))
            {
                contactObject.CN = this.ContactCN;
                contactObject.Save();
            }
        }
Ejemplo n.º 3
0
 public void TestGroupObjectFindOne()
 {
     using (var groupObject = GroupObject.FindOneBySid(this.ADOperator, this.GroupSid))
     {
         Assert.AreEqual(this.GroupSAMAccountName, groupObject.SAMAccountName);
         Assert.AreEqual(this.GroupEmail, groupObject.Email);
         Assert.AreEqual(this.GroupNotes, groupObject.Notes);
         Assert.NotNull(groupObject.GroupSids);
         Assert.GreaterOrEqual(groupObject.GroupSids.Count, 1);
         Assert.AreEqual(this.GroupTokenGroupSid, groupObject.GroupSids[0]);
         Assert.NotNull(groupObject.Members);
         Assert.GreaterOrEqual(groupObject.Members.Count, 1);
         Assert.AreEqual(this.GroupMember, groupObject.Members[0]);
         Assert.AreEqual(this.GroupType, groupObject.GroupType.ToString());
         Assert.AreEqual(this.GroupScope, groupObject.GroupScopeType.ToString());
     }
     using (var adObject = ADObject.FindOneByObjectGUID(this.ADOperator, this.GroupGuid))
     {
         var groupObject = adObject as GroupObject;
         Assert.NotNull(groupObject);
         Assert.AreEqual(this.GroupSid, groupObject.ObjectSid);
     }
 }