Actually you don’t need a loop. Invoke-Command can take an array of computer names. ![]()
Regardless of that … since $DCs is still an array of objects and not strings you should use $DCs.Name to specifically access the name property of the object.
Actually you don’t need a loop. Invoke-Command can take an array of computer names. ![]()
Regardless of that … since $DCs is still an array of objects and not strings you should use $DCs.Name to specifically access the name property of the object.