Windows 10: Execute Powershell command on remote computer

Discus and support Execute Powershell command on remote computer in Windows 10 Network and Sharing to solve the problem; Hello, I would like to execute a PowerShell command on a remote computer. The command is the following: Invoke-Command -ComputerName 10.40.27.174... Discussion in 'Windows 10 Network and Sharing' started by CedricZT, Jul 19, 2018.

  1. CedricZT Win User

    Execute Powershell command on remote computer


    Hello, I would like to execute a PowerShell command on a remote computer. The command is the following:


    Invoke-Command -ComputerName 10.40.27.174 -ScriptBlock { Get-ChildItem C:\ } -credential User


    I get the following error:


    [10.40.27.174] La connexion au serveur distant 10.40.27.174 a échoué avec le message d’erreur suivant: Accès refusé.
    Pour plus d'informations, voir la rubrique d'aide about_Remote_Troubleshooting.
    + CategoryInfo : OpenError: (10.40.27.174:String) [], PSRemotingTransportException
    + FullyQualifiedErrorId : AccessDenied,PSSessionStateBroken


    So in English: "The connexion to the remote server 10.40.27.174 failed with the error message: Access denied."


    Here is what I did: I have two computer with Windows 10 Home Edition. I start PowerShell admin on both computer.


    On both Computer I have executed:


    Set-Item wsman:\localhost\client\trustedhosts *


    and then


    Restart-Service WinRM

    I have seen that there are groups. So I also did:

    net localgroup "Remote Desktop Users" "Elève" /add

    I logged off and on and after


    PS C:\windows\system32> Get-LocalGroupMember

    applet de commande Get-LocalGroupMember à la position 1 du pipeline de la commande
    Fournissez des valeurs pour les paramètres suivants :
    Name: Remote Desktop Users

    ObjectClass Name PrincipalSource
    ----------- ---- ---------------
    Utilisateur LAPTOP-U0369JC1\Elève Local


    On the remote Computer the account is: Elève and there is no password. So When I

    have to entered the password I simply press "Enter". I know it's bad for the security, but

    it's for a small school.

    Do you have an idea what's wrong ? Thank you!

    :)
     
    CedricZT, Jul 19, 2018
    #1
  2. Kursah Win User

    PowerShell instead of Commandline in Creators Update

    Interestingly enough my personal laptop just got the update...and still has Command Prompt listed, not PowerShell...

    Edit: Not that it matters...I use both regularly. *Toast :toast:
     
    Kursah, Jul 19, 2018
    #2
  3. A123 Win User
    I accidently executed incorrect command >> in Powershell in Windows 10

    I copied a command line from Notepad and I accidentally copied the command line plus a space or two and an Enter key into Powershell with Admin. In Powershell, the command line was followed by a >>. I pressed the Enter key and the command executed.
    Does >> do anything in Powershell?
     
  4. A123 Win User

    Execute Powershell command on remote computer

    I accidently executed incorrect command >> in Powershell in Windows 10

    When I executed the command, I believe I saw a green window with some text flash by. Windows seems to be working okay. I believe the command line was the following with a space or two and >>

    Add-AppxPackage -register "C:\Program Files\WindowsApps\Microsoft.WindowsStore_2015.25.15.0_x64__8wekyb3d8bbwe\AppxManifest.xml" –DisableDevelopmentMode

    I do not know what >> is in Powershell. Does >> append to an existing file like in DOS and if so what existing file if one is not listed?
     
Thema:

Execute Powershell command on remote computer

Loading...
  1. Execute Powershell command on remote computer - Similar Threads - Execute Powershell command

  2. Powershell command

    in Windows 10 Customization
    Powershell command: Hi How can i get a list via powershell commandof expired users password in AD like this screenshot.Thanks https://answers.microsoft.com/en-us/windows/forum/all/powershell-command/54833831-89ba-4641-a5b2-2d55e848aab8
  3. Powershell command

    in Windows 10 Gaming
    Powershell command: Hi How can i get a list via powershell commandof expired users password in AD like this screenshot.Thanks https://answers.microsoft.com/en-us/windows/forum/all/powershell-command/54833831-89ba-4641-a5b2-2d55e848aab8
  4. Most windows executable commands not recognized by CMD and PowerShell.

    in Windows 10 Gaming
    Most windows executable commands not recognized by CMD and PowerShell.: Out of nowhere commands which involve executables like explorer.exe, msedge.exe, mspaint.exe, where, etc. are not working in command prompt or PowerShell. The output of the command prompt seem to be quite simple: ```C:\Users\grass>where 'where' is not recognized as an...
  5. Most windows executable commands not recognized by CMD and PowerShell.

    in Windows 10 Software and Apps
    Most windows executable commands not recognized by CMD and PowerShell.: Out of nowhere commands which involve executables like explorer.exe, msedge.exe, mspaint.exe, where, etc. are not working in command prompt or PowerShell. The output of the command prompt seem to be quite simple: ```C:\Users\grass>where 'where' is not recognized as an...
  6. Execution Policy in Powershell

    in AntiVirus, Firewalls and System Security
    Execution Policy in Powershell: Hello,For Execution Policy for PowerShell, mine was set to unrestricted, which I changed to restricted, assuming it will make my PC more secure.I tried to learn about this, but I didnt understand whether restricted is the best and the most secure option for someone who uses...
  7. Powershell reopens in new window on executing a command.

    in Windows 10 Ask Insider
    Powershell reopens in new window on executing a command.: Whenever I execute the command "npm", the current powershell window closes and a new one reopens with "npm" in its title bar as long as the process initiated by the command is in execution. This annoys me a lot coz this isn't the case with just npm but every other command...
  8. Enable Remote Desktop using Command Prompt or PowerShell

    in Windows 10 News
    Enable Remote Desktop using Command Prompt or PowerShell: [ATTACH] [ATTACH]If you want to use the Remote Desktop feature without opening the Windows Settings panel, then you can enable Remote Desktop using Command Prompt or Windows PowerShell. If you have a remote desktop client on your mobile or another computer, [...] This post...
  9. Intruder Alert!!? Executing remote command...

    in AntiVirus, Firewalls and System Security
    Intruder Alert!!? Executing remote command...: IS this what i think it is?[ATTACH] https://answers.microsoft.com/en-us/windows/forum/all/intruder-alert-executing-remote-command/c276edb8-fb9b-4f2c-8651-45719c699fa7"
  10. 10 CMD commands that can be executed with PowerShell

    in Windows 10 News
    10 CMD commands that can be executed with PowerShell: [ATTACH] PowerShell is Microsoft’s own alternative to their own Command Prompt. Earlier, Microsoft announced that they will be open sourcing PowerShell and will be bringing it to recent versions and different Linux flavors like Ubuntu, CentOS, Red Hat Enterprise Linux,...

Users found this page by searching for:

  1. powershell command execute by net command

    ,
  2. powershell remote windows update access denied

    ,
  3. powersehll how can i execute net user as remote command

    ,
  4. execute powershell script on windows phone