0% found this document useful (0 votes)
111 views2 pages

Remote Server Session & DC Diagnostics

The document provides commands and steps to troubleshoot issues with remote sessions, Active Directory replication, port connections, and DNS on domain controllers. It includes commands like qwinsta, reset session, dcdiag, repadmin, netstat, and nltest. Specific issues covered include idle sessions, replication errors, port checking, and DNS troubleshooting.

Uploaded by

Abhijeet Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
111 views2 pages

Remote Server Session & DC Diagnostics

The document provides commands and steps to troubleshoot issues with remote sessions, Active Directory replication, port connections, and DNS on domain controllers. It includes commands like qwinsta, reset session, dcdiag, repadmin, netstat, and nltest. Specific issues covered include idle sessions, replication errors, port checking, and DNS troubleshooting.

Uploaded by

Abhijeet Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

For disconnect idle session in remote server

qwinsta /server:yourservername

To know the session :

query session /server:<ServerName>

To disconnect the session, type:

reset session <SessionID> /server:<ServerName>

*********************************************

dcdiag.exe /a /c /v /f:�C:\Documents and


Settings\Administrator\Desktop\HOSVRDC01_dcdiaglog.txt�

Get-ADReplicationFailure -Target brookstreet.co.uk -Scope Domain

repadmin /showrepl <Server name>


REPADMIN /REPLSUM
REPADMIN /SHOWREPL
REPADMIN /SHOWREPS
REPADMIN /SYNCALL

For errors related to replication : Event ID 2042 | 8614

>repadmin /removelingeringobjects
>repadmin /removelingeringobjects <DestDCName> <SourceDCGUID> <LDAPPartition>
/advisory_mode

********************************************

Port connection check

>>test-netconnection -computername LMTSVR -port 138

>>Netstat �an �b | find /I ��Listening� > C:\Documents and


Settings\Administrator\Desktop\DCPorts.txt

_________________________________________________
Script in case nothing is working :

$ipaddress = "10.10.252.1"
$port = 137
$connection = New-Object System.Net.Sockets.TcpClient($ipaddress, $port)
if ($connection.Connected) {
Write-Host "Success"
}
else {
Write-Host "Failed"
}

__________________________________________________
Also can use telnet

>>telnet <server name> 135


______________________________________________________
Here is the easy solution of specific port finding...

In cmd:

netstat -na | find "8080"


In bash:

netstat -na | grep "8080"


In PowerShell:

netstat -na | Select-String "8080"

**************************************************

Command to retrieve DCDIAG report for other DC

dcdiag /s:HOSVRDC02.brookstreet.co.uk /f:c:\temp\dcdiag_HOSVRDC02.txt

OR USE

dcdiag /s:HOSVRDC02.brookstreet.co.uk /f:"C:\Documents and


Settings\da_kum\Desktop\dcdiag_HOSVRDC02.txt"

*************************************************
Command to retrieve DCDIAG report for same DC

dcdiag.exe /a /c /v /f:�C:\Documents and


Settings\Administrator\Desktop\HOSVRDC01_dcdiaglog.txt�

************************************************

DNS Troubleshoot

>>DCDIAG /TEST:DNS /V /E /F:<filename.log>

>>NLTEST /DSGETDC:<netbios or DNS domain name>

Nltest /dsgetdc: is used to exercise the dc locator process. Thus /dsgetdc:< domain
name > tries to find the domain controller for the domain. Using the force flag
forces domain controller location rather than using the cache. You can also specify
options such as /gc or /pdc to locate a Global Catalog or a primary domain
controller emulator. For finding the Global Catalog, you must specify a "tree
name," which is the DNS domain name of the root domain.

You might also like