My current issue is that i am trying to find all expired accounts under my OU in Active Directory. The current script i have runs great but i dont know how to be more specific or to get the results to Output to a file such as an excel document.
Current Script:
Search-ADAccount -AccountExpired
That runs and finds all users. I have other options the script i tried running is:
Search-ADAccount -AccountExpired -SearchBase"OU=(My OU),DC=(My Domain),DC=(local)" -SearchScope SubTree
That Script will not run the same as the first one. It results in a >> Prompt i was unsure what the "local" part was and left it as is. So my question is can anyone provide me with the script i'm looking for?