Skip to content

peterM/WinRM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Windows Remote Management (WinRM)

To enable WinRM use:

winrm quickconfig

To crreate WinRM session

At first you need create credential object

$password = ConvertTo-SecureString "{your password}" -AsPlainText -Force

Once you have password you can create credential:

$cred= New-Object System.Management.Automation.PSCredential ("domain\username", $password )

Once you have credential object you can create WinRM session:

$session = New-PSSession –ComputerName {Computer-name} –Credential $cred

Once you have created WinRM session you can enter it

Enter-PSSession $session Enter-PSSession –ComputerName {Computer-name} –Credential $cred

Once you enter WinRm session you can write commands like:

  • get windows service: Get-Service
  • get windows service with specific name: Get-Service -DisplayName "Windows Management Instrumentation"
  • get windows service and restart it: Get-Service -DisplayName "Windows Management Instrumentation" -computername | Restart-Service

To close session you can use:

Exit-PSSession

Or if you want to get session and close them all

Get-PSSession | Remove-PSSession

When we searching in name or display name we can use wildcards like *

..... -DisplayName "Windows*"

Releases

No releases published

Packages

No packages published
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy