About Me

My photo
Bergen, Norway
19th times Microsoft MVP (Security and Windows). IT-Dude @SpareBankenNorge

Friday, April 17, 2020

Cheat for PowerShell connecting to remote machine

Yes I know, it's quite easy to connect against a remote machine to run PowerShell. But I am not doing it on a regular basis so I always forget:

Enter-PSSession -ComputerName COMPUTER -Credential USER


So to make my life easier I have created a really easy script with a shortcut on my desktop, that just ask for remote computer name and my password.

Script:
$RemoteMachine = Read-Host -Prompt "Input name of remote machine"
Powershell -noexit Enter-PSSession -ComputerName $RemoteMachine -Credential AdminMan

You can find a nice guide on "How-To Geek":
How to Run PowerShell Commands on Remote Computers

Or read more on Enter-PSSession on Microsoft Docs

Cleaning Up Unknown IAM Assignments Across Azure Subscriptions

  If you manage more than a handful of Azure subscriptions, IAM hygiene quickly becomes one of those tasks everyone knows is important, but ...