I am planning on using psexec command to start .ps1 script that i created and copied on to the remote server using copy-item powershell. The question i have is the copy-item command works great if i want to copy the item to one server but if i want to copy to multiple servers items that i wrote down in .txt file which command or switch do i run? Here is the command i am using right now.
copy-item -path "local server" where it is stored -destination '\\servername\c$"
I am able to copy the .ps1 script i want but when i run the psexec it doesn't run the script. It does get authenticated to the server and says cmd.exe has started but i don't see anything running on the server. Any help would be appericated.
psexec.exe \\Destination server name or IP -u \domain\username -u password -i -d cmd \c '\\ Destination server IP\the path.ps1"
The script says following
The system can not find the file specified.
Conntecting to server ip stating psexecsvc on server ip connecting with psexec service on server ip and starting cmd on server IP
cmd started on sever ip with process ID 1764.