static void notifier_ObjectChanged(object sender, ObjectChangedEventArgs e) { string samaccountname = ""; Console.WriteLine(e.Result.DistinguishedName); foreach (string attrib in e.Result.Attributes.AttributeNames) { foreach (var item in e.Result.Attributes[attrib].GetValues(typeof(string))) { Console.WriteLine("\t{0}: {1}", attrib, item); if (attrib == "samaccountname") { samaccountname = item.ToString(); } if (attrib == "isdeleted" && item.ToString() == "TRUE") { LogoutEMUser(samaccountname); Console.WriteLine(" !!!!!Watchout!!!! !!!!!!!!!!!!!!we logout CM EM User !!!!!!!! For --> " + samaccountname); } } } Console.WriteLine(); Console.WriteLine("===================="); Console.WriteLine(); }
private void OnObjectChanged(ObjectChangedEventArgs args) { if (ObjectChanged != null) { ObjectChanged(this, args); } }