Windows Environment Commands

Windows Environment Commands

  • Change Proxy via Command

 

netsh winhttp set proxy proxy-server="proxy.:8080"
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyServer"="proxy.:8080"
"AutoConfigURL"=""

reg import filename.reg

  • KMS Activation

KMS Keys – http://technet.microsoft.com/en-us/library/jj612867.aspx


 

cscript //B "%windir%\system32\slmgr.vbs" -ckms
 cscript //B "%windir%\system32\slmgr.vbs" -skms [kms_server_name]:1688
 Find KMS Server - nslookup -type=srv _vlmcs._tcp
 cscript //B "%windir%\system32\slmgr.vbs" -skms –ipk <kms key>
 cscript //B "%windir%\system32\slmgr.vbs" -skms –ato

  • Find User Account with ForeignSecurityPrincipal / SAMID

$pw = read-host "Enter password" -AsSecureString
 connect-QADService -service '*.com.au' -ConnectionAccount 'domain\username' -ConnectionPassword $pw
 (get-QADObject -identity 'S-1-5....').DirectoryEntry.description
 disconnect-QADService

  • Show SAMID of user account

dsquery * -filter "&(objectcategory=user)(samaccountname=accountname)" -attr objectsid
 dsquery * -filter "&(objectcategory=user)(samaccountname=*)" -attr objectsid -limit 100000000
 dsget user "cn=username,OU=,DC=corpau,DC=com,DC=au" -sid

netsh int ipv4 show dynamicport tcp
netsh int ipv4 show dynamicport udp
netsh int ipv4 set dynamicport tcp start=10000 num=1000
netsh int ipv4 set dynamicport udp start=10000 num=1000

  • Find domain controllers
netdom query dc
  • Windows Update

net stop wuauserv
%windir%\Windowsupdate.log
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate

wmic qfe list full /format:htable | findstr "KB2621440"

wmic qfe list full | findstr "KB2621440"

  • KMS

cscript //B "%windir%\system32\slmgr.vbs" -ckms
 cscript //B "%windir%\system32\slmgr.vbs" -skms
 Find KMS Server - nslookup -type=srv _vlmcs._tcp

  • Dsgets

dsquery ou domainroot

dsquery user -name Ja*

dsget uer CN=*,CN=*,DC=*,DC=*,DC=*,DC=com,DC=au -memberof -expand

dsquery user -name *| dsget user -memberof -expand

dsquery "DC=com,DC=au"  | dsget group -members

  • Systeminfo

systeminfo /S A* /U /P  findstr  "Processor"

WMIC CPU Get NumberOfCores,NumberOfLogicalProcessors /Format:List

WMIC CPU Get /Format:List

  • NSanity
</pre>
c:\nsanity.exe -S snapmanager windows://ServerName
  • nmap
nmap -vv -P0 -sU -p123
  • Find Domain controllers

<strong>dsquery server</strong><strong> -hasfsmo</strong><strong> pdc</strong>

netdom query /d:domain pdc or dc

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s