April 30, 2015 at 12:24 am
Hi,
Is there any way to find out Full SQL server's Operating System Name.
If I am using exec xp_msver it shows WindowsVersion,But I need original OS Name.Becoz WindowsVersion is same for many OS.
Plz Help.
Thanks.......
-----------------------------------
My Blog[/url] | Articles
April 30, 2015 at 4:59 am
Hi,
A more simpler
Select @@version or
select * from sys.dm_os_windows_info
will give you the Windows Version name.
You will have to compare the returned value to find the OS name.
For your reference -
Windows NT 5.0 = Windows 2000
Windows NT 5.1 = Windows Server 2003
Windows NT 5.2 = Windows Server 2003 R2
Windows NT 6.0 = Windows Server 2008
Windows NT 6.1 = Windows Server 2008 R2
Windows NT 6.2 = Windows Server 2012
Windows NT 6.3 = Windows Server 2012 R2
Thank you,
Ninad
April 30, 2015 at 5:04 am
I have checked it but problem is
NT 6.3 :=> Windows 8.1
NT 6.2 :> Windows 8
http://en.wikipedia.org/wiki/List_of_Microsoft_Windows_versions
Thanks.......
-----------------------------------
My Blog[/url] | Articles
April 30, 2015 at 5:28 am
Hi,
Check out
https://msdn.microsoft.com/en-us/library/windows/desktop/ms724832(v=vs.85).aspx
I guess confusion will be for Windows Server 2003 and Win2K3 R2. 🙂
but for others its just a difference of whether server edition or desktop/home OS
May 4, 2015 at 4:38 pm
Don't you love how Windows 8.1 and Windows 6.3 are the same thing?
May 8, 2015 at 4:13 am
You can do this with PowerShell.
And if you have xp_cmdshell enabled (not encouraged for security reasons) you can run it from an SSMS Query window.
exec xp_cmdshell 'powershell.exe -noprofile -command "Get-WmiObject -Class Win32_OperatingSystem | Select Caption"'
output
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
NULL
Caption
-------
Microsoft Windows Server 2008 R2 Standard
NULL
NULL
NULL
(7 row(s) affected)
May 8, 2015 at 6:57 pm
Richard Fryar (5/8/2015)
You can do this with PowerShell.And if you have xp_cmdshell enabled (not encouraged for security reasons)...
What security reasons? If an attacker gets into your system without "SA" privs, they can't use xp_CmdShell even if it's enabled. If an attacker gets into your system with "SA" privs, having it disabled will not stop them from using it because they can turn it on.
There is virtually no security advantage to be had in turning off xp_CmdShell.
--Jeff Moden
Change is inevitable... Change for the better is not.
May 11, 2015 at 6:32 am
Hi Jeff,
I am aware of your slide set on the subject and I agree with what you say.
Some comments though:
Point taken though. As always, your arguments make a lot of sense.
Richard
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply