Get-ADUser and GeneralizedTime (2.5.5.11)

Helmut-72 66 Reputation points
2022-07-09T17:27:51.643+00:00

Hi,

I have an attribute in AD defined as GeneralizedTime (2.5.5.11, https://ldapwiki.com/wiki/GeneralizedTime):

20301231000000.0Z  

When I query that attribute with Get-ADUser I get:

31.12.0030 01:00:00  

Century is missing. But even worse, if this date is in 2000 then Get-ADUser fails:

Get-ADUser : Year, Month, and Day parameters describe an un-representable DateTime.  
At line:1 char:1  
+ Get-ADUser someUser -Properties someDate  
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
    + CategoryInfo          : InvalidArgument: (someUser:ADUser) [Get-ADUser], ArgumentOutOfRangeException  
    + FullyQualifiedErrorId : ActiveDirectoryCmdlet:System.ArgumentOutOfRangeException,Microsoft.ActiveDirectory.Management.Commands.GetADUser  

startDate is "20000101000000.0Z"

Is there something wrong with the attribute or with Get-ADUser?

Thank you!

Windows for business | Windows Client for IT Pros | Directory services | Active Directory
Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

Accepted answer
  1. Gary Reynolds 9,621 Reputation points
    2022-07-11T04:05:37.93+00:00

    To summarize the difference between Generalized-Time and UTC-String attributes and value format required to set the attribute.

    The ABNF for generalized time is - https://ldapwiki.com/wiki/GeneralizedTime

      GeneralizedTime = century year month day hour  
                           [ minute [ second / leap-second ] ]  
                           [ fraction ]  
                           g-time-zone  
      
      century = 2(%x30-39) ; "00" to "99"  
      year    = 2(%x30-39) ; "00" to "99"  
      month   =   ( %x30 %x31-39 ) ; "01" (January) to "09"  
                / ( %x31 %x30-32 ) ; "10" to "12"  
      day     =   ( %x30 %x31-39 )    ; "01" to "09"  
                / ( %x31-32 %x30-39 ) ; "10" to "29"  
                / ( %x33 %x30-31 )    ; "30" to "31"  
      hour    = ( %x30-31 %x30-39 ) / ( %x32 %x30-33 ) ; "00" to "23"  
      minute  = %x30-35 %x30-39                        ; "00" to "59"  
      
      second      = ( %x30-35 %x30-39 ) ; "00" to "59"  
      leap-second = ( %x36 %x30 )       ; "60"  
      
      fraction        = ( DOT / COMMA ) 1*(%x30-39)  
      g-time-zone     = %x5A  ; "Z"  
                        / g-differential  
      g-differential  = ( MINUS / PLUS ) hour [ minute ]  
      MINUS           = %x2D  ; minus sign ("-")  
    

    While UTCTime has the following ABNF - https://ldapwiki.com/wiki/UTCTime

    UTCTime = year month day hour minute [ second ]  [ u-time-zone ]  
          u-time-zone     = %x5A  ; "Z"  
                            / u-differential  
          u-differential  = ( MINUS / PLUS ) hour minute  
    

    When setting the value of a Generalized-Time attribute in AD the format must be yyyyMMddhhmmss.fZ

    When setting the value of an UTC-String attribute in AD the format must be yyMMddhhmmZ. If you specify century, or a fraction in the string the update will fail. It will also fail if you include the optional [second] of the UTC-String.

    As you have found, if you set an UTC-String with a year of 2000 or 00 (000711000000Z) this will update the attribute with the correct value.

    This is the update sent to the server:

      <s:Body>  
        <da:ModifyRequest Dialect="http://schemas.microsoft.com/2008/1/ActiveDirectory/Dialect/XPath-Level-1">  
          <da:Change Operation="replace">  
            <da:AttributeType>addata:meetingstarttime</da:AttributeType>  
            <da:AttributeValue>  
              <ad:value xsi:type="xsd:string">000711000000Z</ad:value>  
            </da:AttributeValue>  
          </da:Change>  
          <ad:controls>  
            <ad:control type="1.2.840.113556.1.4.1413" criticality="true">  
            </ad:control>  
            <ad:control type="1.2.840.113556.1.4.801" criticality="true">  
              <ad:controlValue xsi:type="xsd:base64Binary">MIQAAAADAgEE</ad:controlValue>  
            </ad:control>  
          </ad:controls>  
        </da:ModifyRequest>  
      </s:Body>  
    

    And this is returned by the ADWS to the client (trimmed down):

      <s:Body>  
        <da:BaseObjectSearchResponse>  
          <da:PartialAttribute>  
            <addata:meetingStartTime LdapSyntax="UTCTimeString">  
              <ad:value xsi:type="xsd:string">000711000000Z</ad:value>  
            </addata:meetingStartTime>  
          </da:PartialAttribute>  
          <da:PartialAttribute>  
            <addata:whenCreated LdapSyntax="GeneralizedTimeString">  
              <ad:value xsi:type="xsd:string">20220710153856.0Z</ad:value>  
            </addata:whenCreated>  
          </da:PartialAttribute>  
        </da:BaseObjectSearchResponse>  
      </s:Body>  
    

    219319-image.png

    and year of 00 causes AD-GetObject to return an un-representable DateTime Error:

    219352-image.png

    I'm not sure if there is anything that you can do to workaround the issue, Gary or Rich any ideas?

    Gary.

    0 comments No comments

11 additional answers

Sort by: Most helpful
  1. Gary Reynolds 9,621 Reputation points
    2022-07-11T08:22:16.23+00:00

    Second attempt to capture the correct error!

    PS C:\Users\administrator.W2K12> get-adobject -identity "CN=testmeeting,CN=Computers,DC=w2k12,DC=local" -properties meetingstarttime  
    get-adobject : Year, Month, and Day parameters describe an un-representable DateTime.  
    At line:1 char:1  
    + get-adobject -identity "CN=testmeeting,CN=Computers,DC=w2k12,DC=local ...  
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
        + CategoryInfo          : InvalidArgument: (CN=testmeeting,...=w2k12,DC=local:ADObject) [Get-ADObject], ArgumentOutOfRangeException  
        + FullyQualifiedErrorId : ActiveDirectoryCmdlet:System.ArgumentOutOfRangeException,Microsoft.ActiveDirectory.Management.Commands.GetADObject  
      
    PS C:\Users\administrator.W2K12> $Error.Exception.StackTrace  
       at System.DateTime.DateToTicks(Int32 year, Int32 month, Int32 day)  
       at System.DateTime..ctor(Int32 year, Int32 month, Int32 day, Int32 hour, Int32 minute, Int32 second, DateTimeKind kind)  
       at Microsoft.ActiveDirectory.Management.ADTypeConverter.ParseDateTimeValue(String value, ADAttributeSyntax syntax)  
       at Microsoft.ActiveDirectory.Management.ADTypeConverter.ConvertFromRaw(String propertyName, ADPropertyValueCollection propertyValues)  
       at Microsoft.ActiveDirectory.Management.ADObjectSearcher.CreateRichADObject(ADObject resultEntry)  
       at Microsoft.ActiveDirectory.Management.ADObjectSearcher.PagedSearch(Object& pageCookie, Boolean& hasSizeLimitExceeded, Int32 pageSize, Int32 sizeLimit)  
       at Microsoft.ActiveDirectory.Management.ADObjectSearchResultEnumerator.System.Collections.IEnumerator.MoveNext()  
       at Microsoft.ActiveDirectory.Management.ADObjectSearcher.FindOne(Boolean& foundMoreThanOneResult)  
       at Microsoft.ActiveDirectory.Management.Commands.ADFactoryUtil.GetObjectFromIdentitySearcher(ADObjectSearcher searcher, ADEntity identityObj, String searchRoot, AttributeSetRequest attrs, CmdletSessionInfo cmdletSessionInfo, String[]& warningMessages)  
       at Microsoft.ActiveDirectory.Management.Commands.ADFactory`1.GetExtendedObjectFromIdentity(T identityObj, String identityQueryPath, ICollection`1 propertiesToFetch, Boolean showDeleted, Boolean showLinkTtl)  
       at Microsoft.ActiveDirectory.Management.Commands.ADFactory`1.GetExtendedObjectFromIdentity(T identityObj, String identityQueryPath, ICollection`1 propertiesToFetch, Boolean showDeleted)  
       at Microsoft.ActiveDirectory.Management.Commands.ADGetCmdletBase`3.ADGetCmdletBaseProcessCSRoutine()  
       at Microsoft.ActiveDirectory.Management.CmdletSubroutinePipeline.Invoke()  
       at Microsoft.ActiveDirectory.Management.Commands.ADCmdletBase`1.ProcessRecord()  
       at System.Management.Automation.CmdletParameterBinderController.VerifyArgumentsProcessed(ParameterBindingException originalBindingException)  
       at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParametersNoValidation(Collection`1 arguments)  
       at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParameters(Collection`1 arguments)  
       at System.Management.Automation.CommandProcessor.BindCommandLineParameters()  
       at System.Management.Automation.CommandProcessor.Prepare(IDictionary psDefaultParameterValues)  
       at System.Management.Automation.CommandProcessorBase.DoPrepare(IDictionary psDefaultParameterValues)  
       at System.Management.Automation.Internal.PipelineProcessor.Start(Boolean incomingStream)  
       at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input)  
    --- End of stack trace from previous location where exception was thrown ---  
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
       at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input)  
       at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)  
       at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)  
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)  
       at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandTypes commandTypes, SearchResolutionOptions searchResolutionOptions, CommandOrigin commandOrigin, ExecutionContext context)  
       at System.Management.Automation.CommandDiscovery.LookupCommandProcessor(String commandName, CommandOrigin commandOrigin, Nullable`1 useLocalScope)  
       at System.Management.Automation.ExecutionContext.CreateCommand(String command, Boolean dotSource)  
       at System.Management.Automation.PipelineOps.AddCommand(PipelineProcessor pipe, CommandParameterInternal[] commandElements, CommandBaseAst commandBaseAst, CommandRedirection[] redirections, ExecutionContext context)  
       at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)  
       at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)  
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)  
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)  
       at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandTypes commandTypes, SearchResolutionOptions searchResolutionOptions, CommandOrigin commandOrigin, ExecutionContext context)  
       at System.Management.Automation.CommandDiscovery.LookupCommandProcessor(String commandName, CommandOrigin commandOrigin, Nullable`1 useLocalScope)  
       at System.Management.Automation.ExecutionContext.CreateCommand(String command, Boolean dotSource)  
       at System.Management.Automation.PipelineOps.AddCommand(PipelineProcessor pipe, CommandParameterInternal[] commandElements, CommandBaseAst commandBaseAst, CommandRedirection[] redirections, ExecutionContext context)  
       at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)  
       at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)  
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)  
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)  
       at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandTypes commandTypes, SearchResolutionOptions searchResolutionOptions, CommandOrigin commandOrigin, ExecutionContext context)  
       at System.Management.Automation.CommandDiscovery.LookupCommandProcessor(String commandName, CommandOrigin commandOrigin, Nullable`1 useLocalScope)  
       at System.Management.Automation.ExecutionContext.CreateCommand(String command, Boolean dotSource)  
       at System.Management.Automation.PipelineOps.AddCommand(PipelineProcessor pipe, CommandParameterInternal[] commandElements, CommandBaseAst commandBaseAst, CommandRedirection[] redirections, ExecutionContext context)  
       at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)  
       at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)  
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)  
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)  
       at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandTypes commandTypes, SearchResolutionOptions searchResolutionOptions, CommandOrigin commandOrigin, ExecutionContext context)  
       at System.Management.Automation.CommandDiscovery.LookupCommandProcessor(String commandName, CommandOrigin commandOrigin, Nullable`1 useLocalScope)  
       at System.Management.Automation.ExecutionContext.CreateCommand(String command, Boolean dotSource)  
       at System.Management.Automation.PipelineOps.AddCommand(PipelineProcessor pipe, CommandParameterInternal[] commandElements, CommandBaseAst commandBaseAst, CommandRedirection[] redirections, ExecutionContext context)  
       at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)  
       at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)  
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)  
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)  
       at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandTypes commandTypes, SearchResolutionOptions searchResolutionOptions, CommandOrigin commandOrigin, ExecutionContext context)  
       at System.Management.Automation.CommandDiscovery.LookupCommandProcessor(String commandName, CommandOrigin commandOrigin, Nullable`1 useLocalScope)  
       at System.Management.Automation.ExecutionContext.CreateCommand(String command, Boolean dotSource)  
       at System.Management.Automation.PipelineOps.AddCommand(PipelineProcessor pipe, CommandParameterInternal[] commandElements, CommandBaseAst commandBaseAst, CommandRedirection[] redirections, ExecutionContext context)  
       at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)  
       at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)  
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)  
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)  
       at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandTypes commandTypes, SearchResolutionOptions searchResolutionOptions, CommandOrigin commandOrigin, ExecutionContext context)  
       at System.Management.Automation.CommandDiscovery.LookupCommandProcessor(String commandName, CommandOrigin commandOrigin, Nullable`1 useLocalScope)  
       at System.Management.Automation.ExecutionContext.CreateCommand(String command, Boolean dotSource)  
       at System.Management.Automation.PipelineOps.AddCommand(PipelineProcessor pipe, CommandParameterInternal[] commandElements, CommandBaseAst commandBaseAst, CommandRedirection[] redirections, ExecutionContext context)  
       at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)  
       at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)  
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)  
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)  
       at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandTypes commandTypes, SearchResolutionOptions searchResolutionOptions, CommandOrigin commandOrigin, ExecutionContext context)  
       at System.Management.Automation.CommandDiscovery.LookupCommandProcessor(String commandName, CommandOrigin commandOrigin, Nullable`1 useLocalScope)  
       at System.Management.Automation.ExecutionContext.CreateCommand(String command, Boolean dotSource)  
       at System.Management.Automation.PipelineOps.AddCommand(PipelineProcessor pipe, CommandParameterInternal[] commandElements, CommandBaseAst commandBaseAst, CommandRedirection[] redirections, ExecutionContext context)  
       at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)  
       at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)  
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)  
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)  
       at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandTypes commandTypes, SearchResolutionOptions searchResolutionOptions, CommandOrigin commandOrigin, ExecutionContext context)  
       at System.Management.Automation.CommandDiscovery.LookupCommandProcessor(String commandName, CommandOrigin commandOrigin, Nullable`1 useLocalScope)  
       at System.Management.Automation.ExecutionContext.CreateCommand(String command, Boolean dotSource)  
       at System.Management.Automation.PipelineOps.AddCommand(PipelineProcessor pipe, CommandParameterInternal[] commandElements, CommandBaseAst commandBaseAst, CommandRedirection[] redirections, ExecutionContext context)  
       at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)  
       at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)  
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)  
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)  
       at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandTypes commandTypes, SearchResolutionOptions searchResolutionOptions, CommandOrigin commandOrigin, ExecutionContext context)  
       at System.Management.Automation.CommandDiscovery.LookupCommandProcessor(String commandName, CommandOrigin commandOrigin, Nullable`1 useLocalScope)  
       at System.Management.Automation.ExecutionContext.CreateCommand(String command, Boolean dotSource)  
       at System.Management.Automation.PipelineOps.AddCommand(PipelineProcessor pipe, CommandParameterInternal[] commandElements, CommandBaseAst commandBaseAst, CommandRedirection[] redirections, ExecutionContext context)  
       at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)  
       at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)  
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)  
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)  
       at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandTypes commandTypes, SearchResolutionOptions searchResolutionOptions, CommandOrigin commandOrigin, ExecutionContext context)  
       at System.Management.Automation.CommandDiscovery.LookupCommandProcessor(String commandName, CommandOrigin commandOrigin, Nullable`1 useLocalScope)  
       at System.Management.Automation.ExecutionContext.CreateCommand(String command, Boolean dotSource)  
       at System.Management.Automation.PipelineOps.AddCommand(PipelineProcessor pipe, CommandParameterInternal[] commandElements, CommandBaseAst commandBaseAst, CommandRedirection[] redirections, ExecutionContext context)  
       at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)  
       at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)  
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)  
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)  
       at System.Management.Automation.CmdletParameterBinderController.VerifyArgumentsProcessed(ParameterBindingException originalBindingException)  
       at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParametersNoValidation(Collection`1 arguments)  
       at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParameters(Collection`1 arguments)  
       at System.Management.Automation.CommandProcessor.BindCommandLineParameters()  
       at System.Management.Automation.CommandProcessor.Prepare(IDictionary psDefaultParameterValues)  
       at System.Management.Automation.CommandProcessorBase.DoPrepare(IDictionary psDefaultParameterValues)  
       at System.Management.Automation.Internal.PipelineProcessor.Start(Boolean incomingStream)  
       at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input)  
    --- End of stack trace from previous location where exception was thrown ---  
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
       at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input)  
       at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)  
       at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)  
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)  
       at System.Management.Automation.CmdletParameterBinderController.VerifyArgumentsProcessed(ParameterBindingException originalBindingException)  
       at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParametersNoValidation(Collection`1 arguments)  
       at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParameters(Collection`1 arguments)  
       at System.Management.Automation.CommandProcessor.BindCommandLineParameters()  
       at System.Management.Automation.CommandProcessor.Prepare(IDictionary psDefaultParameterValues)  
       at System.Management.Automation.CommandProcessorBase.DoPrepare(IDictionary psDefaultParameterValues)  
       at System.Management.Automation.Internal.PipelineProcessor.Start(Boolean incomingStream)  
       at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input)  
    --- End of stack trace from previous location where exception was thrown ---  
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
       at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input)  
       at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)  
       at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)  
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)  
       at System.Management.Automation.CmdletParameterBinderController.VerifyArgumentsProcessed(ParameterBindingException originalBindingException)  
       at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParametersNoValidation(Collection`1 arguments)  
       at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParameters(Collection`1 arguments)  
       at System.Management.Automation.CommandProcessor.BindCommandLineParameters()  
       at System.Management.Automation.CommandProcessor.Prepare(IDictionary psDefaultParameterValues)  
       at System.Management.Automation.CommandProcessorBase.DoPrepare(IDictionary psDefaultParameterValues)  
       at System.Management.Automation.Internal.PipelineProcessor.Start(Boolean incomingStream)  
       at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input)  
    --- End of stack trace from previous location where exception was thrown ---  
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
       at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input)  
       at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)  
       at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)  
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)  
       at System.DateTime.DateToTicks(Int32 year, Int32 month, Int32 day)  
       at System.DateTime..ctor(Int32 year, Int32 month, Int32 day, Int32 hour, Int32 minute, Int32 second, DateTimeKind kind)  
       at Microsoft.ActiveDirectory.Management.ADTypeConverter.ParseDateTimeValue(String value, ADAttributeSyntax syntax)  
       at Microsoft.ActiveDirectory.Management.ADTypeConverter.ConvertFromRaw(String propertyName, ADPropertyValueCollection propertyValues)  
       at Microsoft.ActiveDirectory.Management.ADObjectSearcher.CreateRichADObject(ADObject resultEntry)  
       at Microsoft.ActiveDirectory.Management.ADObjectSearcher.PagedSearch(Object& pageCookie, Boolean& hasSizeLimitExceeded, Int32 pageSize, Int32 sizeLimit)  
       at Microsoft.ActiveDirectory.Management.ADObjectSearchResultEnumerator.System.Collections.IEnumerator.MoveNext()  
       at Microsoft.ActiveDirectory.Management.ADObjectSearcher.FindOne(Boolean& foundMoreThanOneResult)  
       at Microsoft.ActiveDirectory.Management.Commands.ADFactoryUtil.GetObjectFromIdentitySearcher(ADObjectSearcher searcher, ADEntity identityObj, String searchRoot, AttributeSetRequest attrs, CmdletSessionInfo cmdletSessionInfo, String[]& warningMessages)  
       at Microsoft.ActiveDirectory.Management.Commands.ADFactory`1.GetExtendedObjectFromIdentity(T identityObj, String identityQueryPath, ICollection`1 propertiesToFetch, Boolean showDeleted, Boolean showLinkTtl)  
       at Microsoft.ActiveDirectory.Management.Commands.ADFactory`1.GetExtendedObjectFromIdentity(T identityObj, String identityQueryPath, ICollection`1 propertiesToFetch, Boolean showDeleted)  
       at Microsoft.ActiveDirectory.Management.Commands.ADGetCmdletBase`3.ADGetCmdletBaseProcessCSRoutine()  
       at Microsoft.ActiveDirectory.Management.CmdletSubroutinePipeline.Invoke()  
       at Microsoft.ActiveDirectory.Management.Commands.ADCmdletBase`1.ProcessRecord()  
       at System.Management.Automation.CmdletParameterBinderController.VerifyArgumentsProcessed(ParameterBindingException originalBindingException)  
       at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParametersNoValidation(Collection`1 arguments)  
       at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParameters(Collection`1 arguments)  
       at System.Management.Automation.CommandProcessor.BindCommandLineParameters()  
       at System.Management.Automation.CommandProcessor.Prepare(IDictionary psDefaultParameterValues)  
       at System.Management.Automation.CommandProcessorBase.DoPrepare(IDictionary psDefaultParameterValues)  
       at System.Management.Automation.Internal.PipelineProcessor.Start(Boolean incomingStream)  
       at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input)  
    --- End of stack trace from previous location where exception was thrown ---  
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
       at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input)  
       at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)  
       at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)  
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)  
    

  2. Helmut-72 66 Reputation points
    2022-07-11T08:32:50.883+00:00
    PS C:\Windows\system32> Get-ADUser <IDENTITY> -Properties startDate  
    Get-ADUser : Year, Month, and Day parameters describe an un-representable DateTime.  
    At line:1 char:1  
    + Get-ADUser <IDENTITY> -Properties startDate  
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
        + CategoryInfo          : InvalidArgument: (<IDENTITY>:ADUser) [Get-ADUser], ArgumentOutOfRangeException  
        + FullyQualifiedErrorId : ActiveDirectoryCmdlet:System.ArgumentOutOfRangeException,Microsoft.ActiveDirectory.Manag  
       ement.Commands.GetADUser  
    PS C:\Windows\system32>  
    
    PS C:\Windows\system32> $Error.Exception.StackTrace  
       at System.DateTime.DateToTicks(Int32 year, Int32 month, Int32 day)  
       at System.DateTime..ctor(Int32 year, Int32 month, Int32 day, Int32 hour, Int32 minute, Int32 second, DateTimeKind kind)  
       at Microsoft.ActiveDirectory.Management.ADTypeConverter.ParseDateTimeValue(String value, ADAttributeSyntax syntax)  
       at Microsoft.ActiveDirectory.Management.ADTypeConverter.ConvertFromRaw(String propertyName, ADPropertyValueCollection propertyValues)  
       at Microsoft.ActiveDirectory.Management.ADObjectSearcher.CreateRichADObject(ADObject resultEntry)  
       at Microsoft.ActiveDirectory.Management.ADObjectSearcher.PagedSearch(Object& pageCookie, Boolean& hasSizeLimitExceeded, Int32 pageSize, Int32 sizeLimit)  
       at Microsoft.ActiveDirectory.Management.ADObjectSearchResultEnumerator.System.Collections.IEnumerator.MoveNext()  
       at Microsoft.ActiveDirectory.Management.ADObjectSearcher.FindOne(Boolean& foundMoreThanOneResult)  
       at Microsoft.ActiveDirectory.Management.Commands.ADFactoryUtil.GetObjectFromIdentitySearcher(ADObjectSearcher searcher, ADEntity identityObj, String searchRoot, AttributeSetRequest attrs, CmdletSessionInfo cmdletSessionInfo, String[]& warningMessages)  
       at Microsoft.ActiveDirectory.Management.Commands.ADFactory`1.GetExtendedObjectFromIdentity(T identityObj, String identityQueryPath, ICollection`1 propertiesToFetch, Boolean showDeleted, Boolean showLinkTtl)  
       at Microsoft.ActiveDirectory.Management.Commands.ADFactory`1.GetExtendedObjectFromIdentity(T identityObj, String identityQueryPath, ICollection`1 propertiesToFetch, Boolean showDeleted)  
       at Microsoft.ActiveDirectory.Management.Commands.ADGetCmdletBase`3.ADGetCmdletBaseProcessCSRoutine()  
       at Microsoft.ActiveDirectory.Management.CmdletSubroutinePipeline.Invoke()  
       at Microsoft.ActiveDirectory.Management.Commands.ADCmdletBase`1.ProcessRecord()  
    PS C:\Windows\system32>  
    
    PS C:\Windows\system32> Set-ADUser <IDENTITY> -Replace @{startDate="000711000000Z"}  
    PS C:\Windows\system32> Get-ADUser <IDENTITY> -Properties startDate  
    Get-ADUser : Year, Month, and Day parameters describe an un-representable DateTime.  
    At line:1 char:1  
    + Get-ADUser <IDENTITY> -Properties startDate  
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
        + CategoryInfo          : InvalidArgument: (<IDENTITY>:ADUser) [Get-ADUser], ArgumentOutOfRangeException  
        + FullyQualifiedErrorId : ActiveDirectoryCmdlet:System.ArgumentOutOfRangeException,Microsoft.ActiveDirectory.Manag  
       ement.Commands.GetADUser  
    PS C:\Windows\system32>  
    
    PS C:\Windows\system32> $Error.Exception.StackTrace  
       at System.DateTime.DateToTicks(Int32 year, Int32 month, Int32 day)  
       at System.DateTime..ctor(Int32 year, Int32 month, Int32 day, Int32 hour, Int32 minute, Int32 second, DateTimeKind kind)  
       at Microsoft.ActiveDirectory.Management.ADTypeConverter.ParseDateTimeValue(String value, ADAttributeSyntax syntax)  
       at Microsoft.ActiveDirectory.Management.ADTypeConverter.ConvertFromRaw(String propertyName, ADPropertyValueCollection propertyValues)  
       at Microsoft.ActiveDirectory.Management.ADObjectSearcher.CreateRichADObject(ADObject resultEntry)  
       at Microsoft.ActiveDirectory.Management.ADObjectSearcher.PagedSearch(Object& pageCookie, Boolean& hasSizeLimitExceeded, Int32 pageSize, Int32 sizeLimit)  
       at Microsoft.ActiveDirectory.Management.ADObjectSearchResultEnumerator.System.Collections.IEnumerator.MoveNext()  
       at Microsoft.ActiveDirectory.Management.ADObjectSearcher.FindOne(Boolean& foundMoreThanOneResult)  
       at Microsoft.ActiveDirectory.Management.Commands.ADFactoryUtil.GetObjectFromIdentitySearcher(ADObjectSearcher searcher, ADEntity identityObj, String searchRoot, AttributeSetRequest attrs, CmdletSessionInfo cmdletSessionInfo, String[]& warningMessages)  
       at Microsoft.ActiveDirectory.Management.Commands.ADFactory`1.GetExtendedObjectFromIdentity(T identityObj, String identityQueryPath, ICollection`1 propertiesToFetch, Boolean showDeleted, Boolean showLinkTtl)  
       at Microsoft.ActiveDirectory.Management.Commands.ADFactory`1.GetExtendedObjectFromIdentity(T identityObj, String identityQueryPath, ICollection`1 propertiesToFetch, Boolean showDeleted)  
       at Microsoft.ActiveDirectory.Management.Commands.ADGetCmdletBase`3.ADGetCmdletBaseProcessCSRoutine()  
       at Microsoft.ActiveDirectory.Management.CmdletSubroutinePipeline.Invoke()  
       at Microsoft.ActiveDirectory.Management.Commands.ADCmdletBase`1.ProcessRecord()  
       at Microsoft.ActiveDirectory.Management.AdwsConnection.ThrowExceptionForExtendedError(String extendedErrorMessage, Exception innerException)  
       at Microsoft.ActiveDirectory.Management.AdwsConnection.ThrowExceptionForErrorCode(String message, String errorCode, String extendedErrorMessage, Exception innerException)  
       at Microsoft.ActiveDirectory.Management.AdwsConnection.ThrowExceptionForFaultDetail(FaultDetail faultDetail, FaultException faultException)  
       at Microsoft.ActiveDirectory.Management.AdwsConnection.ThrowException(AdwsFault adwsFault, FaultException faultException)  
       at Microsoft.ActiveDirectory.Management.AdwsConnection.Modify(ADModifyRequest request)  
       at Microsoft.ActiveDirectory.Management.ADWebServiceStoreAccess.Microsoft.ActiveDirectory.Management.IADSyncOperations.Modify(ADSessionHandle handle, ADModifyRequest request)  
       at Microsoft.ActiveDirectory.Management.ADActiveObject.Update()  
       at Microsoft.ActiveDirectory.Management.Commands.ADSetCmdletBase`3.SetFromIdentity(O identity)  
       at Microsoft.ActiveDirectory.Management.Commands.ADSetCmdletBase`3.ADSetCmdletBaseProcessCSRoutine()  
       at Microsoft.ActiveDirectory.Management.CmdletSubroutinePipeline.Invoke()  
       at Microsoft.ActiveDirectory.Management.Commands.ADCmdletBase`1.ProcessRecord()  
       at System.DateTime.DateToTicks(Int32 year, Int32 month, Int32 day)  
       at System.DateTime..ctor(Int32 year, Int32 month, Int32 day, Int32 hour, Int32 minute, Int32 second, DateTimeKind kind)  
       at Microsoft.ActiveDirectory.Management.ADTypeConverter.ParseDateTimeValue(String value, ADAttributeSyntax syntax)  
       at Microsoft.ActiveDirectory.Management.ADTypeConverter.ConvertFromRaw(String propertyName, ADPropertyValueCollection propertyValues)  
       at Microsoft.ActiveDirectory.Management.ADObjectSearcher.CreateRichADObject(ADObject resultEntry)  
       at Microsoft.ActiveDirectory.Management.ADObjectSearcher.PagedSearch(Object& pageCookie, Boolean& hasSizeLimitExceeded, Int32 pageSize, Int32 sizeLimit)  
       at Microsoft.ActiveDirectory.Management.ADObjectSearchResultEnumerator.System.Collections.IEnumerator.MoveNext()  
       at Microsoft.ActiveDirectory.Management.ADObjectSearcher.FindOne(Boolean& foundMoreThanOneResult)  
       at Microsoft.ActiveDirectory.Management.Commands.ADFactoryUtil.GetObjectFromIdentitySearcher(ADObjectSearcher searcher, ADEntity identityObj, String searchRoot, AttributeSetRequest attrs, CmdletSessionInfo cmdletSessionInfo, String[]& warningMessages)  
       at Microsoft.ActiveDirectory.Management.Commands.ADFactory`1.GetExtendedObjectFromIdentity(T identityObj, String identityQueryPath, ICollection`1 propertiesToFetch, Boolean showDeleted, Boolean showLinkTtl)  
       at Microsoft.ActiveDirectory.Management.Commands.ADFactory`1.GetExtendedObjectFromIdentity(T identityObj, String identityQueryPath, ICollection`1 propertiesToFetch, Boolean showDeleted)  
       at Microsoft.ActiveDirectory.Management.Commands.ADGetCmdletBase`3.ADGetCmdletBaseProcessCSRoutine()  
       at Microsoft.ActiveDirectory.Management.CmdletSubroutinePipeline.Invoke()  
       at Microsoft.ActiveDirectory.Management.Commands.ADCmdletBase`1.ProcessRecord()  
    PS C:\Windows\system32>  
    
    0 comments No comments

  3. Helmut-72 66 Reputation points
    2022-07-11T11:35:53.237+00:00

    A big shout out to everyone who helped to sort this one out, very much appreciated!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.