<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Evan - evan.ly]]></title><description><![CDATA[A lo-fi collection of things I've ever encountered as a IT Management Consultant / Business Analyst / Human-shaped IT Swiss-Army Knife.]]></description><link>http://evan.ly/</link><generator>Ghost 0.5</generator><lastBuildDate>Tue, 26 May 2026 16:39:08 GMT</lastBuildDate><atom:link href="http://evan.ly/author/evan/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[Reset Windows Server Azure VM Admin Password]]></title><description><![CDATA[<p>Don't ask me how, but the password in the CredVault was wrong, and no one was owning up to changing the master admin password.</p>

<p>So this is what you do.</p>

<p>Start Azure PowerShell, login to your Azure Account.</p>

<pre><code>Get-AzureVM -ServiceName [VMHOSTNAME] -Name [VMHOSTNAME] | Set-AzureVMAccessExtension -UserName userNameHere -Password securePassHere | Update-AzureVM
</code></pre>]]></description><link>http://evan.ly/reset-windows-server-azure-vm-admin-password/</link><guid isPermaLink="false">d1b1cf88-a6c6-444d-8989-2ec3d14b30f1</guid><category><![CDATA[WindowsServer2012]]></category><category><![CDATA[PowerShell]]></category><category><![CDATA[Azure]]></category><category><![CDATA[VM]]></category><dc:creator><![CDATA[Evan]]></dc:creator><pubDate>Mon, 03 Nov 2014 05:28:02 GMT</pubDate></item><item><title><![CDATA[Move SQL Server system DBs (master and msdb) to a new location]]></title><description><![CDATA[<p>How to move the <code>master</code> and <code>msdb</code> databases ands their logfiles to a new location. I used <code>L:\</code> as my log disk, and <code>E:\</code> as my database disk.</p>

<pre><code>USE master  
Go  
ALTER DATABASE model  
    MODIFY FILE ( NAME = 'modeldev' , FILENAME = E:\MSSQL\DATA\model.mdf' );
Go  
ALTER DATABASE model  
    MODIFY FILE ( NAME = 'modellog' , FILENAME = L:\MSSQL\DATA\modellog.ldf' );
Go  
ALTER DATABASE msdb  
    MODIFY FILE ( NAME = 'MSDBData' , FILENAME = 'E:\MSSQL\DATA\MSDBData.mdf' );
Go  
ALTER DATABASE msdb  
    MODIFY FILE ( NAME = 'MSDBLog' , FILENAME = 'L:\MSSQL\DATA\MSDBLog.ldf' );
Go  
</code></pre>

<p>See where your system dbs are located:  </p>

<pre><code>USE master  
Go  
SELECT  
    DB_NAME(database_id)  AS "Database Name"
  , name                  AS "Logical File Name"
  , physical_name         AS "Physical File Location"
  , state_desc            AS "State"
FROM  
    sys.master_files
WHERE  
    database_id IN (DB_ID(N'msdb'), DB_ID(N'model'), DB_ID(N'temp'))
ORDER BY  
    DB_NAME(database_id);
Go  
</code></pre>]]></description><link>http://evan.ly/move-sql-server-system-dbs/</link><guid isPermaLink="false">5184e02e-a6f5-4282-bd59-38be2f90917c</guid><category><![CDATA[MSSQL]]></category><category><![CDATA[SQL Server]]></category><category><![CDATA[MSSQL2014]]></category><dc:creator><![CDATA[Evan]]></dc:creator><pubDate>Fri, 24 Oct 2014 16:00:29 GMT</pubDate></item><item><title><![CDATA[Azure Web Site with SQL Server VM]]></title><description><![CDATA[<p>As of October 2014, you cannot use an SQL Server hosted as a VM as a database server for an Azure Website. This is because Azure Websites do not support / cannot be a member of an Azure Virtual Network. <em>Rats!</em></p>

<p>You will need to use a Azure Web Role instead.</p>

<p>This comprehensive-to-the-point-of-insanity post describes the differences in full: <a href="http://robdmoore.id.au/blog/2012/06/09/windows-azure-web-sites-vs-web-roles/">WINDOWS AZURE WEB SITES VS WEB ROLES</a> </p>]]></description><link>http://evan.ly/azure-web-site-with-sql-server-vm/</link><guid isPermaLink="false">21e6d4a6-81df-4228-99b2-427cc9ce0c25</guid><dc:creator><![CDATA[Evan]]></dc:creator><pubDate>Thu, 16 Oct 2014 11:27:48 GMT</pubDate></item><item><title><![CDATA[makecert.exe isn't as Spooky as you think]]></title><description><![CDATA[<p>Using <code>makecert.exe</code> to generate a self-cigned SSL certificate at commandline <a href="http://msdn.microsoft.com/en-us/library/bfsktky3(v=vs.110).aspx">isn't that bad</a>, but this is a nice GUI wrapper for it anyway.</p>

<p><a href="http://makecertui.codeplex.com/">http://makecertui.codeplex.com/</a></p>

<h6 id="bonushowtocreateanduseselfsignedprivatecertificateonwindowsserver2012r2">Bonus: How to create and use Self-Signed Private Certificate on Windows Server 2012 R2:</h6>

<p><a href="http://blogs.technet.com/b/blainbar/archive/2013/07/24/article-using-a-self-signed-private-certificate-makecert-exe-with-windows-azure-backup-vault-and-windows-server-2012-r2.aspx">Step-by-Step - Using a Self-Signed (Private) Certificate (makecert.exe) with Windows Azure Backup Vault and Windows Server 2012 R2</a></p>

<h6 id="moreinfoforformakecert">More info for  for makecert:</h6>

<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa386968(v=vs.85).aspx">MS Dev Centre</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/bfsktky3(v=vs.110).aspx">MSDN</a></li>
</ul>]]></description><link>http://evan.ly/makecert-exe-isnt-as-spooky-as-you-think/</link><guid isPermaLink="false">bc9c6392-d5a2-4572-8997-7a3b11fa3393</guid><category><![CDATA[SSL]]></category><category><![CDATA[Certificates]]></category><category><![CDATA[WindowsServer2012]]></category><dc:creator><![CDATA[Evan]]></dc:creator><pubDate>Mon, 13 Oct 2014 01:07:19 GMT</pubDate></item><item><title><![CDATA[Shrink SQL Database Transaction Log]]></title><description><![CDATA[<p>I was migrating a large-ish (~1GB) database from one server (MS SQL Server 2008) to another (MS SQL Server 2014), with a full transaction log. The transaction log uncompressed and restored was ~230GB.</p>

<p>As this was a new server, with a new set of backup and disaster recovery procedures, I decided to do a full backup, and then completely truncate the transaction log.   </p>

<p><strong>Your Transaction Log could be crucially important in a recovery scenario, do not just do this because it's big and you want it to be small - it has a purpose.</strong></p>

<h6 id="mssqlserver20142008r2">MS SQL Server 2014 (2008/R2+):</h6>

<pre><code>ALTER DATABASE &lt;DatabaseName&gt; set recovery simple
GO
CHECKPOINT
GO
DBCC SHRINKFILE (&lt;TransactionLog&gt;,1)
GO
ALTER DATABASE &lt;DatabaseName&gt; set recovery full
GO   
</code></pre>

<h6 id="mssqlserver2005">MS SQL Server 2005:</h6>

<pre><code>USE &lt;DatabaseName&gt;
GO
DBCC SHRINKFILE (&lt;TransactionLog&gt;, 1)
BACKUP LOG &lt;DatabaseName&gt; WITH TRUNCATE_ONLY
DBCC SHRINKFILE(&lt;TransactionLog&gt;, 1)
GO
</code></pre>

<p>Query: <a href="https://support.myeasyprojects.net/kb/a163/transaction-log-is-full_-how-do-i-shrink-it.aspx">Source</a> <br>
GUI: <a href="http://technet.microsoft.com/en-us/library/ms190757(v=sql.105).aspx">Source</a></p>]]></description><link>http://evan.ly/shrink-transaction-log/</link><guid isPermaLink="false">8ce560a8-ee18-414d-9183-9935120bd63b</guid><category><![CDATA[MSSQL]]></category><category><![CDATA[SQL Server]]></category><category><![CDATA[MSSQL2014]]></category><dc:creator><![CDATA[Evan]]></dc:creator><pubDate>Sat, 11 Oct 2014 05:01:06 GMT</pubDate></item><item><title><![CDATA[MS SQL Database Stuck Restoring]]></title><description><![CDATA[<p>When an MS SQL Server database is being restored, and either errors out or times out, and the staus of "Restoring" persists, even after a restart and a clear failure of the Restore operation, use the following to ge things back up, quick 'n dirty style.</p>

<ol>
<li><p>Stop MSSQLSERVER and related services.</p></li>
<li><p>Open your DATA folder, or wherever the .LDf and .MDf files are  stored (of the DB being restored).</p></li>
<li><p>Move the files to another folder</p></li>
<li><p>Restart SQLSERVER service (and related services).</p></li>
<li><p>Start my MS SQL Management Studio and delete the database in question.</p></li>
<li><p>Make sure the *.LDF and *.MDF files are gone from their original location folder.</p></li>
<li><p>A. Delete the database in question and attempt the restore from scratch; OR: <br>
B. Take the database Offline, copy the .LDF and .MDF files into the DATA directory (from Step 3).</p></li>
<li><p>Bring database Online.</p></li>
</ol>

<p><a href="http://social.msdn.microsoft.com/Forums/sqlserver/en-US/8dd1b91d-3e14-4486-abe6-e3a550bfe457/database-in-restoring-state-help?forum=sqldatabaseengine">Source</a>
<a href="http://stackoverflow.com/questions/520967/sql-server-database-stuck-in-restoring-state">Source</a></p>]]></description><link>http://evan.ly/ms-sql-database-stuck-restoring/</link><guid isPermaLink="false">90affec0-5c51-4ee2-ae3c-12fa6bea1dd6</guid><category><![CDATA[MSSQL]]></category><category><![CDATA[SQL Server]]></category><category><![CDATA[MSSQL2014]]></category><dc:creator><![CDATA[Evan]]></dc:creator><pubDate>Sat, 11 Oct 2014 04:53:36 GMT</pubDate></item><item><title><![CDATA[Connect VPN Automatically]]></title><description><![CDATA[<p>I created a server that needed to be connected to the VPN at all times. Here's three ways of doing it, but I used the last way - a scheduled task that repeatedly executes every 5 minutes after system start up, meaning if the VPN goes down and then up, it will still reconnect.</p>

<h2 id="applicationbasedtriggeringwindows8">Application based triggering (Windows 8+):</h2>

<ol>
<li>PowerShell: <code>Add-VpnConnectionTriggerApplication [-Name] &lt;string&gt; –ApplicationID &lt;String[]&gt; -PassThru</code> <br>
<a href="http://blogs.technet.com/b/networking/archive/2013/10/02/automatically-triggering-vpn-connections-and-vpn-diagnostics-enhancements-in-windows-8-1.aspx">Source</a></li>
</ol>

<h2 id="quickanddirtywindowsxp">Quick and Dirty (Windows XP+):</h2>

<ol>
<li>Save credentials in VPN connection  </li>
<li>Drag a shortcut to the 'Startup' folder <br>
<a href="http://answers.microsoft.com/en-us/windows/forum/windows_7-networking/how-to-automatically-connect-to-a-vpn-in-windows-7/65d5bbd3-f946-4755-9ac9-943651e0e556">Source</a></li>
</ol>

<h2 id="scheduleatasktoexecuteatsystemstartup">Schedule a task to execute at System Startup</h2>

<ol>
<li>Create a scheduled Task (I had it execute every 5 minutes after start indefinitely for auto-redial)  </li>
<li>Create batch script: <code>rasdial "My VPN Connection" &lt;username&gt; &lt;password&gt;</code> <br>
<a href="http://technet.microsoft.com/en-us/library/cc779544(WS.10).aspx">Source</a></li>
</ol>]]></description><link>http://evan.ly/connect-vpn-automatically/</link><guid isPermaLink="false">a3c1f801-824f-48f0-b777-57fff924172b</guid><category><![CDATA[VPN]]></category><category><![CDATA[automation]]></category><dc:creator><![CDATA[Evan]]></dc:creator><pubDate>Thu, 09 Oct 2014 05:12:47 GMT</pubDate></item></channel></rss>