Using results of one script in another script

Apr 22, 2009 at 9:00 AM
Hi all,

Thanks for the great work you guys are doing making these scripts available to all of us and I have found great use for the Check-SharePoint-Orphaned-Users.ps1 script. I now have a list of 800+ unique records for orpahns accross 34 site collections. Now
I just need to ask how would pipe this text file to the Check-Delete-SharePoint-Users.ps1 script? I also don't need to make use of the $usertoreplaceinsiteadmin variable.

Thanking you in advance
Apr 22, 2009 at 10:25 AM
Hi All,

I've actually been able to answer my own question.

What I did is included the txt file into the StartProcess funtion in the foreach ($userlogintodelete in get-content C:\SPScripts\userstodelete.txt) line.
I also made a change with regards the writing of the output and viola! It works like a treat.

Thanks again for making these very powerful scripts available.
Coordinator
May 5, 2009 at 10:33 AM
Hi,
Thanks for your congrats.
So the reason i do not that pipe between the listing (orphaned) and delete scripts is because, in some case you can have positive false value.
For example, when you have permission given to local machine account or local machine groups, you will find these account in the listing but they exist in the local machine.

So I prefere to create the file and after quick check I paste the user in the second script.

Have a good day
Fabrice Romelard [[MVP]]