从csv中选择随机用户并将其添加到SP列表中 [英] Pick random users from csv and add them in SP list

查看:132
本文介绍了从csv中选择随机用户并将其添加到SP列表中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Guys,

Hello Guys,

我需要有来自AD的所有用户的csv文件。 CSV由networkID和emailID组成。

I need have csv file which consist of all users from AD. The CSV consists of networkID and emailID.

根据要求,我需要从csv文件中选择随机用户并将其添加到自定义列表中。

As per requirement, i need to pick random users from the csv file and add them to a custom list.

并且希望确保不会再次挑选被挑选的用户。

And would like to ensure that the picked users are not picked again.

推荐答案

您可以使用
LDIFDE
实用程序:

ldifde -d ou=myusers,dc=example,dc=com -p onelevel -r "(ObjectCategory=user)" -f users.csv


之后使用
File.ReadAllLines()
方法并根据需要做任何事情。

After that reall all lines using File.ReadAllLines() method and do whatever you need with them.


这篇关于从csv中选择随机用户并将其添加到SP列表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆