Home Random Windows Commands
Post
Cancel

Random Windows Commands

Collection of interesting and useful commands in Windows command prompt and PowerShell.

  1. Command Prompt
  2. PowerShell

Command Prompt

Change Computer Name

In CMD as Admin:

1
wmic computersystem where caption='CURRENT_PC_NAME' rename 'NEW_PC_NAME'

View BitLocker Status

BitLocker status of all connected drives will be shown (inc USBs).

In CMD as Admin:

1
manage-bde -status

Executing an Application in the Context of a Domain User

1
runas /netonly /user:DOMAIN\USERNAME "PROGRAM_TO_EXECUTE"

Force Apply Group Policy Updates

1
gpupdate /force

Set Windows KMS

  1. Set KMS server:
    1
    
    cscript C:\Windows\System32\slmgr.vbs /skms KMS_SERVER
    
    • Where KMS_SERVER is the IP/Hostname of the KMS server.
  2. Force activate Windows:
    1
    
    cscript C:\Windows\System32\slmgr.vbs -ato
    

Lock Computer

1
Rundll32.exe user32.dll,LockWorkStation


PowerShell

Execution Policy Bypass

1
powershell -executionpolicy bypass

See Current SMB Connections

In PowerShell as Admin:

1
Get-SMBConnection
This post is licensed under CC BY 4.0 by the author.