Powershell: Difference between revisions

From bibbleWiki
Jump to navigation Jump to search
Line 2: Line 2:


Configure one time only
Configure one time only
First change your network to private using powershell as admin
$networkListManager = [Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]"{DCB00C01-570F-4A9B-8D69-199FDBA5723B}"))
$connections = $networkListManager.GetNetworkConnections()
$connections | % {$_.GetNetwork().SetCategory(1)}
Then quick configuration in dos
  Winrm quickconfig
  Winrm quickconfig



Revision as of 21:44, 15 April 2018

Entering a powershell command prompt remotely

Configure one time only

First change your network to private using powershell as admin

$networkListManager = [Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]"{DCB00C01-570F-4A9B-8D69-199FDBA5723B}")) 
$connections = $networkListManager.GetNetworkConnections()
$connections | % {$_.GetNetwork().SetCategory(1)}

Then quick configuration in dos

Winrm quickconfig
Set-Item WSMan:\localhost\Client\TrustedHosts –Value <ipAddress>

Then for non joined

Enter-PSSession -ComputerName <IP> -Credential <Machine Name>\<username>

or for AD Joined

Could not find a way to do this so ended up creating a user and adding it to the local users and group using lusmgr.msc and under groups adding the user to Remote Management User