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

Invalid Enumeration Context using powershell script to check computer accounts

$
0
0

Hello,

I am using a powershell script downloaded from technet gallery (http://gallery.technet.microsoft.com/PowerShell-Organize-d37c2a29#content) to automatically move the computers to OUs based on IP subnets in active directory. But after a while the script is failing with an error 'Invalid Enumeration Context'  on the line

Get-ADComputer -Filter { OperatingSystem-like "Windows 7*" -or OperatingSystem -like "Windows XP*" }-Properties PasswordLastSet |ForEach-Object {

I tried to fix the error by including diffrent Page Size values 10, 1 and 0 as shown below but thats only helped to run the script a little longer before failing with the same error. I also incrased the MaxPageSize value to 10000 in ladp policies using ntdsutil in active directory but had no effect.

Get-ADComputer -Filter { OperatingSystem-like "Windows 7*" -or OperatingSystem -like "Windows XP*" }-Properties PasswordLastSet -ResultPageSize 1 |ForEach-Object {

Can you please help me with this issue?

Thanks veru much in advance!

Jashy


Viewing all articles
Browse latest Browse all 15028

Trending Articles



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