Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Get-ADUser : The server has returned the following error: invalid enumeration context.

$
0
0

I'm running a powershell command to add the email (AD mail) attribute to users in a specific OU.  It seems to work then will bomb out with the error in the title.

I'm using a "scripting guy" command that I've altered with my specfic OU/domain information however, I'm pasting in the more "generic" version :: Get-ADUser -LDAPFilter "(!(mail=\.name*))" -resultSetSize $null -searchbase "ou=test,dc=nwtraders,dc=com"| % {set-aduser -identity $_.distinguishedname -email ($_.samaccountname + "@nwtraders.com")}

I work for a school district and this command is being used to add the mail attribute to the student's accounts.  I think about 2/3 of the students are completed but the script/command bombs and I'm not sure where or why.  I've resubmitted the command several times but I'm not sure whether it's starting from where it bombed or if it's starting again at the beginning and essentially re-doing the ones already completed.

Can someone point me in the direction of a work around or a resolution to the Get-ADUser error?

Thanks!!


Viewing all articles
Browse latest Browse all 15028

Latest Images

Trending Articles



Latest Images

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