Usando o Prompt de Comando (dnscmd)Abra o Prompt de Comando como Administrador e utilize a seguinte estrutura para adicionar um registro do tipo A (endereço IP):
dnscmd . /RecordAdd <NomeDaZona> <NomeDoHost> A <EnderecoIP>
Exemplo prático:
dnscmd . /RecordAdd meu-dominio.com meu-servidor A 192.168.1.50
O ponto . indica que você está gerenciando o servidor DNS local.
Usando o PowerShell (Add-DnsServerResourceRecordA)
Abra o Windows PowerShell como Administrador e execute o comando correspondente para a zona de pesquisa direta:
Add-DnsServerResourceRecordA -Name <NomeDoHost> -IPv4Address <EnderecoIP> -ZoneName <NomeDaZona>
Exemplo prático: Add-DnsServerResourceRecordA -Name meu-servidor -IPv4Address 192.168.1.50 -ZoneName meu-dominio.com
Adicionar registro DNS windows linha de comando
Export/import windows server DNS zones
Export-DnsServerZone and Import-DnsServerZone. - Export:
Export-DnsServerZone -Name "test.com" -Filename "test.com.dns" - Import:
Import-DnsServerZone -Name "test.com" -Filename "test.com.dns"
The file "test.com.dns" will be created in "C:\windows\system32\dns" folder
Only export dns records:
Get-DnsServerResourceRecord -ZoneName "test.com" | Export-Csv -Path "C:\temp\dns.csv"
Import option 2:
dnscmd localhost /zoneadd teste.com /primary /file teste.com /load
Restaurar perda de confiança com o domínio
Windows 10/11/2019/2022/2025
Com o Windows 10, existem várias soluções para resolver o problema, que veremos aqui.
Reset-ComputerMachinePassword
A primeira solução será usar o cmdlet Reset-ComputerMachinePassword que redefine a senha da conta do computador, o que resolve o problema.
1. Faça login com uma conta de administrador local
2. Inicie uma janela de comando do PowerShell como administrador
3. Digite o seguinte comando:
Reset-ComputerMachinePassword -Server "SERVER_DC" -Credential compte-admin@domaine.local
4. Reinicie o computador.
Test-ComputerSecureChannel
A outra solução para resolver o problema de aprovação é usar o cmdlet Test-ComputerSecureChannel com o parâmetro -repair
1. Faça logon no computador (de preferência com a conta de administrador local).
2. Abra um prompt de janela do PowerShell como administrador.
3. Digite o seguinte cmdlet para reparar a “ligação segura”.
Test-ComputerSecureChannel -Repair -Credential admin-on-domain@domain.local
Digite a senha vinculada à conta usada no pedido.
4. Reinicie o computador.
Set https proxy variable on windows
Check variables:
[System.Environment]::GetEnvironmentVariable("HTTP_PROXY","user");
[System.Environment]::GetEnvironmentVariable("HTTPS_PROXY","user");
[System.Environment]::GetEnvironmentVariable("HTTPS_PROXY","user");
[System.Environment]::GetEnvironmentVariable("HTTP_PROXY","user");
Set variable:
setx https_proxy http://<your_proxy_name_or_IP>:3128/
Mobile Access SSL Network Extender (SNX) remote users with Windows 11 24H2 fail to connect
Cause
The conflict resolution mechanism in Windows 11 24H2 is different than in earlier versions of Windows.
Solution
On the Windows endpoint computer, create a new Windows Registry parameter.
Procedure
- On the Windows endpoint computer, open the Registry Editor.
- Go to this location:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\cpextender - Create a new DWORD entry with the name
MetricSetMethod. - Set the value of
MetricSetMethodto1. - Restart the Windows endpoint computer.
Alterar MTU windows server
- 1. Abra o Prompt de Comando como administrador:
- Pressione a tecla Windows, digite "cmd" e clique com o botão direito em "Prompt de Comando", selecionando "Executar como administrador".
- 2. Descubra o índice da interface:
- Execute o comando:
netsh interface ipv4 show interface(ounetsh interface ipv6 show interfacepara IPv6). - Este comando mostrará uma lista das interfaces de rede e seus índices (Idx). Anote o índice da interface que você deseja modificar.
- Execute o comando:
- 3. Defina o valor da MTU:
- Execute o seguinte comando, substituindo
<índice>pelo número obtido no passo anterior:netsh interface ipv4 set interface <índice> mtu=9000(para IPv4).netsh interface ipv6 set interface <índice> mtu=9000(para IPv6).
- Execute o seguinte comando, substituindo
- 4. Verifique a configuração:
- Execute novamente o comando
netsh interface ipv4 show interface(ounetsh interface ipv6 show interface) para confirmar que o MTU foi alterado para 9000.
- Execute novamente o comando
netsh interface ipv4 set interface 4 mtu=9000Delete windows recovery partition
Run in terminal as admin:
Diskpart
list disk
select disk 0
list partition
select partition X
delete partition override
How to list open ports and application using them in Windows
netstat -abn
or
netstat -a -n -p tcp -o
Windows Server VSS error ID 513
Run in command prompt as administrator.
sc sdshow mslldp
Get the string and paste before (A;;CCLCSWLOCRRC;;;SU) and run
sc sdset mslldp [PASTE STRING HERE] (A;;CCLCSWLOCRRC;;;SU)
Disable Azure Arc Windows Server 2022
Disable-WindowsOptionalFeature -Online -FeatureName AzureArcSetup
Disable SMBV1 on Windows server 2012/2016
Server side:
Get smbv1 status
get-SmbServerConfiguration
Get-WindowsFeature | Where-Object {$_.name -eq "FS-SMB1"} | ft Name,Installstate
Active audit
Set-SmbServerConfiguration –AuditSmb1Access $true
Applications and Services -> Microsoft -> Windows -> SMBServer -> Audit and see if any clients accessed the file server over SMB1.
Remove SMB1
disable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol -Remove
Disable SMB1
set-SmbServerConfiguration -EnableSMB1Protocol $False -Force
Enable SMB1
set-SmbServerConfiguration -EnableSMB1Protocol $True -Force
Client side
Test w10
Dism /online /Get-Features /format:table | find "SMB1Protocol"
Windows Firewall - Allow IP address
In rule
netsh advfirewall firewall add rule name="Name" dir=in action=allow protocol=ANY remoteip=10.20.0.30
Out rule
netsh advfirewall firewall add rule name="Name" dir=out action=allow protocol=ANY remoteip=10.20.0.30
How to fix Windows fonts that are poor quality and not smooth
Windows 11
By default, the ClearType feature is enabled. However, if you want to customize the text even more, you can run the ClearType Text Tuner by following the steps below.
Press the Windows key on the keyboard.
In the search field at the top of the Start menu, type cttune.exe and press Enter.
The Windows ClearType Text Tuner program opens, allowing you to improve the quality of how the text looks on your screen. Click Next on each screen and make the appropriate selections based on the prompts.
Windows Vista, 7, 8 and 10
By default, the ClearType feature is enabled. However, if you want to customize the text even more, you can run the ClearType Text Tuner by following the steps below.
Click Start or press the Windows key on the keyboard.
In the search and run box, type cttune.exe and press Enter.
This action opens the Windows ClearType Text Tuner program, which should resemble the example picture below. This program lets you improve the quality of how the text looks on your screen.
How to add a Null route in windows
Host:
route add 8.8.8.8 mask 255.255.255.255 192.168.1.123 if 1 -p
Network:
route add 10.20.30.0 mask 255.255.255.0 192.168.1.123 if 1 -p
DFSR clean Staging folder
This particular error is generally experienced when people attempt a non NTFS volume such as ReFS to a DFSR replication group as documented on the following forum.
https://social.technet.microsoft.com/Forums/windowsserver/en-US/8860b354-3bf2-43ed-9acf-07fa43931046/dfsr-replication-cant-be-used-on-a-refs-volume?forum=winserver8gen
In my case, I experienced this error with DFSR setup on NTFS volume on a new branch server.
The customer moved the DFSR node from one office, to another office. The C:\ "SYSTEM" volume was formatted and reloaded with a fresh copy of 2012 R2 with latest patches, however the E:\ "DATA" volume was not formatted. As a result it has its legacy DFSR Database, Staging data etc.
To clean up the staging data I created a new directory in C:\ called "empty":
C:\Empty
I then ran the following commands after stopping the DFSR Replication service on the spoke server:
Robocopy "C:\Empty" "E:\System Volume Information\DFSR" /MIR
Followed by
rmdir "E:\System Volume Information\DFSR"
Starting the DFSR replication service resulted in the error above.
After playing around a bit more, I found that in addition to flushing all data in System Volume Information\DFSR you must also remove the DfsrPrivate link which points to the System Volume Information\DFSR sub directory for DfsrPrivate data.
After doing this, starting the DFS Replication service kicks of its normal DFSR Initial Sync shown by a state of 2:
Wmic /namespace:\\root\microsoftdfs path dfsrreplicatedfolderinfo get replicationgroupname,replicatedfoldername,state
State Values (Uninitialized, Initialized, Initial Sync, Auto Recovery, Normal, In Error), ValueMap (0, 1, 2, 3, 4, 5)}
Delete DFSR replication folders
md d:\emptyfolder
Robocopy.exe d:\emptyfolder "D:\System Volume Information\dfsr\Private" /purge
rd d:\emptyfolder
I found that at:
Gerenciar usuários por linha de comando no Windows
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
Windows update error 0x8024500c
Stop windows update service
Type %windir%\SoftwareDistribution\DataStore in this new window and click OK.
This will open Windows Explorer on the correct location.
Delete all contents of this folder. (Hint: Use Ctrl + A to select all files and folders)
In the new windows you have a navigation on the left side. Use it to navigate to
Once you found it, search for WUServer and WIStatusServer in the right hand pane.
If they are not listet we cannot clean the download path. Othwerwise delete both.
Restart your computer.
Kaspersky Security Center WSUS Files Storage Location
Kaspersky seems to be storing windows update files on the C Drive:
Here -> C:\ProgramData\KasperskyLab\adminkit\1093\.working
Change folder location with klsrvswch.exe utility.
You can reach it from the KSC installation folder. Utility named as "Administration Server Account Switch Utility". It seems like just allows you to switch service account, but also allows to change "wsus" folder path. Continue wizard as if you want to switch service account. You don't need to provide a new service account, you can use current. Last step is the place of path change.
Rename windows computer command
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
Adicionar registro DNS windows linha de comando
Usando o Prompt de Comando (dnscmd)Abra o Prompt de Comando como Administrador e utilize a seguinte estrutura para adicionar um registro do...
Mais vistos
-
Find Users Who Have Never Logged On Use the following PowerShell Command; Get-ADUser -Filter { LastLogonDate -notlike "*" -and En...
-
First you have to configure a wpad site in your IIS Open the proxypac.pac file you have previously created and save as wpad.dat. Copy wpa...
-
Java Keytool Command These commands allow you to generate a new Java Keytool keystore file, create a CSR, and import certificates. A...