Intro

Here are some Windows commands which could be useful inside scripts or in a Server Core environment.

Commands

PS C:\Users\Administrator> net statistics server
PS C:\Users\Administrator> wmic qfe list
PS C:\Users\Administrator> netdom renamecomputer ANCIENNOM /newname:NOUVEAUNOM
PS C:\Users\Administrator> wmic computersystem where name="%computername%" call joindomainorworkgroup name="NOUVEAUNOM"
PS C:\Users\Administrator> netdom join "nom ordinateur" /domain:"monDomaine" /userD:"domaine\utilisateur" /passwordD:"motdepasse"
PS C:\Users\Administrator> tasklist
PS C:\Users\Administrator> taskkill /F /PID "id_processus"

Local User Creation

PS C:\Users\Administrator> net user John "MyPassword!" /ADD
PS C:\Users\Administrator> net localgroup administrators John /add

Firewall

PS C:\Users\Administrator> netsh advfirewall firewall set rule group="Remote Administration" new enable=yes
PS C:\Users\Administrator> netsh advfirewall set current profile settings remotemanagement enable
PS C:\Users\Administrator> cscript %windir%\system32\scregedit.wsf /ar 0
PS C:\Users\Administrator> netsh advfirewall firewall set rule group="Remote Desktop" new enable=yes
PS C:\Users\Administrator> netsh advfirewall show rule name=all
PS C:\Users\Administrator> netsh advfirewall firewall add rule name="SSH" dir=in localport=22 remoteport=0-65535 protocol=TCP action=allow remoteip=any localip=any

Network

PS C:\Users\Administrator> netsh interface ipv4 show interfaces
PS C:\Users\Administrator> netsh interface ipv4 set address name="ID Carte Réseau" source="static" address="10.0.0.100" mask="255.0.0.0" gateway="10.0.0.1"
PS C:\Users\Administrator> netsh interface ipv4 add dnsserver name"ID Carte Réseau" address=10.0.0.1 index=1
Licence Creative Commons
This website http://shebangthedolphins.net is licensed to the public under a licence Creative Commons Attribution licence.
Contact :