Wednesday, March 20, 2019

Using powershell on Azure

This is create VM on Azure cloud, Setup SQL Server and migrate SQL server onprem to cloud.


  1. Go to https://shell.azure.com/powershell   
  2. Create a resource group


PS Azure:\> new-AzResourceGroup -Name SAIK

cmdlet New-AzResourceGroup at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
Location: EastUS


ResourceGroupName : SAIK
Location          : eastus
ProvisioningState : Succeeded
Tags              :

Azure:/ PS Azure:\> New-AzVm -ResourceGroupName "SAIK" -Name "SqlVM" -Location "East US" -VirtualNetworkName "SAIKNet" -SubnetName "SAIKSubnet" -SecurityGroup "SAIKSecurityGroup" -PublicIpAddressName "SAIKPublicIpAddres s" -OpenPorts 80,3389 cmdlet New-AzVM at command pipeline position 1 Supply values for the following parameters: Credential User: nkanne Password for user xxxxx: ******************** ResourceGroupName : SAIK Id : /subscriptions/xxx/resourceGroups/SAIK/providers/Microsoft.Compute/virtualMachines/SqlVM VmId : xxx Type : Microsoft.Compute/virtualMachines Location : eastus Tags : {} HardwareProfile : {VmSize} NetworkProfile : {NetworkInterfaces} OSProfile : {ComputerName, AdminUsername, WindowsConfiguration, Secrets, AllowExtensionOperations} ProvisioningState : Succeeded StorageProfile : {ImageReference, OsDisk, DataDisks} FullyQualifiedDomainName : xxx.East US.cloudapp.azure.com

work in progress.

Wednesday, February 22, 2017

size of sitecollection

 $site = get-spsite sitecollection
 $site.Usage.Storage/1024/1024/1024

Thursday, February 16, 2017

Block files from uploading them in SharePoint

Goto Central Admin -> Security -> Define Blocked File types
and add the extension of the file type that you want blocked.
this needs to be done for each web application.

If you have multiple web applications, you can use following code

$wApps = Get-SpWebApplication
foreach ($wApp in $wApps) {
>> $Extensions = $wApp.BlockedFileExtensions
>> $Extensions.Add(".Msg")
>> $wApp.Update()
>> }


Thursday, December 11, 2014

Image does not show up on webapplication when I published it to IIS 7

I have published my webapplication to IIS7 on windows 2008R2 server.
The images were not showing up on the page, everything else seems to be working

I checked the handler mapping on the web site
Sites-> Default Web Site

double Click on Handler Mappings

Static File is missing



Goto Windows Features 
Enable  "Static Content" feature WWW services-> Common HTTP Features

Wednesday, December 10, 2014

Copying file bin\WebApplication .dll to obj\Release\AspnetCompileMerge\Source\bin\WebApplication .dll failed. Could not find file 'bin\WebApplication .dll'

If you get the following error while publishing
Error 9 Copying file bin\WebApplication3.dll to obj\Release\AspnetCompileMerge\Source\bin\WebApplication3.dll failed. Could not find file 'bin\WebApplication3.dll'. 0

open application.csproj file in notepad
and see if you have Webapplication#.dll and .pdb file in the csproj file
remove them from the csproj

<ItemGroup>
    <Content Include="bin\ProjectName.dll" />
    <Content Include="bin\ProjectName.pdb" />
    <Content Include="bin\WebApplication3.dll" />

    <Content Include="bin\WebApplication3.pdb" />

   <Content Include="bin\WebApplication3.dll.config" />


we can publish it now

Wednesday, December 3, 2014

edmx compilation issues

In visual Studio 2013, I have added ADO.Net Entity Data Model.
After rebuilding the project, I could not use the entity data connection in my entity data source.
The error I was getting was
The metadata specified in the connection string could not be loaded. Consider rebuilding the web project to build assemblies that may contain metadata

to resolve it,  open the newly created xyzentities.edmx file in notepad and change the Provider


      <Schema Namespace="xyzMapEntitiesModel.Store" Provider="System.Data.SqlClient" ProviderManifestToken="2012" Alias="Self" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">


<Schema Namespace="xyzMapEntitiesModel.Store" Provider="System.Data.SqlClient" ProviderManifestToken="2008" Alias="Self" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">

Monday, June 23, 2014

Finding out the process template for a project in TFS 2013

Go to the project collection in which the project is located
Find the project ID using the

select * from tbl_Projects where project_name like '%XXXXXXXX%'
PartitionId  project_id  project_name  state last_update
    1 F4C0DF3A-A3BD-458E-9356-8D071897D1C8 XXXXXXX WellFormed 2014-04-09 13:49:28.513


        select * from tbl_project_properties where project_id = 'F4C0DF3A-A3BD-458E-9356-8D071897D1C8'

            PartitionId project_id name value
              1 48833EE1-8CBE-43A6-8653-4CF16E10FD56 Microsoft.TeamFoundation.Team.Default 60004022-0dfe-4225-a358-ec942aab72bd
                1 48833EE1-8CBE-43A6-8653-4CF16E10FD56 MSPROJ <?xml version="1.0" encoding="utf-8"?>
                  <MSProject>
                      <Mappings>
                          <Mapping WorkItemTrackingFieldReferenceName="System.AreaPath" ProjectField="pjTaskOutlineCode9" />
                            <Mapping WorkItemTrackingFieldReferenceName="System.AssignedTo" ProjectField="pjTaskResourceNames" />
                              <Mapping WorkItemTrackingFieldReferenceName="System.Id" ProjectField="pjTaskText10" ProjectName="Work Item ID" />
                                <Mapping WorkItemTrackingFieldReferenceName="System.IterationPath" ProjectField="pjTaskOutlineCode10" ProjectName="Sprint" />
                                  <Mapping WorkItemTrackingFieldReferenceName="System.Reason" ProjectField="pjTaskText14" />
                                    <Mapping WorkItemTrackingFieldReferenceName="System.Rev" ProjectField="pjTaskText23" />
                                      <Mapping WorkItemTrackingFieldReferenceName="System.State" ProjectField="pjTaskText13" ProjectName="State" />
                                        <Mapping WorkItemTrackingFieldReferenceName="System.Title" ProjectField="pjTaskName" />
                                          <Mapping WorkItemTrackingFieldReferenceName="System.WorkItemType" ProjectField="pjTaskText24" />
                                            <Mapping WorkItemTrackingFieldReferenceName="Microsoft.VSTS.Common.BacklogPriority" ProjectField="pjTaskNumber1" ProjectName="Backlog Priority" />
                                              <Mapping WorkItemTrackingFieldReferenceName="Microsoft.VSTS.Scheduling.RemainingWork" ProjectField="pjTaskRemainingWork" ProjectUnits="pjHour" IfSummaryRefreshOnly="true" />
                                                <LinksField ProjectField="pjTaskText26" />
                                                  <SyncField ProjectField="pjTaskText25" />
                                                  </Mappings>
                                                  </MSProject>
                                                    1 F4C0DF3A-A3BD-458E-9356-8D071897D1C8 Process Template Microsoft Visual Studio Scrum 2013