netstat -abn
or
netstat -a -n -p tcp -o
netstat -abn
or
netstat -a -n -p tcp -o
Para criar usuários locais com net user, digite:
1 net user nome_usuario senha /add
Substitua nome_usuario e senha pelos dados desejados. Você também pode ir além e
digitar o nome completo e a descrição do usuário com:
1 net user nome_usuario senha /add /fullname:"Nome Completo" /comment:"Descrição do usuário"
Caso queira alterar a senha de um usuário local, simplesmente digite:
1 net user nome_usuario nova_senha
Ou se quiser editar o nome completo ou a descrição, digite:
1 net user nome_usuario /fullname:"Novo nome Completo" /comment:"Nova descrição do usuário"
Utilizando este método, você vai criar usuários “Padrão”, ou seja, sem privilégios
administrativos. Para dar privilégios de administrador para determinado usuário,
simplesmente digite:
1 net localgroup administradores nome_usuario /add
Caso tenha pensado melhor e acha que o usuário não merece ser um administrador,
digite:
1 net localgroup administradores nome_usuario /delete
Command Prompt:
netdom renamecomputer Thecomputernamehere /newname:newnamehere /force /userd:domain\username /passwordd:***** /reboot
Powershell:
Example 1: Rename the local computer
This command renames the local computer to Server044 and then restarts it to make the change effective.
PowerShell
Rename-Computer -NewName "Server044" -DomainCredential Domain01\Admin01 -Restart
Example 2: Rename a remote computer
This command renames the Srv01 computer to Server001. The computer is not restarted.
The DomainCredential parameter specifies the credentials of a user who has permission to rename computers in the domain.
The Force parameter suppresses the confirmation prompt.
PowerShell
Rename-Computer -ComputerName "Srv01" -NewName "Server001" -DomainCredential Domain01\Admin01 -Force
To use Robocopy to clone a directory without files, use the following syntax:
robocopy "C:\Your Folder" "C:\New Folder" /e /xf *
same as above but without displaying the status:
robocopy "C:\Your Folder" "C:\New Folder" /e /xf * >nul
same as first example and creates a log (overwrites existing log):
robocopy "C:\Your Folder" "C:\New Folder" /e /xf * /log:yourlogfile.log
same as first example and appends to log (appends to existing log):
robocopy "C:\Your Folder" "C:\New Folder" /e /xf * /log+:yourlogfile.log
Copy only the top level sub-folders (sub-folders in the source directory)
robocopy "C:\Your Folder" "C:\New Folder" /e /LEV:2 /xf *
/e = Copies subdirectories, including empty ones.
/LEV: n = Copy only the n LEVels of the source. For n=2, only the top level sub-folders will be copied
/xf = Excludes files matching the specified names or paths. Wildcards “*” and “?” are accepted
List folders and files:
dir ..\myfolder /b /s /o:gn>list.txt
When you do not want to list the folders, only the files in the subfolders, use /A-D switch like this:
dir ..\myfolder /b /s /A-D /o:gn>list.txt
wmic /node:(hostname ou IP) computersystem get username
C:\Users\douglastos>wmic /node:desk0191 computersystem get username
UserName
grupo\userteste
robocopy "D:\SOURCE" "\\10.20.30.40\F$\DESTINY" /E /ZB /SEC /COPYALL /R:3 /W:3 /V /ETA /TEE /MT:16 /XD "D:\SOURCE\EXCLUDE"
/E — Copy Subdirectories, including empty ones.
/ZB — Uses restartable mode. If access is denied, use backup mode.
/R:3 — Retry 3 times (you can specify a different number, default is 1 million).
/W:3 — Wait 3 seconds before retrying (you can specify a different number, the default is 30 seconds).
/V — Produce verbose output, showing skipped files.
/COPYALL — copy all file information.
/SEC — copy security information.
/TEE — open console.
/MT:16 — Do multi-threaded copies with n threads (default is 8, max 128).
/XD - exclude folder.
- Click Start, type cmd.exe, right-click on the link to cmd.exe and
select "Run as administrator" -- respond as needed to any UAC prompt
- Type
the following command into the Command Prompt window and press Enter
(where C: is the drive you are interested in examining)
fsutil fsinfo ntfsinfo c:
Example:
Microsoft Windows [Version 6.1.7601]
curl -s -o /dev/null -w "Conecction: %{time_connect}s | Start transfer: %{time_starttransfer}s | Total time: %{time_total}s\n" ...