Well i am planning to do that but first i have to change the App Pool.
Then i will use the loop to set the ID's.

But i can't manage it ... i couldn't figure out what is the code for updating the attributes of the sites and applications.

Thank you for the help. It's much appreciated.