Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Pulling date from an object

$
0
0

So we have an OU we we put deleted users and in the description we put something like

 

as per request blah, to be deleted on 05/14/2016 by system

 

So, I'm struggling with just pulling this part of the description in AD object get-aduser

 

So here is what I have so far

 

$users = get-aduser -searchbase "ou=blah,dc=blah,dc=com" -filter '*"

$users | select -first 1 | select name,@{n='description';e={($_.description -match '\d{1,2}\/\d{1,2}\/\d{4}')}} | ft -autosize

But i'm having problems understanding how to get matches[0] out of this select statement
Can someone point me in the correct direction?
Please don't give me the answer, but lead me down the thinking path...
Thanks

Viewing all articles
Browse latest Browse all 6937

Trending Articles