Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

4
Issue with filter parameters
Post Body

Hi. I can see where I am having an issue here. I am trying to search for computers that havent been used in the last year, and have a name beginning with "TGNX" or "TGDX". Extremely easy using a wildcard, except we have a type named "TGIX" that I do not want included in the results. So I created my query as shown, but it seems like it is querying "not used in last 12 months and called TGNX" OR "called TGDX" and therefore giving TGDX results INCLUDING those used in the last year. I can see why, and i'm sure its down to brackets but i'm getting nowhere.

$then = (Get-Date).AddDays(-365) # The 365 is the number of days from today since the last logon.

Get-ADComputer -Property Name,lastLogonDate -Filter {lastLogonDate -lt $then -and Name -like 'TGDX*' -or Name -like 'TGNX*' } | FT Name,lastLogonDate | Out-File -FilePath C:\What_I_Found.txt

Author
Account Strength
80%
Account Age
7 years
Verified Email
Yes
Verified Flair
No
Total Karma
296
Link Karma
233
Comment Karma
63
Profile updated: 6 hours ago
Posts updated: 1 month ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
4 years ago