Assistance with PowerShell Scripting - Windows Scheduled Tasks
I am trying to get PowerShell to run a Scheduled Task if it exists, or create a scheduled task if it doesn't. I have verified the locations of the files and that the computer names are online and reachable (I have one here at my desk as a test). The script looks like it runs, and I don't get any errors, but the task isn't created on the remote machine like it should be.
Did I miss something simple? Or is my code just wrong. I am still trying to learn PowerShell, so either scenario is very possible.
Connecting to remote server ******* failed with the following error message : The WinRM client cannot process the request because the server name cannot be resolved. For more information, see the about_Remote_Troubleshooting Help topic. + CategoryInfo : OpenError: (*******:String) [], PSRemotingTransportException + FullyQualifiedErrorId : ComputerNotFound,PSSessionStateBroken
This gives me an error after I type in my credentials. I tried username@domain and domain\username formats. I also restarted the WinRM service on the remote machine.
Thanks for the help. Part of the error was due to a proxy setting. If I would've looked further down the page I originally found the DNS Test Code I would've seen that as well.
Open in new window
This gives me an error after I type in my credentials. I tried username@domain and domain\username formats. I also restarted the WinRM service on the remote machine.