Time Span

I’ve been using Search-ADaccount a lot recently. One of the options is to input a timespan to determine for far back in time to search e.g. for accounts that have been inactive for 90 days

The cmdlet takes a string that can be turned into a timespan.  if you look at the documentation the data type is a Timespan.

To search for accounts that have been inactive for 90 days

Search-ADaccount –AccountInactive –TimeSpan “90:00:00:00”

Alternatively, if you can’t remember the timespan structure

Search-ADaccount –AccountInactive –TimeSpan  (New-TimeSpan -Days 90  )

Advertisements
This entry was posted in PowerShell and Active Directory. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s