1

I am trying to take backup of my server from client machine using powershell.

i am trying to execute a batch file which is on my server, but i am not able to make connection with my server. I searched a lot and tried

Test-WSMan : The WinRM client cannot process the request. If the authentication scheme is different from Kerberos, or i
f the client computer is not joined to a domain, then HTTPS transport must be used or the destination machine must be a
dded to the TrustedHosts configuration setting. Use winrm.cmd to configure TrustedHosts. Note that computers in the Tru
stedHosts list might not be authenticated. You can get more information about that by running the following command: wi
nrm help config.
At line:1 char:11
+ Test-WsMan <<<<  182.50.121.100 -credential $cred -authentication default
    + CategoryInfo          : InvalidOperation: (182.50.121.100:String) [Test-WSMan], InvalidOperationException
    + FullyQualifiedErrorId : WsManError,Microsoft.WSMan.Management.TestWSManCommand

can any one tell me how can i execute the bat file step by step

rajansoft1
  • 1,336
  • 2
  • 18
  • 38

1 Answers1

2

Have you added your host name or IP in "GPEDIT" i.e.Group Policy and enabled to use fresh credentials?

Please follow the step if you might have missed something.

(http://www.ifunky.net/Blog/post/How-To-Enable-PowerShell-Remoting-(WinRM).aspx ,

http://blog.crayon.no/blogs/janegil/archive/2010/03/04/enable_2D00_and_2D00_configure_2D00_windows_2D00_powershell_2D00_remoting_2D00_using_2D00_group_2D00_policy.aspx)

They have enough information to get started. Sometimes if everything is enabled its a best idea to restart remote management services.

Bravo11
  • 898
  • 2
  • 11
  • 24
  • Hey, Thanks for the help. have to run these script on server or client machine – rajansoft1 Jul 08 '13 at 09:03
  • Basically you need to run these scripts in both machines but if you see some where written as server you need to type client in client machine and that should work. I do this configuration most of the time. – Bravo11 Jul 08 '13 at 09:06
  • the script from link 1 is showing this error Enable-WSManCredSSP : Cannot bind parameter because parameter 'force' is specified more than once. To provide multiple values to parameters that can accept multiple values, use the array syntax. For example, "-parameter value1,value2,valu e3". At line:1 char:47 + Enable-WSManCredSSP -force -role server -force <<<< + CategoryInfo : InvalidArgument: (:) [Enable-WSManCredSSP], ParameterBindingException + FullyQualifiedErrorId : ParameterAlreadyBound,Microsoft.WSMan.Management.EnableWSManCredSSPCommand – rajansoft1 Jul 08 '13 at 09:14
  • Hi @Bravo i have executed the script successfully and now when i am trying to connect to server i am getting this error – rajansoft1 Jul 08 '13 at 09:21
  • Test-WSMan : The client cannot connect to the destination specified in the request. Verify that the service on the dest ination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on t he destination to analyze and configure the WinRM service: "winrm quickconfig". – rajansoft1 Jul 08 '13 at 09:22
  • I believe its asking you too add your ip in remote server group policy and remote server ip in your machine. Go to Start Menu and type gpedit.msc this will open your group policy. Click on Administrative Templates and expand it to find System, click on that and find credentials delegation. Double click on allow delegating default credentials and fresh credentials and enable both of them abd find where its written add servers to the list. click on show and make sure if can find your server ip and vice versa. the list should look like: WSMAN\ – Bravo11 Jul 08 '13 at 09:29
  • is their any way i can login through command line and not by popup? – rajansoft1 Jul 08 '13 at 09:50
  • i guess this is what you are trying to do ($remoteSession = OpenRemoteSession $remoteComputer $userName $password) – Bravo11 Jul 08 '13 at 09:59