[英]Powershell script for searching properties for a limited number of users on the AD
I am trying to run a PS script of a limited number of users. 我正在尝试运行有限数量的用户的PS脚本。 As I have too many users on AD, it's taking a long time.
由于我在AD上的用户过多,因此需要很长时间。
Anyone knows how to run Script on Limited number of users? 有谁知道如何在有限数量的用户上运行脚本? Eg: 200
例如: 200
Store the user in a variable, loop over it as you wish: 将用户存储在变量中,并根据需要在其上循环:
$user = Get-ADUser -Filter "*"
$start = 0;
for ($i = $start; $i -lt $start + 200; $i++) {
$user[$i] # run your code here
}
Now increase $start
and go again. 现在增加
$start
并再次执行。
您可以使用-ResultSetSize
参数限制返回的用户数:
Get-ADUser -Filter * -ResultSetSize 200
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.