Wednesday, August 08, 2018

The requested URL can't be reached - MuleSoft Mock Service Error

Error encountered while accessing Mock Service

The requested URL can't be reached

The service might be temporarily down or it may have moved permanently to a new web address.





for details refer 
https://docs.mulesoft.com/api-manager/v/1.x/accessing-your-api-behind-a-firewall

For testing purpose as quick fix "Bypass the proxy". Select option next to "Mock Service" stating " API is behind a firewall"





Actual fix before you implement it in Test/Production environment  is to  implement and apply a CORS Policy for your browser to be able to load the resources in the API behind your firewall and the Anypoint Platform’s browser tools

https://docs.mulesoft.com/api-manager/v/1.x/cors-policy




Sunday, March 11, 2018

Setting VPC as default VPC in AWS

Not a new question and i have been asked about it multiple times in past 2 years. How can i set VPC as "default VPC"

and answers is...

 
You cannot at this time using console/CLI/ API. If it is must contact AWS support. 

Wednesday, March 07, 2018

Mechanical Sympathy - Learning from Racing

Formula 1 world champion once stated

“You don’t have to be an engineer to be a racing driver, but you do have to have Mechanical Sympathy.” 
– Jackie Stewart, racing driver


This fits so well with technology. What Jackie meant is that understanding how a car works make you a better driver. This is so much true for writing code mainly in today's cloud technology. You need to have a basic understanding of hardware to create a good software.

Friday, February 09, 2018

Unable to connect IIS Express - Visual Studio 2017


 Delete your web application’s .vs\applicationhost.config and try rebuilding the application and launching.

.vs is a hidden folder under your solution's folder.

Sunday, January 28, 2018

AWS vs Azure Pricing

Handy Tool for estimating the price of services offered by AWS / Azure

AWS
https://calculator.s3.amazonaws.com/index.html  - Simple Monthly calculator
https://aws.amazon.com/tco-calculator/    - TCO Calculator


Azure
https://azure.microsoft.com/en-us/pricing/calculator/


Azure vs AWS

Not a surprising question by all the Cloud savvy peers!

Simple comparison data published here


Do check out the link 








Unable to connect - Azure Hybrid Connections

After you have configured the Azure App Service Hybrid connection, you might have a scenario when the Status of showing up as "Not Connected"

Azure Portal - > App Service -> Select App - > Networking - >Configure Hybrid connections

"Status : Not Connected"











One way to get more information on the issue is to run a get-hybridconnection powershell command in On-Prem client machine






In this case server was not connected to the internet. The server was placed in private subnet with no NAT gateway connectivity to internet. Once the server was connected to internet , issue was resolved.



Tuesday, November 14, 2017

ARN AWS - What is it and how can i make one for a resource?



If you are into AWS coding and access AWS resources , assign policy to user in AWS  pragmatically than you will be working with ARN a lot

The below 2 links are very handy to work with ARN

What is ARN 

How to define one?


Saturday, October 28, 2017

Instance does not have a volume attached at root (/dev/sda1)

Error :Instance does not have a volume attached at root (/dev/sda1) 

The error occurs when either a boot volume is missing or mapped to wrong device name. In this case EC2 instance is expecting the boot device name /dev/sda1 to be connected to the EC2 instance and unable to find it

The step is valid for EC2 instances is backed by EBS volumes i.e EBS is used for boot volumes rather than Instance Store



Note: To Understand more about Instance backed store and EBS backed store
refer this article Amazon EC2 Root Device Volume




To attach a root volume follow these steps.

  • Create   a new EBS Volume. Click on Volumes when in EC2 Instance page


  • Once EBS volume is created , right click and select Attach Volume
  • Select the EC2 instance in second textbox and enter the device name as "/dev/sda1"

  • Click Attach and restart the EC2 instance 




 Do leave comment if the solution works and even if it doesn't work . Thanks!










node -v ReferenceError: node is not defined

Trying to make node.js work with command node -v and end up with an error 

node -v ReferenceError: node is not defined 

You are probably trying to run the command in REPL  virtual environment


In order to check node.js version go to the folder with node.js files and run command from command prompt 








About REPL 


REPL ( Read- Eval-Print -Loop) is an virtual environment that comes with Node.js. It is tool to test simple Node.js javascript code. 



Tuesday, August 29, 2017

AWS Costing

If you ask any AWS geek , what is the biggest change they have noticed after moving On-Prem workloads to Cloud, you will mostly hear typical well known answers "better management" , "Less Operations overhead "...so on ..

One important trait which they aquire but will not acknowledge as they are not aware either is acquiring  a  "Mulah mindset" . [ for those who are wondering what mulah is, let me make it simple. mulah ~ money"]

Be an  Architect , IT manager, Developer one thing you need to be good at when working with AWS is costing. I know its hard , never had to deal with costing before so frequently  as old school style only involved painful money discussion during the budget cycle  when capital investment needs to be budgeted during initial stages of planning. 

Good part is, you don't need to have a Phd to understand costing but do need to spend some effort to get used to calculation. [ Paradigm shift is good thing]

AWS provides some good tools and lots of information to make life easier . Below are some useful links





Monday, August 28, 2017

AWS Elastic Beanstalk vs AWS CloudFormation

One question , i get in most of sessions when talking about Elastic Beanstalk is
"difference between Elastic beanstalk and CloudFormation"

I would like to keep this explanation very simple.

Use  Elastic Beanstalk when you want to deploy the application from supported developer tool and don't want to worry about provision of infrastructure prior to deployment. Elastic beanstalk framework will provision the infrastructure and deploy the code to servers.

Use CloudFormation  when you want a framework to define collection of related AWS resources and provision them in an orderly and predictable fashion


Important to Note 

AWS CloudFormation supports Elastic Beanstalk application environments as one of the AWS resource types


Detailed Information :

CloudFront 

Elastic Beanstalk









Tuesday, July 11, 2017

DIY vs AWS

Came across a very good , simple to understand comparison between AWS and DIY (Do-It Yourself)


DIY
AWS
Scale Up
Elastic Service(On-Demand/ When needed)
Assume Reliable Infrastructure
Assume Infrastructure Failure
Diverse Technical Expertise
Application Based Expertise
Application Unaware of Infrastructure
Application aware infrastructure
High Upfront Cost
Usage Based Cost
Design, Build, Operate
Limited Knowledge/ Shared Support
Showback , charge back challenging
Showback , Chargeback can be achieved by granular monitoring of usage

AWS vs Azure

Age old question .....

Check this comparison matrix

https://azure.microsoft.com/en-us/campaigns/azure-vs-aws/mapping/




Tuesday, August 02, 2016

Polyglot Solution - Database Scaling

I keep getting question around database scalability and generally seasoned architects have a good idea about scaling the Databases by providing the polyglot solution.

This one is for the newbies who would like to understand more about database scaling, mainly in today's cloud world wherein just using one type of database is not good architecture strategy for prime time rollout of applications for larger audience with huge data exchange potential

If you do a google search "Polygot Persistence" you will get a large number of document detailing the definition

If you are looking for document more technical in nature , download  this document
https://www.microsoft.com/en-us/download/confirmation.aspx?id=40327

Hope you have fun with Polyglotting!!!

Monday, March 30, 2015

Export Term Set to Excel - SharePoint Metadata Services - Powershell Script

# Add SharePoint PowerShell Snapin
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

 # File and Directory Location
$dirLocation = "D:\temp\TermStore\"
$date = get-date -Format yyyyMMdd
New-Item ($dirLocation + $date) -Type Directory | Out-Null
$file = New-Object System.IO.StreamWriter(($dirLocation + $date) + "\Terms.csv")

# Connect to site with MMS service connection
$taxonomySite = Get-SPSite -Limit 1
 
# Connect to Term Store in the Managed Metadata Service Application
$taxonomySession = Get-SPTaxonomySession -site $taxonomySite
$taxonomyTermStore =  $taxonomySession.TermStores | Select Name
$termStore = $taxonomySession.TermStores[$taxonomyTermStore.Name]

# Ampersands are stored as full width ampersands within the MMS database.
[Byte[]] $amp = 0xEF,0xBC,0x86

# CSV headers
$file.Writeline("Term Name,Id,Owner,CreatedDate,LastModifiedDate,TermSet,TermSetOpenStatus,GroupName")

# Term counter
$i = 0

foreach ($group in $termStore.Groups) {
    foreach ($termSet in $group.TermSets) {
        foreach ($term in $termSet.GetAllTerms()) {
            [Byte[]] $amp = 0xEF,0xBC,0x86;
            $file.Writeline("""" + $term.Name.Replace([System.Text.Encoding]::UTF8.GetString($amp), "&") + """" + "," + $term.Id + "," + $term.Owner + "," + $term.CreatedDate + "," + $term.LastModifiedDate + "," + $term.TermSet.Name + "," + $term.TermSet.IsOpenForTermCreation + "," + $term.TermSet.Group.Name);
            $i++
            Write-Host -ForegroundColor Cyan  "# Exporting TermSet: " -NoNewline
            Write-Host -ForegroundColor White $termSet.Name -NoNewline
            Write-Host -ForegroundColor Cyan  " Term: " -NoNewline
            Write-Host -ForegroundColor White $term.Name -NoNewline
            Write-Host -ForegroundColor Green " - Done"        
            }          
        }              
    }
$file.Flush()
$file.Close()

Write-Host
Write-Host -ForegroundColor Cyan  "# Exported " -NoNewline
Write-Host -ForegroundColor Green  $i -NoNewline
Write-Host -ForegroundColor Cyan  " terms"

Thursday, January 29, 2015

Wednesday, January 28, 2015

Error while crawling MySite users wherein MySite Web application is set up with SSL

Error Message:

sps3s://www.domain.com/site$$$people/bucketid=1/itemid=539

An unrecognized HTTP response was received when attempting to crawl this item. Verify whether the item can be accessed using your browser. ( WebExceptionStatus: TrustFailure The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.; SearchID = 22908598-2E57-4053-96F5-FBB55B029959 )


Solution:

Ensure the SSL cert is registered under "Manage trust" in SharePoint central Admin


Step 1: Export the SSL Certificate
  •  Open the cert from browser. Click on the lock  in address bar 
  • Go to the tab called “Certification Path”, select the root CA certificate and click “View Certificate”
  • Select the “Details” tab and click on “Copy to file”
  • Save the file in your machine

Step 1: Import it in SP Central Admin


  • Go to SP Central Administration  / Security / Manage Trust. Click on “New”, add the root CA certificate from the local machine 



This should do the trick



Monday, January 05, 2015

User Profile not showing up with proper domain name: User profile sync issues

User are showing up with  different domain name after full profile sync.

For e.g . I have all the users defined in ABC domain but after sync some users are showing up as different domain.

expected users in User Profile : ABC\user1
but showing up as : DEF\user1

Note: There is no domain with name DEF but it still shows up that way.

One of the possible reason is Domain netbios name is different than the FQDN of the domain

Check out article below , section Permission requirements: Domain netbios name is different than the FQDN of the domain

http://blogs.msdn.com/b/russmax/archive/2010/03/20/sharepoint-2010-provisioning-user-profile-synchronization.aspx


Monday, September 08, 2014

New-SPTrustedIdentityTokenIssuer Exception of type 'System.ArgumentException' was thrown

Error Message 

New-SPTrustedIdentityTokenIssuer: Exception of type 'System.ArgumentException' was thrown.

Solutions

Ensure:


  • The name of the SPTrustedLoginProvider is not been using
  • The length of the name is less than 50
  • The certificate is not been using

Wednesday, September 03, 2014

Missing on {ServerName} Error even after patch is Installed

Are you getting an error "Missing on  {Servername}" even after installing the patch?

Something like this ?

Try running the powershell command  Get-SPProduct –local  in the server where the patch is showing up as missing  and if are having good day, it will take care of the issue and on refresh the message will go away


If running the command gives you Goose bumps, than dont worry its just a get operation. More here :
http://technet.microsoft.com/en-us/library/ff607885(v=office.15).aspx




Monday, June 09, 2014

User Profile Service Synchronization Service Stuck in "Stopping" State

1.  stsadm -o enumservices > c:\services.txt - This will provide list of services

2.  stsadm -o provisionservice  -action stop -servicetype "Microsoft.Office.Server.Administration.ProfileSynchronizationService, Microsoft.Office.Server.UserProfiles, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" -servicename FIMSynchronizationService

Thursday, June 05, 2014

User Profile Synchronization Service not Starting - SharePoint 2010

Started my task with lot of excitement to try out cross farm service publishing. Plan was to try  publishing the User profile service, so started configuration for user profile. 

---Tried to add new connection 

Boom...Errorr...User Profile Synchronization Service is not started. Ok. So that's not a big pain right. 

---browsed to services page and clicked on "Start" for user profile synchronization service....

Boom...service stopped. 

---Scratching my head for next hour , google google google ...bing bing bing....

At last one suggestion found , try restarting SharePoint Timer Services

--- Restarted timer services 

Boom ...service started :-)


 

Thursday, March 20, 2014

SharePoint 2010 Site Inventory

If you keep on hearing the question

How can we get inventory of all the site collection/ subsites in a web application including the created and last modified date of these sites.

well you don't have to look for third party tool. Simple old fashioned powershell is  a saviour

Get-SPWebApplication  http://.contoso.com | Get-SPSite -Limit All | Get-SPWeb -Limit All | Select Title, URL, lastitemmodifieddate , created | Export-CSV C:\Inventory.csv -NoTypeInformation


Enjoy!!!

 

Thursday, March 06, 2014

Object Expected JavaScript error in Start Page (start.aspx) - SharePoint 2013


Issue:

After creating new site collection when the user tries to browse main page, following error throws up and screen is stuck in "Working on it ....."  for eternity.....................



Resolution :
Browse to "Site feature" - > Look for "Minimal Download Strategy" - > [Deactivate the feature]


Browse to home page and the scripting error should have gone.....



Wednesday, January 15, 2014

Test host process exited unexpectedly - Failed to queue test run: Unable to start the agent process


Today i was taking session of developer group and talking about the Visual Studio 2013 Test tools. Well it seems they did tried using it and bumped into error("Test host process exited unexpectedly - Failed to queue test run: Unable to start the agent process")  on first trial. 

Well It was a easy fix. As the user was running 64 bit processor based VM, he was geeting an error as Test project setting were set to 32 bit. Just change the test project settings. 

Test-> Test Settings->Default processor Architecture ->Select x64

Tuesday, January 07, 2014

MVC / MVP / MVVM design pattern. What's the difference?

Classic discussion very much prevalent  in architecture community. Though the concepts are quite old now and there are numerous applications build using design patterns, i hear the confusion of these patterns even today.

It's much easier to do white boarding and explain but for some of my readers, i keep getting an email to share an article. Well found one really good webcast from Joe homnick wherein a sample is converted to explain multiple patterns:

Check this out :
http://channel9.msdn.com/Events/TechEd/NorthAmerica/2011/DPR305 [ Its a old tech end presentation but am sure my readers will appreciate this one]

By the way it also explains the scenario to use such patterns and to my SharePoint geek frds, i hope you are following the MVP.

Let me know your thoughts after listening to this one.




Monday, January 06, 2014

SharePoint 2013 Apps vs SharePoint 2013 Solution

For readers looking for MS article , here is the link. Don't want to take spend your time with my thoughts:
http://msdn.microsoft.com/en-us/library/dn268593.aspx

For readers who are interested and have to time to read my thoughts and provide there 2 cent, read below.....

A lot of organizations are now looking forward to migrate their SharePoint Farm from previous version to SharePoint 2013. But as soon as they start the analysis they bump into multiple new terms, methodology and implementation practices.

One of them which is introduced in SharePoint 2013 in App Model. Well a similar a lean model was tested as "Sandbox Solution" in 2010 version but with least success. It had it's own pain points and developers ended up creating server side controls(Webparts/ User controls).

As word is moving towards cloud platform and concept of applications, SharePoint 2013 took similar route and is now offering App model. Actually it's a pretty smart move. Such framework aligns SharePoint technology in line with open technology which is very much prevalent in today's world wherein there are multiple ways of displaying data(well mobile phone are game changer in today's world) and secondly this approach also takes care of pain of maintenance by SharePoint admin team who were having hard time explaining why the infrastructure is not holding up and tends to break down frequently( Thanks to badly written code by development teams..).

So going to back to question of " do we really need to go app way or should be stick to the old way of coding and deploying in server" .


My take " Though it will take time to learn and implement apps for all the existing customization, it's still worth looking into and converting the most complex ones to SharePoint App, mainly the apps which have longer shelf life in organization"

Read and let me know your thoughts. I understand its not as straightforward and quick for make these changes.

I would like to know the apps you are working which might be a good contender. I am always open for discussion..


Enjoy ..the changing landscape of technology..




Thursday, January 02, 2014

Windows Azure Websites / Cloud Services and VM's Confusion

I keep getting same query from my technology friends and clients on the main difference between  the Windows Azure Website/ Cloud Service and VM's. 

Which one should be considered while rolling out a cloud solution. I understand it can be quite confusing  for a non techie or even for IT management who are not into technology jargons. 

I generally tend to provide the below MS links to understand the difference but the article is still too technical.


So below are my take in simple terms. (Hopefully!!!)

Website Option is for you if :
  • Are you looking for hosting websites with good UI  with simple data transaction which does not deal with high transaction data and probably won't require complex engine in backend business tier.
  • If you don't want want to worry about maintenance of infrastructure(patches..)
  • Would like to have websites which can load balance as per traffic 
  • Provides templates to create websites using wordpress, joompla , droopal .....

Cloud Service (Platform as Service)
  • You can dealing with applications which involves high transaction and required scaled up business tier
  • You need remote access to servers to perform additional configuration e.g.
    • Scripting IIS
    • custom deployment of framework and configuration etc.
  • If you don't want want to worry about maintenance of infrastructure(patches..)
  • Would prefer to have staging and production environment

Virtual Machines ( Infrastructure as service)
  • This option is similar to the server management today done on -Premise. The only difference is that the server is hosted by Microsoft but management of infrastructure and application is your responsibility.
  • This option is good when you are moving your current application as-in in the cloud. The advantage of having VM in azure is that you will get servers on demand up and running in any part of world and won't have to worry about scaling your own datacenters
Now the most important part. COSTING!!!!

Well MS have a neat tool for calculating price. Give it a shot:


Hope this gets your understanding better than when you started reading this article..(I HOPE :-))

Rags


Tuesday, November 19, 2013

Datasource Menu disabled in Dashboard Designer


Are you trying to create a new performance point report but "Datasource" menu is disabled?

The reason of this behavior of absence of App "Dataconnection Library for Performancepoint" 

In order to create this app, Click on Site contents - > Add an App - > "DataConnections Library for PerformancePoint"

Once the App is added, "Datasource" menu will be available.




Monday, November 18, 2013

Unable to connect to SQL Server 2012 Analysis Services from Dashboard Designer (SharePoint 2013)

Are you trying to connect to SQL Server 2012 Analysis Cube using Performance point designer? Are you getting any errors? or it seems as if nothing is happening.

Probably your mind will having multiple thoughts  "What's the problem with this, i hate performance point , What should i even search in google without any error message" ............goes on and on and on

Well i had similar thoughts , till i came across an below article..( Thanks to Omicron)
http://omicron-llama.co.uk/2012/07/18/connecting-to-analysis-services-on-sql-server-2012-from-performancepoint-on-sharepoint-2013-preview/#comment-3864


Cause:
PerformancePoint here isn’t using ADOMD.NET 11, the SQL Server 2012 version

Fix:
Download and install  version 10 of ADOMD.NET installer which comes with the SQL Server 2008 R2


Wednesday, November 13, 2013

How To's SharePoint 2013 ( Apps)

Good samples for all the developers planning to start apps development in SharePoint 2013.

http://msdn.microsoft.com/en-us/library/jj901636.aspx


It probably might feel too much initially but taken a step at a time, makes it much easier to understand and fun to implement.

:-)


Apps are disabled on this site


Created an app and while  deploying the app to portal, visual studio threw and error with failed deployment.

Error:
Apps are disabled on this site

Good thing is there is lots of article our there to resolve this issue. In my case it was lack of basic configuration which needs to be performed before deploying the Apps.


Follow steps, mentioned in link below to avoid this error.

How to: Set up an on-premises development environment for apps for SharePoint



Enjoy Apps.

-Rags

Friday, August 30, 2013

Expand VHD - Increase Capacity of Virtual Hard disk

well, i was stuck with 25 GB of in my virtual hard disk and started my favorite computer operation "Google" to find solution and surprisingly  found one pretty quickly

Here is goes.

Run below command sequentially in command prompt

diskpart                                    [open command prompt and type  this command]
Select vdisk file="Path of VHD"
list vdisk
expand vdisk maximum=40000                    [Size in MB]
attach vdisk
list disk
Online Disk
list volume
select volume                         [Select disk volume to be exteded]
extend
List Volume
detach vdisk
exit

Wednesday, July 17, 2013

SPHierarchyDataSourceControl changes is not reflecting in tree view control


You get a simple requirement
Hide some of the components from Tree view control of SharePoint 2010. ( Though hiding specific items is still not supported out of box and you probably will have to use custom tree view control)

Solution:
Make changes to master page specifically to node "SPHierarchyDataSourceControl "

You can add following properties:
IncludeDiscussionFolders="false"
ShowDocLibChildren="false"
ShowFolderChildren="false"
ShowListChildren="false"


You make changes and refresh page to see the change and to your surprise tree view doesn't change at all and still showing all components. Now you feel changes in your blood pressure and probably thinking what shoud i do next ....


Well probably if you find this article you will save some some of artery damage due to high pressure :-).

Details are give in below link
http://support.microsoft.com/kb/2558891

In nutshell, SharePoint 2010 feature(Metadata Navigation and Filtering Feature)  generally overrides your master page settings, To get this working change the ControlId of Delegate Control that wraps the SPHierarchyDataSourceControl from TreeViewAndDataSource to    TreeViewAndDataSourceCustom.


Relief!!!



Friday, May 24, 2013

People Picker Control - SharePoint 2010 ( Customizing Search Results)

For customizing search results in people picker configured for Windows Authentication in Classic Mode or claims mode check below link
http://technet.microsoft.com/en-us/library/gg602075(v=office.14).aspx


To customize search results in people picker configured in different authentication mode, you need to define custom claims provider:
http://technet.microsoft.com/en-us/library/gg602068(v=office.14).aspx#about








Thursday, May 23, 2013

WSS_Logging DB SharePoint 2010 ( Usage Reporting)

SharePoint 2013 is out  but i still get the queries regarding the usage reporting capability of SP 2010.

Some pointers below.

  • The data displayed by SharePoint Web Analytics is pulled from "WSS_Logging" database. It aggregates all of the raw logging data accumulated in the text files under the 14 hive and imports it into logging database. 

  • Web Analytics Service Retention Policy 


          To persist the usage data in WSS_Logging for longer time you can change the retention policy
           by  changing the settings in central administration

          Central Administration - > Application Management - > Manage Servcie Application
          - >Select Web Analytics Service ->Click "Properties" in ribbon ->Change Data Retention
          Period up  to 25 months.


  • The data import from Logs files to Database is performed by Timer Job " Microsoft SharePoint Foundation Usage Data Import"
         You can set the frequency of timer job depending on load on your server.



  • More Information on Logging DB can be found at : 

          http://technet.microsoft.com/en-us/library/hh769360(v=office.14)

Wednesday, May 01, 2013

Implementing SharePoint DR (SQL Server Log Shipping Method)

Great article on SharePoint DR implementation using SQL Server Log Shipping.

http://technet.microsoft.com/en-us/library/dd890507(office.12).aspx



Thursday, April 18, 2013

TagCloud Webpart not available SharePoint 2010

Do you feel like breaking your head is less painful than looking for Tagcloud webpart ?.

Well than don't worry your head is probably safe is you haven't yet given  up searching :-)


Just Activate the PortalLayouts feature

stsadm -o activateFeature -name "PortalLayouts" -url "http:///sites/" -force

Wednesday, April 17, 2013

Usage Data Retention in SharePoint Database - SharePoint 2013

Check the current retention policy using :
Get-SPUsageDefinition

By default it's 14 days.

To change the retention use the following script:

Set-SPUsageDefinition -Identity "Page Requests" -DaysRetained 31


Complete definition of this command can be found at :
http://technet.microsoft.com/en-us/library/ff607542.aspx


Wednesday, March 27, 2013

SharePoint 2010 WSP BackUp

Simple script but very helpful considering the fact that it's easy to mess up and than end up trying to find  old WSP in your source control tool. (If your team has been updating the source control :-)).


Always take WSP backup from SharePoint Farm before you deploy revised one.


$farm = Get-SPFarm
$file = $farm.Solutions.Item("{WSPNAME}.wsp").SolutionFile
$file.SaveAs("C:\Backup\{WSPNAME}.wsp")



-Rags

Friday, February 15, 2013

Claim Based Security explained in real simple way

Check this article if you are trying to understand claims based security
http://msdn.microsoft.com/en-us/library/ff359108.aspx


Sunday, February 10, 2013

Office Web Apps and SharePoint Services(Excel, Word, Powerpoint Services)

I always get queries from peers and clients on difference between SharePoint 2010 and Office Web Apps. They are completely different component. Office Products have tight integration with SharePoint using the Office Web Apps feature installed in SharePoint.

Note : You can run Office Webs Apps using Office Web Apps server even if you do not have SharePoint in your organization.

Useful Links:

Office Web Apps:
http://technet.microsoft.com/en-us/library/jj219456.aspx


Office Web App Server Planning:
http://technet.microsoft.com/en-us/library/jj219435.aspx

Office Web Apps Deployment :
http://technet.microsoft.com/en-us/office/ee815687.aspx

Office Web Apps platform comparison
http://technet.microsoft.com/library/ff925944(office.14).aspx

Excel Services vs Excel Web App
http://blogs.technet.com/b/tothesharepoint/archive/2010/07/21/excel-services-and-excel-web-apps-common-different-features.aspx

Licensing
http://office.microsoft.com/en-us/buy/microsoft-office-volume-licensing-suites-comparison-office-FX101825637.aspx




Tuesday, January 15, 2013

Detect Content DB orphans and delete in a SharePoint 2010 Farm thru Windows PowerShell


Detect orphans in Content DB:

SCRIPT
----------------------------------------------------------------------------------------------------------------------------------
if ( (Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null ) 
     {Add-PSSnapin Microsoft.SharePoint.Powershell}
       set-location "C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\BIN"
         $SPFarm = Get-SPFarm
           $contentWebAppServices = (Get-SPFarm).services | ? {$_.typename -eq "Microsoft SharePoint Foundation Web Application"} 

               foreach ($SPWebApp in $contentWebAppServices.WebApplications)
                 {
                   foreach ($SPSite in $SPWebApp.Sites)
                     {
                       Write-Host "Going thru Site Collection" $SPSite.Url
                         $SPSite.Url >> C:\SPSiteOrphanObject.txt
                           stsadm.exe -o databaserepair -url $SPSite.Url -databasename $SPSite.ContentDatabase.Name >> C:\SPSiteOrphanObject.txt
                             $SPSite.Dispose()
                               }}
                              ----------------------------------------------------------------------------------------------------------------------------------
                              • To delete orphan objects from a particular site use following script 
                              if ( (Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null ) 
                               {Add-PSSnapin Microsoft.SharePoint.Powershell}
                               set-location "C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\BIN"
                              stsadm.exe -o databaserepair -url -databasename  >> C:\SPSiteOrphansDelete.txt

                              Note
                              • You can get the Content DB of a particular site collection using below script
                              $site=Get-SPSite
                              write-host $site.ContentDatabase.Name
                              
                              
                              
                              
                              
                              

                              Monday, September 17, 2012

                              Service Unavailable – HTTP Error 503. (SharePoint 2010)

                              When you try to load the page you probably might end up with following error:
                              Service Unavailable – HTTP Error 503

                              First Shot

                              Check Application Pool, most probably it will be turned off. Turn it on and test the portal.


                              If App Pool shuts down once more than

                              Second Shot 


                              Check the eventvwr
                              I had following error message:(not pasting the whole message but the important pointer)

                              The exception message is: Exception has been thrown by the target of an invocation.. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: The farm is unavailable. at Microsoft.SharePoint.Administration.Claims.SPSecurityTokenServiceManager.


                              If your error message is same as mine then try this resolution:

                              Open Application Pool - > Advanced Settings - > Enable 32 Bit Application and Set to FALSE


                              Hope that fixes your error.

                              Have Fun!!!




                              Tuesday, September 11, 2012

                              Admin SVC must be running in order to create deployment timer job

                              Error

                              This error message pops up when solution is installed using powershell command

                              Install-SPSolution -identity test.wsp -webapplication http://test/

                              Resolution

                              Method 1:
                              Go to Administrative Tools > Services and browse to find “Sharepoint 2010 Administration”.
                              Start  Service

                              Method 2:
                              Start-Service SPAdminV4





                              Error Deploying WSP using Visual Studio 2010

                              Issue:

                              Error occurred in deployment step 'Activate Features': Feature with Id  is not installed in this farm, and cannot be added to this scope.


                              Resolution:
                              This is mainly due to inability of Visual Studio 2010 to deploy solution in farm.try deploying the WSP using powershell command in each web front end SharePoint server in farm.

                              Check this article:
                              http://blogs.msdn.com/b/calvarro/archive/2011/11/06/sharepoint-2010-amp-visual-studio-2010-error-ocurred-activate-features-feature-with-id-installed-in-this-farm-cannot-be-added-to-this-scope.aspx

                              Wednesday, July 11, 2012

                              Storing values in SharePoint 2010 Property Bag

                              Property bags?
                              Property bags are place to store metadata or properties.The property bags are implemented as hash table consisting of property names and values.

                              Property bags can be defined at following levels:


                              • Farm (SPFarm class) 
                              • Web application (SPWebApplication class) 
                              • Site collection (SPSite class) 
                              • Site (SPWeb class) 
                              • List (SPList class)


                              Property bags can be set using SharePoint designer and programmatically.

                              Using SharePoint Designer 2010:

                              • Open Site in SharePoint Designer 2010
                              • Go to Site->Site Options
                              • Click on Parameters tab where you can see the list of existing properties, from the same place you can even perform add/modify/remove actions.


                              Programmatically

                              To Read the Set Key:


                              SPSite siteCollection = new SPSite("");
                              SPWeb website = mySite.RootWeb;
                              string MyValue = website.AllProperties["KeyName"]);

                              To Set the Value
                              SPSite siteCollection = new SPSite("  ");
                              SPWeb website = mySite.RootWeb;
                              website.Properties.Add(" KeyName ", "KeyValue");
                              website.Properties.Update






                              Monday, June 25, 2012

                              Adding DLL to WSP SharePoint 2010

                              In order to add custom dll to WSP Package , follow these steps:

                              • Create new Empty SharePoint Project 
                                • File->New->Project->SharePoint(2010)->Empty SharePoint Project 
                                • In second screen provide test site URL
                                • Select "Deploy as Farm Solution"

                              • Expand package node and double click on Package.package file 




                              • Click on "Advanced" Tab



                              • Add the Custom dll's using the "Add" button



                              • Save the project, compile and deploy. Custom dll will be part of WSP.

                              Enjoy!!!!

                              Rags

                              Wednesday, June 13, 2012

                              SharePoint Foundation 2010 Best Practice

                              Sandbox Solution Capabilities

                              Complete Article :http://msdn.microsoft.com/en-us/library/ee231562.aspx

                              In Nutshell


                              Sandboxed solutions support the following capabilities and elements:

                              Content Types/Fields

                              Custom actions

                              Declarative workflows

                              Event receivers

                              Feature callouts

                              List Definitions

                              List Instances

                              Module/files

                              Navigation

                              Onet.xml

                              SPItemEventReceiver

                              SPListEventReceiver

                              SPWebEventReceiver

                              Support for all Web Parts that derive from System.Web.UI.WebControls.WebParts.WebPart

                              Web Parts

                              WebTemplate feature elements (instead of Webtemp.xml)

                              Visual Web Parts

                              Sandboxed solutions do not support the following capabilities and elements:

                              Application Pages

                              Custom Action Group

                              Farm-scoped features

                              HideCustomAction element

                              Web Application-scoped features

                              Workflows with code



                              Monday, June 11, 2012

                              Get Machine Name and IP ASP.NET

                              My previous post has an function which is now deprecated.
                              http://metahat.blogspot.com/2009/09/get-client-machine-name-aspnet.html
                              System.Net.Dns.GetHostByAddress(Request.UserHostAddress).HostName


                              Following are the new function to get client machine name and IP address:

                              string[] computer_name = System.Net.Dns.GetHostEntry(Request.ServerVariables["remote_addr"]).HostName.Split(new Char[] { '.' });
                                                      
                              string machineName=computer_name[0].ToString();
                              string ipAddress  =Request.ServerVariables["REMOTE_ADDR"].ToString();

                              Wednesday, June 06, 2012

                              Powershell Commands (Mostly Used)

                              Here is collection of commonly used powershell cmdlets.
                              More details :
                              http://technet.microsoft.com/en-us/library/ee906565.aspx

                              Add-SPSolution(Uploads a SharePoint solution package to the farm.)
                              Add-SPSolution -LiteralPath c:\contoso_solution.wsp

                              Remove-SPSolution(Removes a SharePoint solution from a farm.)
                              Remove-SPSolution -Identity contoso_solution.wsp

                              Install-SPSolution(Deploys an installed SharePoint solution in the farm.)
                              Install-SPSolution -Identity contoso_solution.wsp -GACDeployment

                              Uninstall-SPFeature(Uninstalls an installed feature definition.)
                              Uninstall-SPFeature -path "MyCustomFeature"

                              Add-SPUserSolution(Uploads a new sandboxed solution to the solution gallery.)
                              Add-SPUserSolution -LiteralPath c:\contoso_solution.wsp -Site http://sitename

                              Disable-SPFeature(Disables an installed SharePoint Feature at a given scope.)
                              Disable-SPFeature –identity "MyCustom" -URL http://somesite

                              Enable-SPFeature(Enables an installed SharePoint Feature at the given scope.)
                              Enable-SPFeature –identity "MyCustom" -URL http://somesite

                              Get-SPFeature(Returns the SharePoint Features based on a given scope)
                              Get-SPSite http://somesite | Get-SPWeb –Limit ALL |%{ Get-SPFeature –Web $_ } | Select DisplayName,ID -Unique

                              Install-SPFeature(Installs a SharePoint Feature by using the Feature.xml file.)
                              Install-SPFeature -path "MyCustomFeature"

                              Uninstall-SPFeature(Uninstalls an installed feature definition)
                              Uninstall-SPFeature -path "MyCustomFeature"


                               

                              SharePoint 2010 101 Code Samples

                              Monday, June 04, 2012

                              Error while Installing SharePoint Foundation 2010 to Win 7 Desktop

                              Error:
                              Setup is unable to proceed due to following error(s):
                              This product required Windows Server 2008 Service pack 2 or above.
                              Correct the issue(s) listed above and re-run set up.

                              Solution:
                              In Order to install SharePoint 2010 Foundation/Office Server 2010, you need to make changes to configuration settings.

                              Refer article below:
                              http://msdn.microsoft.com/en-us/library/ee554869.aspx

                              -Rags

                              Friday, June 01, 2012

                              Deploying SharePoint 2010 Package using VS 2010

                              Well today i created a solution package and tried to deploy it to SharePoint 2010 portal hosted in separate server.Though it sounds such a straight forward step, i managed to get a nice long error message stating :


                              Error occurred in deployment step 'Recycle IIS Application Pool': Cannot connect to the SharePoint site. Make sure that this is a valid URL and the SharePoint site is running on the local computer. If you moved this project to a new computer or if the URL of the SharePoint site has changed since you created the project, update the Site URL property of the project

                              So i was back to my favorite page "google.com". (Not sure what would have been life of a techi if search engines would not had been there ;-) .)

                              So i came to know that currently Visual Studio 2010 only supports deployment of packages to locally installed SharePoint instance.So no remote support yet.

                              if you want to deploy to remote server than there are multiple ways to achieve this one :
                              http://msdn.microsoft.com/en-us/library/aa544500(office.14).aspx



                              Error while deploying package using Visual Studio 2010 to SharePoint 2010

                              Errors
                              Cannot access the local farm. Verify that the local farm is properly configured, currently available, and that you have the appropriate permissions to access the database before trying again.

                              OR


                              Error occurred in deployment step 'Recycle IIS Application Pool': The local SharePoint server is not available. Check that the server is running and connected to the SharePoint farm.


                              Reason

                              The error pops up when userid doesn't have access to configuration and content DB.

                              Resolution
                              There are 2 ways to resolving this issue.

                              Preferable Method(1st method): 
                              Use Power shell command to provide user id access to SharePoint DB's.

                              • "Add-SPShellAdmin -UserName domain\username" This will add permissions to the config database in SharePoint 2010
                              • "Get-SPContentDatabase -WebApplication " This will return information on the content database for the desired web application
                              • "Add-SPShellAdmin -UserName domain\username -database " This will add permissions to the content database for the desired web application



                              2nd method:
                              Add the userid as DBOwner to Configuration and Content DB. Though this is not best practice but will at least get you going.

                              -Rags




                              Design a Zero Trust pipeline using Confidential Computing

                                Check out reference diagram to design a zero trust pipeline https://blogs.oracle.com/cloud-infrastructure/designing-zero-trust-and-resilie...