Thursday, October 1, 2020

Find out which application is running on a specific port, using PowerShell?

Find out which application is running on a specific port, using PowerShell? 

let's take an example of port 4020. 

run the below PowerShell cmdlet. 

Get-NetTCPConnection | ?{$_.localport -eq 4020} | fl

 

Copy the PID. 

Run the below cmdlet. 

Get-Process -PID 2292 | fl

 

 The process name found on this is msvsmon.

 

Saturday, September 12, 2020

How to clear a AD attribute using powershell?

set-aduser -identity <User.Name> -clear <ADattributeName> 

In this example I am trying to clear the target address value of a AD user. 

set-aduser -identity <User.Name> -clear targetaddress 

this will change the targetaddress AD attribute of the user to <not set>