PowerShell Scripts, Tips, Expert Advices, Forums, and Resources

image rotation

Welcome to PowerShell.com, the educational and community site for Windows PowerShell People. Get a quick overview.

Latest Scripts

10-19-2014 - Get-RawPEHeader
10-16-2014 - Get-CPUInfo
10-16-2014 - Get-MemoryStatus

Latest Announcements/Events

10-15-2014 - Class Dismissed
10-12-2014 - The Case for PowerShell
09-26-2014 - PowerShell Magazine completes 3 years!

As a Powershell.com member you will have access to:

  • Daily PowerShell tips written by Microsoft MVPs and other leading Windows PowerShell experts
  • Free Windows PowerShell advice and training provided by Microsoft MVPs and other leading Windows PowerShell experts
  • Access to leading Windows PowerShell blogs
  • A free ebook, Mastering PowerShell, written by Microsoft MVP Dr. Tobias Weltner
PowerTip of the Day

Enabling and Disabling PowerShell Remoting

PowerShell 3 and later

If you want to access a computer remotely via PowerShell, then on the destination side (on the computer you want to visit), run this line of code with Administrator privileges:

 
PS> Enable-PSRemoting -SkipNetworkProfileCheck -Force  
   

Once you did, you can now visit this computer from another box – provided you have local Administrator privileges on the target machine, you do specify the computer name and not its IP address, and both computers are joined in the same domain.

To connect interactively, use this line:

 
PS> Enter-PSSession -ComputerName targetComputerName 
 

To run code remotely, try this:

 
PS> Invoke-Command -ScriptBlock { Get-Service } -ComputerName targetComputerName 
 

Twitter This Tip! ReTweet this Tip!

Copyright 2012 PowerShell.com. All rights reserved.