Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

why this error?

$
0
0
$users=Get-Content H:\powershell\erp\NOERP.txt 
$out = 0
foreach($user in $users) {
    $out += (Get-ADUser -Filter * -SearchBase  $user ).count   
    }
$out

txt like this

i will get this error,But I can execute by one line 。。。。。Get aduser: the distinguished name provided must belong to one of the following partitions




Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>