===== Windows CMD misc =====
Test ping using PowerShell
PS C:\Users\tsminst1> Test-NetConnection srvgit01
ComputerName : srvgit01
RemoteAddress : 10.123.123.242
InterfaceAlias : myserver
SourceAddress : 10.123.123.106
PingSucceeded : True
PingReplyDetails (RTT) : 0 ms
Test a specific port on target server
PS C:\Users\tsminst1> Test-NetConnection srvgit01 -port 1581
ComputerName : srvgit01
RemoteAddress : 10.123.123.242
RemotePort : 1581
InterfaceAlias : myserver
SourceAddress : 10.123.123.106
TcpTestSucceeded : True
==== Uptime ====
C:\Users\sys> net statistics server
Server Statistics for \\APP-SYSMG2-VMH
Statistics since 29/10/2017 06:39:49 AM
Sessions accepted 1
Sessions timed-out 0
Sessions errored-out 0
Kilobytes sent 10
Kilobytes received 0
===== Windows 8 or 8.1 start Menu =====
Install a free plugin: **Windows classic shell**
==== Windows tools ====
Tool to find biggest files and folder on a drive: **Windirstat**
==== Windows 7 / 8 disable update to windows 10 ====
https://gist.github.com/xvitaly/eafa75ed2cb79b3bd4e9#file-remove_crw-cmd\\
http://korben.info/desactiver-mise-a-jour-windows-10.html
===== Windows reset administrator password (lost password) =====
==== Reset admin password from another admin account ====
--> cmd (as administrator) --> compmgmt.msc
Double-click the Users folder. On the right, in the list of local users, right-click the account name for the Administrator account, and select Set Password.
==== Reset admin password ====
To reset the password on Windows server, simply complete the following steps:
* Boot from the Micrsoft Windows DVD
* From the Windows Setup menu, click “Next”.
* Select “Repair your computer”
* Under Choose and option, click on “Troubleshoot”.
* Under Advanced options, click “Command Prompt”.
* At the command prompt, run the following commands:
d:
cd windows\system32
ren Utilman.exe Utilman.exe.old
copy cmd.exe Utilman.exe
* Close the command prompt and then click “Continue”.
The server should now boot and present the logon screen.
* Here click Windows Key + U.
At the prompt you can now change the password, by typing the following command:
net user administrator Password123
This will set the password for the Administrator user to be Password123 (case sensitive).
Closing the command prompt, you should now be able to log back onto the server using the password you have provided in the last step.
==== Check a domain user properties ====
With a PC in a Windows Domain, you can use the following command to retrieve the settings of a user:
C:\>net user techblogger /dom.blogger
User name techblogger
Full Name
Comment
User's comment
Country code 000 (System Default)
Account active Yes
Account expires Never
Password last set 4/21/2011 10:10 PM
Password expires 8/19/2011 10:10 PM
Password changeable 4/21/2011 10:10 PM
Password required Yes
User may change password Yes
Workstations allowed All
Logon script
User profile
Home directory
Last logon Never
Logon hours allowed All
Local Group Memberships *Users
Global Group memberships *None
The command completed successfully.
==== Windows resolution localohost IPV6 ::1 ====
IPV6 is disable, etc hosts file has no entry for localhost, but host answer as ::1
C:\> more c:\Windows\System32\drivers\etc\hosts
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
10.0.0.123 myhost01.mydom.lan myhost01
The host answer to ping as localhost IPV6
C:\> ping myhost01.mydom.lan
Pinging myhost01.mydom.lan [::1] with 32 bytes of data:
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Disable IPV6
C:\> netsh interface ipv6 set prefix ::/96 60 3
C:\> netsh interface ipv6 set prefix ::ffff:0:0/96 55 4
netsh interface ipv6 show prefixpolicies
Another way is to disable IPV6 into registry
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\TCPIP6\Parameters:
Create a DWORD named "DisabledComponents", and set it to "ffffffff"