When I run the cmdlet Get-CMDistributionPointInfo | select ServerName to get a list of SCCM distribution points (DPs) by itself, I will get the following results example:
When I run the for loop below, I can do a write-host and it will list the DPs, but it does so several times for each DP result, so obviously the code is not correct. Also, if I do a write-host in that for loop, it will show the server name, but if I do a message box, it will not show one server after the next.
Ultimately, what I am trying to do is after it gets each DP server, to then create a directory on a specific drive on that server. That part I can handle, but I am having issues with the for loop just displaying the server in a message box and then the next one and then so on.