Ok, for starters, can you tell me if what I’m trying to do makes any sense? I have a request from one of our sites. They were relaying smtp email off our Exchange server. They now have a new SMTP server and they think they’ve pointed every device to the new SMTP server. But, they wanted me to check to make sure they didn’t miss any devices. So, I did some research and the directories in the attached image is where I think I should find the IP addresses. I did have the script working once. Be honest, I don’t know what changed to where it is throwing all the errors now. All I did was open one of the text files in one of the directories and found an IP address that I knew for sure was there, so, if my script was working correctly, it should find it, verifying the logic at least works. But now the script is throwing errors and I’m not sure why.
I’m not sure why it’s only hitting the first get-childitem and then skips to the next server in the array and only checks the first get-childitem again.