Ejemplo n.º 1
0
        public SPAuditEntryCollectionInstance GetEntries(object query)
        {
            SPAuditEntryCollection result;

            if (query is SPAuditQueryInstance)
            {
                result = m_audit.GetEntries((query as SPAuditQueryInstance).SPAuditQuery);
            }
            else
            {
                result = m_audit.GetEntries();
            }

            return(result == null
                ? null
                : new SPAuditEntryCollectionInstance(this.Engine.Object.InstancePrototype, result));
        }
Ejemplo n.º 2
0
        private void GetAuditEntriesButton_Click(object sender, EventArgs e)
        {
            SPSite site = new SPSite("http://sp2016");

            SPAudit audit = site.Audit;

            var collection = audit.GetEntries();

            string json = JsonConvert.SerializeObject(collection);

            File.WriteAllText(@"C:\aduit.log", json);

            grid.DataSource = collection.Cast <SPAuditEntry>().ToList();
        }
Ejemplo n.º 3
0
        public List <Aduit> GetAuditEntries()
        {
            SPSite  site  = new SPSite("http://sp2016");
            SPAudit audit = site.Audit;
            SPAuditEntryCollection collection = audit.GetEntries();

            List <Aduit> Data = new List <Aduit>();

            foreach (SPAuditEntry i in collection)
            {
                Data.Add(TransExpV2 <SPAuditEntry, Aduit> .Trans(i));
            }

            return(Data);
        }