Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2562

Powershell oh so newb

$
0
0

Ok, so trying to learn a little PS, I can get this to work in our environment:

restart-computer -computername CXXXX-X -credential CXXXX-X\username

The computer itself is not on domain but WG-CXXXX

What I eventually want to be able to do is set date\time\timezone on the remote computer.

I tried the set-date '12:00:00 PM' on my local machine and can set just the time by doing this.

I tried the set-date '12:00:00 PM' -computername CXXXX-X -credential CXXXX-X\username

Get error: Set-Date : A parameter cannot be found that matches parameter name 'computername'. I think the set-date cmdlet cannot be use remotely by itself.

I have tried using invoke-command for remote, but obviously I am missing the boat.

invoke-command -computername CXXXX-X -credential CXXXX-X\username -command { set-date '12:00:00 PM'}

This is the error I get :  Connecting to remote server failed with the following error message : WinRM cannot process the request. The following error occured while using Kerberos authentication: There are currently no logon servers available to service the logon request. 

Am I at all close? Enventually I want to script this so the user just puts in the computer name, date, time, timezone. I know I could write a .bat file to do this, but work wants us to start learning to PowerShell.


Viewing all articles
Browse latest Browse all 2562

Trending Articles