PowerShell Script that References CSV User list and checks for domain memebership and Exports results to csv
Posted on 2009-06-29
Hey guys I have another challenge...
we have a csv list of user accounts from a directory list of roaming profile folders. We want to delete some of the folders but our management wants confirmation that there aren't Active Directory accounts associated with the folders.
Is there a way to script PowerShell to look at a csv (that has a list of names of old roaming profile folders) file, query AD if each item in the list is a user account, and if the item in the first csv is not an AD user account, then write to a second csv?
We can then take the second csv and delete the orphan roaming profile folders on our file server.
Thanks for your help...