|
发表于 2019-3-1 00:24:34
|
显示全部楼层
脚本按格式生成个csv,然后倒入office 365的那个批量生用户对话框。
自用python小程序,供参考:
- import csv
- import random
- import names
- with open('./sample.csv', 'w+', newline='') as csvfile:
- spamwriter = csv.writer(csvfile, delimiter=',')
-
- spamwriter.writerow(['用户名','名字','姓氏','显示名称','职务','部门','办公室号码','办公室电话','移动电话','传真号码', '地址', '城市','省/自治区/直辖市','邮政编码','国家或地区'])
- for ind in range(10):
- firstname = names.get_first_name()
- lastname = names.get_last_name()
- username = firstname + lastname + '@caoms.ac.id'
- namedisp = firstname + lastname
- position = 'IT 管理员'
- depart = 'From TG @voice_google'
- office_no = random.randint(1000, 9999)
- office_ph = random.randint(10000000000, 19999999999)
- mobile_ph = random.randint(10000000000, 19999999999)
- fax_num = '010-1234' + str(random.randint(1000, 9999))
- address = '海淀区中关村东路'
- city = '北京'
- province = '北京'
- ship_num = '100000'
- country = '中国'
- spamwriter.writerow([username, firstname, lastname, namedisp, position, depart, office_no, office_ph, mobile_ph, fax_num, address, city, province, ship_num, country])
复制代码 |
|