![]() $sCmd = 'netsh int ipv4 show dynamicportrange tcp' $oOutput = Invoke-Expression -Command 'netsh int ipv4 show dynamicportrange tcp' $sPsCmd = ".\psexec \\$Computer /AcceptEula $Command" Write-Warning 'Credentials sent in clear text to the remote computer using PsExec! Prevent this by not providing credentials to this script and logging in with a domain account with admin privileges to the remote computer or by using network encryption such as IPSec.' $global:Password = $global:oCredential.GetNetworkCredential().Password #// Executes PsExec to get data from remote computers. $global:oCredential = Get-Credential -Credential $global:User $global:oCredential = New-Object ($global:User,$global:Password) $global:Password = ConvertTo-SecureString -AsPlainText -Force -String $global:Password $global:aComputers = If credentials are passed into this script, then make them secure. $global:aComputers = $global:Computers.Split(' ') #// Processes the arguments passed into the script such as getting the appropriate credentials if specified. Netsh trace start capture=yes tracefile=$env:WINDIR\Tools\NetTrace_DO_NOT_COPY_YET.etl maxsize=1024 filemode=circular overwrite=yes persistent=yes #// Stop any network traces already running #// Remove all of the jobs that might be running previously to this session. ![]() $global:CollectionInterval = $CollectionInterval Param($Computers="$env:computername",$User='',$Password='',$CollectionInterval=5,$OutputFilePath='.\EphemeralPortStats.log') I have found Log-EphemeralPortStats script from site.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |