Category Archives: Infrastructure

How to install PowerShell using PowerShell

This cmdlet is tricky to find in Google because searching for install powershell using powershell won’t give you much. So here it is: Install-WindowsFeature PowerShell or Install-WindowsFeature PowerShell-V2 P.S. How to find exact name of particual Windows Feature to install? … Continue reading

Posted in Infrastructure | Tagged | Leave a comment

Certificate enrollment policy server URI format

If you’re trying to request a certificate from a non-domain joined computer using the Certificates console (CertMgr.msc or CertLM.msc) then you need to install on the server that hosts your Certificate Authority the following components: Certificate Enrollment Policy Web Service … Continue reading

Posted in Infrastructure | Tagged , | 2 Comments

How to configure RDG behind NAT

This week’s problem was to make working Remote Desktop Gateway located behind a NAT. Here’s the lessons learned: Issue an SSL certificate with the subject matching public DNS name (FQDN) Use the default port 3389/TCP, otherwise SSL certificate’s name won’t … Continue reading

Posted in Infrastructure | Tagged , | Leave a comment

How to start using recently uploaded Azure disk

After you uploaded a vhd and before you can start really using it you must mark it as a data disk or as an OS disk using the following command: Add-AzureDisk -DiskName ‘myvhd.vhd’ -MediaLocation http://example.blob.core.windows.net/container/myvhd.vhd -OS Windows

Posted in Infrastructure | Tagged , | Leave a comment

How to re-create symlinks of VM configs in Hyper-V using PowerShell

Hyper-V keeps VM configs at %ProgramData%\Microsoft\Windows\Hyper-V\Virtual Machines\ as symlinks to the original location. You may get them broken due to various reasons, e.g.: Server disaster and then recovery Upgrade to the next version of OS/Hyper-V and then rollback Migration of … Continue reading

Posted in Infrastructure | Tagged , | Leave a comment

How to select Azure subscription if you have more than one using PowerShell

If you have more than one Azure subscription in your account and try to upload a vhd using the instruction: Get-AzurePublishSettingsFile Import-AzurePublishSettingsFile d:credentials.publishsettings Add-AzureVhd -LocalFilePath d:my.vhd -Destination http://example.com/blob/container You may get an error saying that selected account doesn’t have given … Continue reading

Posted in Infrastructure | Tagged , | Leave a comment

Could not load file or assembly ‘Microsoft.AnalysisServices, Version=11.0.0.0

If you’re getting the following error upgrading TFS 2012 RTM to ver. 2012.3: TF255356: The following error occurred when configuring the Team Foundation databases: TF400711: Error occurred while executing servicing step Upgrade Warehouse for component UpdateWarehouseVersion during FinishInstallUpdates: Could not … Continue reading

Posted in Infrastructure | Tagged , , | Leave a comment

How to issue a self-signed certificate

To have a properly working SSL web site you have to assign a SSL certificate to it. A real one costs real money. Easily especially for development to issue a self-signed one. To create certificates I will use MakeCert.exe that … Continue reading

Posted in Infrastructure | Tagged | Leave a comment

How to start and stop windows service using single batch file

echo off set service=MyService for /f “tokens=3” %%a in (‘sc query “%service%” ^| find “STATE”‘) do ( if %%a==4 goto running goto stopped ) :stopped sc start %service% goto :eof :running goto :eof

Posted in Infrastructure | Leave a comment