Some useful windows command for SQL DBAs
Finding Uptime
systeminfo | find /i "Boot Time"System Boot Time: 14/12/2017, 7:48:04 AM
Cluster Command
cluster resource /statuscluster node /status
cluster group /status
Finding Processor Info
for the total number of coresecho %NUMBER_OF_PROCESSORS%
Go to RUN --> msinfo32
Finding Memory Info
Windows Cmd:wmic ComputerSystem get TotalPhysicalMemory && wmic OS get FreePhysicalMemory,TotalVirtualMemorySize,FreeVirtualMemoryResults will be in bytes
Powershell Cmd:
(Get-WMIObject Win32_PhysicalMemory | Measure-Object Capacity -Sum).sum/1GB
For Remoting:
For ($x in serverlist.txt){ $colItems = get-wmiobject -class "Win32_ComputerSystem" -computername $x foreach ($objItem in $colItems){ $displayGB = [math]::round($objItem.TotalPhysicalMemory/1024/1024/1024, 0) write-host "Total Physical Memory: " $displayGB "GB" write-host "Model: " $objItem.Model } $colItems = get-wmiobject -class "Win32_Processor" -computername $x foreach ($objItem in $colItems){ write-host "System Name: " $objItem.SystemName }}
Open SSMS as a different windows login
C:\windows\system32>runas.exe /noprofile /env /user:pcname\mirroruser ssms.exe
Comments
Post a Comment