In order to encrypt the parts of web.config file, esp: connectionStrings section the following command can be executed
Note down the name of the site in the IIS Web Server [Ex: ConnectionStringEncryptionTest]
Open windows command prompt as an administrator,
Execute the following command
C:\Windows\system32>%systemroot%\system32\inetsrv\APPCMD list site “ConnectionSt
SITE “ConnectionStringEncryptionTest” (id:4,bindings:http/*:99:,state:Started)
CD to the directory where the source code resides, and then execute the following command from a Visual Studio command prompt, again running as “Administrator”
aspnet_regiis.exe -pe "connectionStrings" -app "/" -site "4"
In case of the site being hosted in the default web site, we can use the “-app” parameter alone instead of the -site parameter.
Encryption Note 1
In order to restore a database that was backed up from an existing server or a remote server, the following sql command can be used
RESTORE DATABASE [MyDb] FROM DISK=’C:\Program Files\Microsoft SQL Server\MSSQL11.LOCAL\MSSQL\Backup\MyDb.bak’
WITH MOVE ‘MyDb’ TO ‘C:\Program Files\Microsoft SQL Server\MSSQL11.LOCAL\MSSQL\DATA\MyDbdata.mdf’, MOVE ‘CelloV45_log’ TO ‘C:\Program Files\Microsoft SQL Server\MSSQL11.LOCAL\MSSQL\DATA\MyDblog.ldf’
The following screenshots illustrate the various steps to get started with AD FS 3.0
Steps to get started with AD FS 3.0
- Create a web app [MVC 5] in VS
- Enable SSL and copy the URL
Add-AdfsClient -ClientId MyWebClient -Name MyWebClient -RedirectUri “https://localhost:44302/authcallback”
Hope this helps
In order to run a program as an administrator in Windows 7, right click that application > Compatibility > Check the “Run this program as Administrator” option and then click on “Apply” and “Ok”.
The following screenshot shows the properties window.
In order to stop visual studio from showing a file preview on clicking the file in the solution explorer, we can turn it off using the following step
Go To: Tools > Options > Environment > Tabs and Windows, you can disable it by unckecking “Solution explorer” under Preview tab.
This is applicable only for visual studio 2012 and higher
The following are the commands to change the system date time using the command prompt or from the batch files.
REM – the following line is used to set the date given after date as the system date
REM – the following command prints the system date, just to make sure that the change is in effect
The following code snippet can be used to run the IIS Express [8.0] in my case to be run from the command line.
The parameters are the path to the main directory, the target libraries [dll’s] should be in a folder called as “bin” inside this given path for the IIS to pick up and run.
The other parameter is the “port” which specifies which port should IIS Express listen for the incoming request. It also logs in the requests and the response status etc in the command line.
Sample : c:\Program Files\IIS Express>iisexpress.exe /path:”C:\Users\Saravanan\Documents\Visual Studio 2012\Projects\console_app_in_iis\console_app_in_iis” /port:8089