SQL Server – Recuperare il Product Key da una installazione esistente

fonte: http://www.ryadel.com/sql-server-2008-2008-r2-e-2014-recuperare-il-product-key-da-una-installazione-esistente/

A volte può essere necessario recuperare il Product Key del proprio SQL Server da una installazione esistente: il caso più comune è quello di un Server di una certa età del quale si è perso ogni ricordo di configurazione e che si ha improvvisamente necessità di trasferire altrove, ma può anche capitare di smarrire semplicemente il codice seriale e trovarsi nell’esigenza di doverlo recuperare.

Fortunatamente, l’informazione può essere agevolmente ottenuta tramite l’esecuzioe di questo script PowerShell realizzato da Jacob Bindslet:

Lo script funziona con tutte le versioni e le edizioni di SQL Server dalla 2005 in poi: SQL Server 2005, SQL Server 2008 e SQL Server 2008 R2: per utilizzarlo con Sql Server 2012 o Sql Server 2014 dovrete apportare delle piccole modifiche.

Nel caso di Sql Server 2012 dovete modificare la linea 5 nel seguente modo:

E anche modificare la linea 16 nel seguente modo (grazie a gprkns per il suggerimento):

Una versione completa dello script modificato in questo modo per funzionare su Sql Server 2012 è disponibile a questo indirizzo.

Nel caso di Sql Server 2014, Microsoft ha spostato il nodo DigitalProductID  all’interno della chiave di registro relativa all’istanza dell’installazione di Sql Server: per questo motivo dovrete modificare la linea 5 nel modo seguente:

Per eseguire lo script è sufficiente compiere queste operazioni:

  • Lanciate un prompt PowerShell (Avvio > Esegui (oppure Start > Run se il sistema è in lingua inglese), quindi digitate powershell e premete invio.
  • Copiate il testo della funzione di cui sopra e incollatelo direttamente all’interno del prompt.
  • Premete INVIO una o più volte, fino a quando il prompt non tornerà disponibile.
  • scrivete GetSqlServerProductKey e premete INVIO.

Se tutto è stato eseguito correttamente il Prompt si riempirà di una serie di informazioni nel seguente modo:

sql-server-2008-retrieve-product-key

Potrete così visualizzare la versione di SQL Server installata, l’architettura, la build, l’edizione e, soprattutto, il vostro Product Key.

Per il momento è tutto: felice recupero!

ab_ files eating space in Temp folder

fonte: http://consek-blog.azurewebsites.net/cab_-files-eating-space/

cab_ files eating space in Temp folder

Two days ago one of my coworker called me, because he couldn’t start one of our proprietary applications. I got to him prepared to “reinstall” the program. I deleted the program folder and tried to paste working one from my backup and BAM!, no sufficient disk space box appeared. I thought “WTF?”.

I quickly returned to My Computer and noticed that there were 0 (sic!) bytes  free on C drive. I knew that this would be a very interesting case to investigate, so I switched the laptop with spare one and took it to my office. 🙂

The first thing I did was to run TreeSize (you can find it in Tools) which gave me this nice overview of disk usage:

cab_ files eating space int Temp folder 01

As you can see C:WindowsTemp takes up 173,7 GB of space! I decided to check that folder and saw this:cab_ files eating space int Temp folder 02

The folder was filled with hundreds of cab_ files!

From the dates I deducted that, on average, almost every hour 5 files were created. This was happening every working day, for the last nine months! No wonder they grew up so large.

I decided to check what what was creating them. I deleted all unused files from Temp (for nicer view 🙂 ) and set up Procmon with filter set to “Path begins with C:WindowsTempc”. All I had to do was to wait for my prey 🙂

Luckily I didn’t have to wait for long, as first files were created in 5 minutes.

cab_ files eating space int Temp folder 06

I checked Procmon and got:

cab_ files eating space int Temp folder 03

It turned out that a simple compressing program was causing all the trouble. But why was that?

You can see that in the “Command Line:” box we have a file supplied as a parameter to the program. So lets check it.

When I got to C:WindowsLogsCBS I stumped upon a CBS.log, a couple of CBSPersist_%date%.cab and some CBSPersist_%date%.txt. (Sorry for no screen shots but I forgot to make them, so you’ll have to believe me 🙂 ). All the .cab and .txt files looked like old logs, so why not all of them are .cabs? I checked the .txt with the earliest modification date and I got my answer… It was 5GB in size! So now let me give you a little background information about what is happening here.


How does makecab work?

Makecab creates a compressed cab archive from selected file. To do this it creates cab_%numbers% file in Temp folder (if you run it from normal account it uses user’s temp folder). After everything is completed all the files are deleted. And why it didn’t happen here? Because the txt file it tried to compress was too big for it to handle:

cab_ files eating space int Temp folder 07

Here you have shown what happened when I tried to manually compress the txt file. The program exited before deleting the temporary files.


But why it grew up so large? To find the cause, let’s check what program started makecab in the first place.

To do this we will use Parent PID from makecab’s procmon event properties, and Task Manager with shown PID column:

cab_ files eating space int Temp folder 12

Now we have the bad guy! But what are his motives?

By using Procmon, Procexp and some google-fu I learned that TrustedInstaller is used by Windows Update to perform updates, which explains periodicity of file creation. When WU check for updates, TrustedInstaller writes a lot of information in CBS.log file. TI is also responsible for starting the process of compressing the log when it grows too large (50-500MB). It does it by renaming the original log to CBSPersist_%currentdate%.txt (below you have the renaming process captured in Procmon), and then calling makecab program with proper parameters.

cab_ files eating space int Temp folder 10

By looking at the modification dates on .txt files I noticed that the problematic file must have grown that large in only 4 days (last .cab had modification date set to 10.10.14r and .txt had 14.10.14r.). Why TrustedInstaller didn’t prevent it? Well, the only reasonable explanation for me is that WU wasn’t checking for updates during that time so there was no log size control.

And here things got interesting… When WU won’t check for updates? Only when there are ones waiting for restart, to install themselves! Sadly System Log was set to overwrite old log entries rather than archive, so I don’t have any proof of my diagnose, but I think that after installing updates no one restarted the laptop for 4 days. It was the first week we had this laptop in our production environment, so surely he had a lot of information to write there. One thing that supports it is that on my home system I saw a 0.5GB CBS.log file and it was only one day old 🙂

I think that this fully solves the problem and explains everything in detail 🙂

Thanks for reading, and remember to restart your computer once in a while 🙂 To the next time!

Allow DNS Suffix Appending to Unqualified Multi-Label Name Queries

fonte: http://www.computerstepbystep.com/allow-dns-suffix-appending-to-unqualified-multi-label-name-queries.html

Description:

Specifies whether the computers to which this setting is applied may attach suffixes to an unqualified
multi-label name before sending subsequent DNS queries, if the original name query fails.

A name containing dots, but not dot-terminated, is called an unqualified multi-label name, for example
“server.corp”. A fully qualified name would have a terminating dot, for example “server.corp.contoso.com.”.

If you enable this setting, suffixes are allowed to be appended to an unqualified multi-label name, if the
original name query fails. For example, an unqualified multi-label name query for “server.corp” will be queried
by the DNS Client first. If the query succeeds, the response is returned to the client. If the query fails, the
unqualified multi-label name is appended with DNS Suffixes configured for the computer for queries. These
suffixes can be derived from a combination of the local DNS Client’s primary domain suffix, a
connection-specific domain suffix and/or DNS Suffix Search List.

For example, if the local DNS Client receives a query for “server.corp”, and a primary domain suffix is
configured as “contoso.com”, with this setting the DNS Client will send a query for “server.corp.contoso.com.”
if the original name query for “server.corp” fails.

If you disable this setting, no suffixes are appended to unqualified multi-label name queries if the original
name query fails.

If you do not configure this setting, computers will use their local DNS Client configuration to determine the
query behavior for unqualified multi-label names.

Supported on: At least Windows Vista.
Allow DNS Suffix Appending to Unqualified
Multi-Label Name Queries

DescriptionGpeditRegeditCMDBack

VBScriptPowerShell Script

Gpedit:

Please perform the following steps:

Please go to Pearl button (Start) and click on the Search programs and files
For more information about the change from Start to Pearl button click here

Type gpedit.msc and press Enter

In the Group Policy window please navigate to Computer Configuration> Administrative Templates>
Network > DNS Client and open Allow DNS Suffix Appending to Unqualified Multi-Label Name Queries.
Not Configured > is the Default state
Enabled> apply this GPO
Disabled> this GPO will not be applied

To finish press ok button and close Group Policy window.

DescriptionGpeditRegeditCMDUpBack

VBScript

Type regedit and press ok

Please confirm User Account Control pop-up

Microsoft official disclaimer

Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by
using another method. These problems might require that you reinstall the operating system. Microsoft
cannot guarantee that these problems can be solved. Modify the registry at your own risk.

Note: This registry key is created by Group Policy when this GPO is Enable or Disable. The GPO Default state
is Not Configured> this registry entry is not present.

Please navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient and
locate
AppendToMultiLabelName registry key
Regedit:          

Please perform the following steps:

Please go to Pearl button (Start) and click on the Search programs and files
For more information about the change from Start to Pearl button click here

DescriptionGpeditRegeditCMDUpBack

VBScript

Double click on AppendToMultiLabelName and edit the value:

To Enable:
Change the data value with 1

To Disable:
Change the data value with 0

To finish press ok button and close Registry Editor window

Note: Manual editing of this registry key will not be reflected in Group Policy. If you modify this GPO from
Group Policy this registry key will be rewritten.

DescriptionGpeditRegeditBackCMD

VBScriptUp

Type cmd, right click on cmd icon under the Programs and click on Run as administrator

Please confirm User Account Control pop-up

Please select, right and copy a registry key from below, then right click on command prompt window
, select Paste and press Enter

Enabled:
REG add “HKLM\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient” /v AppendToMultiLabelName /t REG_DWORD /d 1 /f

Disabled:
REG add “HKLM\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient” /v AppendToMultiLabelName /t REG_DWORD /d 0 /f

Not Configured:
REG DELETE “HKLM\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient” /v AppendToMultiLabelName /f

Note: Manual editing of this registry key will not be reflected in Group Policy. If you modify this GPO from
Group Policy this registry key will be rewritten.
CMD:

Please perform the following steps:

Please go to Pearl button (Start) and click on the Search programs and files
For more information about the change from Start to Pearl button click here

DescriptionGpeditRegeditBackCMD

VBScriptUp

VBScript:

Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = “.”
Set oReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\\” & _
strComputer & “\root\default:StdRegProv”)

strKeyPath = “SOFTWARE\Policies\Microsoft\Windows NT\DNSClient”
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath
strValueName = “AppendToMultiLabelName”
‘Enabled
dwValue = 1
‘Disabled
‘dwValue = 0
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
‘Not Configured
‘oReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName

DescriptionGpeditRegeditBackCMD

VBScriptUp

PowerShell Script :

Enabled\Disabled

$RegKey = “HKLM:\SOFTWARE\Policies\Microsoft”
If(Test-Path ($RegKey + “\Windows NT”))
{
 $RegKey = “HKLM:\SOFTWARE\Policies\Microsoft\Windows NT”
 If(Test-Path ($RegKey + “\DNSClient”))
 {
   $RegKey = “HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient”
   ##Enabled
   New-ItemProperty –path $RegKey –name AppendToMultiLabelName –value 1 –PropertyType DWord –Force
   ##Disabled
   ##New-ItemProperty –path $RegKey –name AppendToMultiLabelName –value 0 –PropertyType DWord –Force
 }
 else
 {
   New-Item –path $RegKey –name Service
   $RegKey = “HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient”
   ##Enabled
   New-ItemProperty –path $RegKey –name AppendToMultiLabelName –value 1 –PropertyType DWord
   ##Disabled
   ##New-ItemProperty –path $RegKey –name AppendToMultiLabelName –value 0 –PropertyType DWord
 }
}
else
{
 New-Item –path $RegKey –name Windows NT
 $RegKey = “HKLM:\SOFTWARE\Policies\Microsoft\Windows NT”
 New-Item –path $RegKey –name Service
 $RegKey = “HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient”
 ##Enabled
 New-ItemProperty –path $RegKey –name AppendToMultiLabelName –value 1 –PropertyType DWord
 ##Disabled
 ##New-ItemProperty –path $RegKey –name AppendToMultiLabelName –value 0 –PropertyType DWord
}

Not Configured

$RegKey = “HKLM:\SOFTWARE\Policies\Microsoft”
Remove-ItemProperty –Path($RegKey + “\Windows NT\DNSClient”) –name AppendToMultiLabelName
If( (Get-Item –Path($RegKey + “\Windows NT\DNSClient”)).ValueCount –eq 0 –and (Get-Item –Path($RegKey + “\Windows NT\DNSClient”)).SubKeyCount –eq 0)
{
 Remove-Item –Path($RegKey + “\Windows NT\DNSClient”)
 If( (Get-Item –Path($RegKey + “\Windows NT”)).ValueCount –eq 0 –and (Get-Item –Path($RegKey + “\Windows NT”)).SubKeyCount –eq 0)
 {
   Remove-Item –Path($RegKey + “\Windows NT”)
 }
}

Applicazione si blocca cliccando su Salva con nome

fonte: http://www.ilsoftware.it/articoli.asp?tag=Applicazione-si-blocca-cliccando-su-Salva-con-nome_14252

vedi anche: https://support.microsoft.com/it-it/kb/313937

L’utilità gratuita Process Monitor consente di stabilire cosa accade “dietro le quinte”.

Quando un programma si blocca cliccando su Salva con nome o Apri, per comprendere la natura del problema di solito ci comportiamo come segue:

1) Chiudiamo l’applicazione che non risponde usando il Task manager (pulsante Termina attività).
2) Avviamo Process Monitor.
3) Premiamo CTRL+E per disattivare la cattura degli eventi in corso sul sistema.
4) Premiamo CTRL+X per cancellare l’elenco completo degli eventi rilevati.
5) Eseguiamo l’applicazione “incriminata” senza usare i comandi Apri e Salva con nome.
6) Stabiliamo qual è il nome dell’eseguibile dell’applicazione che si blocca (lo si può verificare dalla scheda Dettagli del Task Manager di Windows).
7) Premiamo CTRL+L e, nella finestra per l’impostazione di un filtro, scegliamo Process name e impostiamo il nome dell’eseguibile nella casella appena a destra.

Applicazione si blocca cliccando su Salva con nome

8) A questo punto premiamo nuovamente CTRL+E da Process Monitor per avviare il monitoraggio.
9) Utilizziamo il comando Salva con nome o Apri e, al blocco dell’applicazione, premiamo di nuovoCTRL+E in Process Monitor.
10) Chiudiamo forzosamente l’applicazione bloccata servendoci del Task Manager.

A questo punto, passando a Process Monitor, suggeriamo di esaminare la parte file degli eventi registrati dal programma. Qui, con ogni probabilità, si troveranno gli indizi per risolvere definitivamente il problema.

Indicazioni del tipo FILE LOCKED o FILE LOCKED WITH ONLY READERS manifestano l’impossibilità da parte del programma e, quindi, della finestra di dialogo Salva con nome/Apri di gestire il file riportato nella colonna poco a sinistra.

Applicazione si blocca cliccando su Salva con nome

Nell’esempio in figura, è evidentemente l’estensione per le finestre di dialogo Salva con nome e Apri di Dropbox (DropboxExt.40.dll) a causare problemi. La disattivazione di tale integrazione o la disinstallazione di Dropbox ha permesso, in questo caso, di tornare ad usare le finestre di dialogo Salva con nome e Apri scongiurando il blocco di qualunque applicazione.

Process Monitor, tuttavia, risulterà utile per sbloccare Salva con nome e Apri risalendo alla causa del problema. L’utilità Process Monitor, ad esempio, risulta utilissima per individuare la chiave del registro che contiene il riferimento all’ultima cartella contenente il file aperto o salvato.
Modificando tale percorso si potrà risolvere ogni rallentamento in fase di apertura delle finestre di dialogo Salva con nome e Apri nel caso in cui Windows o l’applicazione “incriminata” provassero ad accedere a risorse condivise al momento indisponibili o inutilizzabili.

Come risolvere l’errore L’app è stata bloccata a scopo di protezione in Windows 10

fonte: http://www.windowsblogitalia.com/2016/01/errore-lapp-e-stata-bloccata-a-scopo-di-protezione/

Microsoft ha deciso di migliorare la sicurezza impedendo ai programmi non sicuri e verificati di essere installati in Windows 10. Può capitare, però, che vengano riconosciuti dei falsi positivi e che l’utente non possa installare l’applicazione; in tal caso viene restituito l’errore L’app è stata bloccata a scopo di protezione. Vediamo come risolvere questo problema.

METODO 1: PROMPT DEI COMANDI

Una prima soluzione temporanea al blocco delle app a scopo di protezione può essere quella di ricorrere al Prompt dei comandi:

  1. Digitate nel box di ricerca cmd (o in alternativa Prompt dei comandi), cliccate con il tasto destro del mouse e selezionateEsegui come amministratore.
  2. Alla richiesta di Controllo dell’account utente cliccate .
  3. Digitate il percorso dove è disponibile il setup dell’applicazione (nel nostro caso abbiamo sul Desktop il setup WBI.exe; nel Prompt dei comandi digiteremo C:\Users\biagi\Desktop\WBI.exe) e premete Invio.
  4. Et voilà: l’app verrà eseguita correttamente.

METODO 2: ACCOUNT ADMINISTRATOR

Per risolvere questo problema delle app dovete ricorrere all’account Administrator, che ha dei privilegi maggiori rispetto al classico account da amministratore:

  1. Digitate nel box di ricerca cmd (o in alternativa Prompt dei comandi), cliccate con il tasto destro del mouse e selezionateEsegui come amministratore.
  2. Alla richiesta di Controllo dell’account utente cliccate .
  3. Digitate la seguente stringa e premete Invio: net user administrator /active:yes
    Se l’operazione andrà a buon fine, comparirà la scritta Esecuzione comando riuscita.
  4. Disconnettetevi dall’account.
  5. Accedete al nuovo account Administrator.
  6.  Grazie all’Esplora file, individuate l’eseguibile (nel nostro caso sarà presente in C:\Users\biagi\Desktop\WBI.exe) ed installate il programma.
  7. Disconnettetevi dall’account Administrator e rientrate nel vostro account.
  8. Disattivate l’account Administrator digitando in un Prompt dei comandi con privilegi di amministratore la seguente stringa: net user administrator /active:no

Il problema delle app bloccate è stato risolto. Vi è mai capitato di incorrere in questa situazione? Avete risolto il problema? Fatecelo sapere nei commenti.

Articolo di Windows Blog Italia
Fonte | WinAero

How to run 32-bit UDL file on a 64-bit Operating System

fonte: https://blogs.msdn.microsoft.com/chaitanya_medikonduri/2008/04/09/how-to-run-32-bit-udl-file-on-a-64-bit-operating-system/

We’ll need to  execute the command below from a command line or Start/Run :

 

C:\Windows\syswow64\rundll32.exe “C:\Program Files (x86)\Common Files\System\Ole DB\oledb32.dll”,OpenDSLFile C:\test.udl

 

Check the paths of rundll32.exe and oledb32.dll while running this command!

 

Here you have your 32 bit OLE DB Providers.

Reinstall and Reset TCP/IP (Internet Protocol) in Windows with NetShell

fonte:https://techjourney.net/reinstall-and-reset-tcpip-internet-protocol-in-windows-with-netshell/

If you facing network connection issue, or more accurately unable to access or connect to Internet or network problem in Windows operating system such as Windows 2003, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10, Windows Server and etc, you can try to reinstall and reset TCP/IP stack or Internet Protocol, one of the core component of the operating system, which cannot be uninstalled.

Again, with a corrupt TCP/IP stack, the same woes may happen – unable to establish a connection to the server, unable to load a web page, unable to browse and surf the Internet, even though network connection to broadband router or wireless router appear to be OK.

When all means run out, try to reinstall the IP stack with NetShell utility. NetShell utility (netsh) is a command-line scripting interface for the configuring and monitoring of Windows networking service.

To reinstall and reset the TCP/IP stack (Internet Protocol) to its original state as same as when the operating system was first installed, simply use the following command in a Command Prompt (Cmd) shell. In Windows Vista or newer, open an elevated Command Prompt with Administrator privileges instead. A log file name must be specified where actions taken by netsh will be recorded on newly created or appended if already existed file..

netsh int ip reset [ log_file_name ]

Example:

netsh int ip reset c:\resetlog.txt

Restart the computer once the command completed.

The command will remove all user configured settings on TCP/IP stack and return it to original default state by rewriting pertinent registry keys that are used by the Internet Protocol (TCP/IP) stack to achieve the same result as the removal and the reinstallation of the protocol. The registry keys affected are:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\

and

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DHCP\Parameters\

It’s also possible to use the Easy Fix wizard provided by Microsoft to reset TCP/IP automatically.For Windows 8.1, Windows 8, Windows RT, Windows 7, Windows Server 2012R2, Windows Server 2012, Windows Server 2008 R2: MicrosoftEasyFix20140.mini.diagcab

For Windows Vista, Windows XP, Windows Server 2008 or Windows Server 2003: MicrosoftFixit50199.msi

altri riferimenti:

Repair and Reset Windows Vista TCP/IP Winsock Catalog Corruption