Skip to content

Instantly share code, notes, and snippets.

@haniehrajabi
haniehrajabi / lync-sample1.py
Last active January 25, 2018 23:32 — forked from msmorul/lync-sample1.py
Example python script for authenticating to Lync and creating an application endpoint that lists all of a persons contacts. Python example for what's described here https://ucwa.lync.com/documentation/keytasks-createapplication
import requests
import json
from urlparse import urlparse
sip_domain = "SIP_DOMAIN.COM"
username = "USERNAME@SIP_DOMAIN.COM"
password = "YOUR_LYNC_PASSWORD"
def extractAuthURL(str):
start = str.find('MsRtcOAuth');
#! /usr/bin/python
import sys, os, operator
from os.path import isfile, join, getsize
def list_files(path):
binned_ranges = {}
for dirpath, dirnames, filenames in os.walk(path):
for filename in filenames:
filesize=os.stat(os.path.join(dirpath,filename)).st_size
base = 1024