Get-ADUser Error Get-ADUser : Not a valid Win32 FileTime RRS feed

  • Question

  • I am running below command but it is erroring out after certain users. Is there anybody has any idea?

    Get-ADUser -SearchBase "OU=U=Test,DC=acme,,DC=net" -Properties * -Filter * | Select-Object GivenName

    Get-ADUser : Not a valid Win32 FileTime.
    Parameter name: fileTime
    At line:1 char:1
    + Get-ADUser -SearchBase "OU=Test,DC=acme,DC=net" -Properties * -Fi ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (:) [Get-ADUser], ArgumentOutOfRangeException
        + FullyQualifiedErrorId : ActiveDirectoryCmdlet:System.ArgumentOutOfRangeException,Microsoft.ActiveDirectory.Manag

    Wednesday, April 6, 2016 8:38 PM


  • Assuming that one of the LargeInteger attributes, like accountExpires or lastLogon, has an invalid value, that would explain the error. In particular, accountExpires can have the largest possible 64-bit value (2^63-1), which cannot be handled by PowerShell and raises an error. The solution is to just specify the attributes you want with the -Properties parameter. Using -Properties * retrieves all properties that have values. For example:

    Get-ADUser -SearchBase "OU=Test,DC=acme,DC=net" -Properties GivenName, sn, DisplayName, userPrincipalName, Title, employeeID -Filter * | Select-Object GivenName, sn, DisplayName, userPrincipalName, Title, employeeID

    You could get tricky and just list the properties that are extended (not among the default set exposed by Get-ADUser), but I would have to look up which are default. This Wiki documents both default and extended properties exposed by Get-ADUser:

    Richard Mueller - MVP Enterprise Mobility (Identity and Access)

    Thursday, April 7, 2016 3:03 PM

All replies