-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUpdateSPList.py
27 lines (23 loc) · 1.03 KB
/
UpdateSPList.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from shareplum import Site
from requests_ntlm import HttpNtlmAuth
import csv
cred = HttpNtlmAuth('domain\\vennem', 'password')
site = Site('https://sharepoint.domain.local/admin', verify_ssl=False, auth= cred)
sp_list = site.List('SharePoint Business Owners and POCs')
with open('C:\\Users\\vennem\\Desktop\\ciso.csv') as csvfile:
readcsv = csv.reader(csvfile,delimiter=',')
next(readcsv)
for row in readcsv:
if row[5]=="Readable by all of domain":
Access = "All domain"
else:
Access = "Team"
newitemdata = [{'Site Title': row[1]},
{'Primary Point of Contact': row[2]},
{'Secondary POC': row[3]},
{'Primary Owners Group': row[4]},
{'Relative URL': row[0][29:]},
{'Division and Office': 'row[6]'},
{'Q1 FY2019 Audit': 'Complete'},
{'Access Restricted to': Access}]
sp_list.UpdateListItems(data=newitemdata, kind='New')