Skip to content

Commit 0e5b360

Browse files
Search-ADAccount.md - TimeSpan parameter - Undocumented Behaviour
Previously undocumented behaviour/interaction with *ms-DS-Logon-Time-Sync-Interval* Usage of *AccountInactive* & *TimeSpan* has the undocumented behaviour of incorporating the *ms-DS-Logon-Time-Sync-Interval* attribute value interval [seen with the default 14 days] Likely would've similar impacts on *DateTime* parameter - but didn't've opportunity to confirm
1 parent cb7bc58 commit 0e5b360

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

docset/winserver2019-ps/activedirectory/Search-ADAccount.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,26 @@ For example, to search for all accounts that are expiring in 10 days, specify th
543543

544544
`-AccountExpiring -TimeSpan "10.00:00.00"`
545545

546+
Note that this parameter is aware of the [*ms-DS-Logon-Time-Sync-Interval*](https://learn.microsoft.com/en-us/windows/win32/adschema/a-msds-logontimesyncinterval) attribute when using with the *AccountInactive* parameter - it will try to correct for the upper range of this selection
547+
548+
For example, with *ms-DS-Logon-Time-Sync-Interval* at the default of 14 days, we have the following situation:
549+
550+
```
551+
User last logged on with timestamps:
552+
lastLogon = 23/05/2024
553+
lastLogonTimestamp = 13/05/2024
554+
555+
At date: 19/06/2024
556+
-TimeSpan 22 = will return it: 22+14 days ago was 14/05/2024
557+
-TimeSpan 23 = will not return it: 23+14 days ago was 13/05/2024
558+
-TimeSpan 24 = will not return it: 24+14 days ago was 12/05/2024
559+
560+
At date: 20/06/2024
561+
-TimeSpan 22 = will return it: 22+14 days ago was 15/05/2024
562+
-TimeSpan 23 = will return it: 23+14 days ago was 14/05/2024
563+
-TimeSpan 24 = will not return it: 24+14 days ago was 13/05/2024
564+
```
565+
546566
```yaml
547567
Type: TimeSpan
548568
Parameter Sets: AccountExpiring, AccountInactive

0 commit comments

Comments
 (0)