Показаны сообщения с ярлыком slmgr. Показать все сообщения
Показаны сообщения с ярлыком slmgr. Показать все сообщения

15 февр. 2013 г.

Как просмотреть свой Product Key для Windows 2003, 7

Бывает, нужно было посмотреть ключи на лицензионных Windows. Стандартные средства покажут в лучше случае 5 последних символов (slmgr /dli), а в случае с Win2003 slmgr вообще нет :)

Можно использовать сторонние местами платные утилиты... Но лично я им не доверяю и ставить их на сервера не есть хорошая практика. Нашел на просторах Сети скрипт на Visual Basic, который вытягивает ключик из ресстра. Проверено на 2003 и 7.

Создаем текстовый файл в корне какого-то диска для простоты и копируем туда текст:

' Find Product Activation Key on Remote Machine
' Got this from a posting by 'Alatar1' at www.theeldergeek.com
'
' I just added the inputbox - Rob

If Wscript.Arguments.Count = 0 Then
    strComputer = inputbox("Enter a computer name to query the Windows product key from","Enter computer name")
    if strComputer = "" then wscript.quit
Else
    strCOmputer = Wscript.Arguments.Item(0)
End If
Dim Digits (24)
Digits (0) = "B" : Digits (1) = "C": Digits (2) = "D": Digits (3) = "F":
Digits (4) = "G": Digits (5) = "H": Digits (6) = "J": Digits (7) = "K":
Digits (8) = "M": Digits (9) = "P": Digits (10) = "Q": Digits (11) = "R":
Digits (12) = "T": Digits (13) = "V": Digits (14) = "W": Digits (15) = "X":
Digits (16) = "Y": Digits (17) = "2": Digits (18) = "3": Digits (19) = "4":
Digits (20) = "6" : Digits (21) = "7" : Digits (22) = "8": Digits (23) = "9"
Dim HexBuf (100), HexDigitalPID (15)
Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
objReg.GetBinaryValue &H80000002, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\", "DigitalProductId", HexBuf
' Extract Relevant Section of Digital Product ID

StartOffset = 52 : EndOffset =67
For i = StartOffset to EndOffset
  HexDigitalPID (i-StartOffset) = HexBuf(i)
next

' Convert Encoded Product ID to Activation Key

dLen = 29 : sLen = 15
KEYSTRING =""
for i=dLen-1 to 0 step -1
  if ((i + 1) mod 6) = 0 then
    KEYSTRING = KEYSTRING & "-"
  else
    HN = 0
    For N = (sLen -1) to 0 step -1
      Value = ( (HN *2^8 ) Or HexDigitalPID (N))
      HexDigitalPID (N) = Value \ 24
      HN = (Value mod 24)
    next
    KEYSTRING = KEYSTRING & Digits(HN)
  end if
next
KEYSTRING2 = StrReverse (KEYSTRING)
WScript.Echo KEYSTRING2

Затем сохраняем это, например, как pk.vbs. и запускаем. В  Windows 2003 можно кликом vsirb, а в 7 - из-под консоли с администраторскими правами. Скрипт попросит имя компьютера, которое берем в свойствах системы (правый клик мышкой по Мой компьютер или [Win + Break]). Вводим имя и через несколько секунд получаем наш ключ полностью.

11 янв. 2013 г.

How to conver Windows Server 2012 Evaluation editions to full retail versions

If you installed an evaluation edition of Windows Server 2012 which is free for 180 days and than buy a full version, you must convert Windows edition's type.

If the server is a domain controller, you cannot convert it to a retail version. In this case, install an additional domain controller on a server that runs a retail version and remove AD DS from the domain controller that runs on the evaluation version. For more information, see http://technet.microsoft.com/en-us/library/hh994618.aspx.

To convert edition do next steps:

1. First, check version. From an elevated command prompt, run

slmgr.vbs /dlv

evaluation versions will include “EVAL” in the output.

2. To see editions available for us to convert, type

DISM /Online /Get-TargetEditions

You will get a list of edition IDs which we will use later.




3. Convertation itself. Run from elevated cmd:

DISM /online /Set-Edition:<edition ID> /ProductKey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX /AcceptEula

providing the edition ID one from the list we got above and a your retail product key. The server will offer to restart (twice) and all will be done.

Good luck!