Author Archives: Usman Afzal

About Usman Afzal

Usman afzal, Microsoft Certified technology specialist in SharePoint server 2010, ASP.net Web Applications and SharePoint Server 2007; focusing on Microsoft Products.

Tour of user interfaces of SharePoint 2013 by Asif Rahmani

So, here is another free Webinar from Share-Point Videos.Com. Space is limited as always so register here

Reserve your Webinar seat now at:

https://www1.gotomeeting.com/register/981957809

Description and Agenda (As received)

Presenter:
Asif Rehmani – http://www.sharepoint-videos.com/about/

SharePoint MVP and Microsoft Certified Trainer

Audience: All SharePoint users familiar with SharePoint 2010 or SharePoint 2007

Session Abstract:

SharePoint 2013 brings with it a bold new look compared to the earlier versions. Want to know what has changed exactly? Attend this session! The ‘Metro’ look of sites, the introduction of ‘Apps’, an easier way to manage your documents, the radical new way to style your site and more are all discussed in this session.

This webinar is sponsored by http://www.SharePoint-Videos.com. During and after the webinar, we’ll take your questions and try to answer them to the best of our ability.

Prerequisites:
None

Date:  Wednesday, September 12, 2012
Time:  2:00 PM – 3:15 PM EST

Thanks to Share-Point Videos.Com

Webinar on Effectively manage enterprise projects with Project Server 2010

So, here is another free Webinar from Share-Point Videos.Com. Space is limited as always so register here

Reserve your Webinar seat now at:
https://www1.gotomeeting.com/register/709521273

Description and Agenda (As received)

Presenter:
Dux Raymond Sy – SharePoint MVP, PMP – http://www.meetdux.com

Audience: Project teams, managers, decision makers

Session Abstract:

In today’s project-centric work environment, the ability to coordinate multiple projects with distributed teams, and making high-level strategic decisions based upon consolidated project progress, risk and resource usage information is critical. Microsoft Project Server 2010 is an enterprise-wide project management platform designed to meet these challenges.

In this session, you learn to optimize Project Server to manage enterprise projects. You’ll also learn how to:

  • Build an Enterprise Project Management (EPM) solution based on Microsoft Project Server
  • Create a portfolio of projects using new and existing project plans
  • Manage and optimize project resources across the enterprise
  • Collaborate with geographically distributed project team members using Project Web Access
  • Identify and assign responsibility for project risks and issues
  • Monitor and analyze performance of enterprise projects and portfolios
  • Leverage SharePoint 2010 collaboration tools

This webinar is sponsored by SharePoint-Videos.com. During and after the webinar, we’ll take your questions and try to answer them to the best of our ability.

Pre-requisites:
Fundamental knowledge and experience of Project Management and familiarity with Windows, Microsoft Office and SharePoint is assumed.

Date:  Monday, November 14, 2011
Time:  2:00 PM – 3:15 PM EDT

Thanks to Share-Point Videos.Com

Elevating PowerShell Script Execution Permissions

Hi, This blog entry is one of first of the series on PowerShell Scripts. You will find in this blog how can you run the PowerShell Scripts from your PowerShell Command Prompt on Windows 7 or Windows server 2008 and above.

The script execution is by default is disabled by Microsoft to protect the environment against malicious scripts, but you can run the scripts from your trusted sources by elevating and enabling the scripts execution policy.

image

*Sorry for a bad quality picture here, please try opening the picture in new window to see the parts.

If you follow the snap shot as above and Run the power shell as an administrator you will get the following shell. Try checking the Execution Policy on your computer by running the following command

Get-ExcecutionPolicy

SNAGHTML589113b

In this case you are not allowed to run scripts on your machine and you will get the following error while executing any script

SNAGHTML6056631

Now this is the time to set the execution policy to the one you required to run the scripts. You have different options here as follows

Restricted – This is the default execution policy on installation. When this policy is in effect, script execution is disabled.

AllSigned – When the execution policy is AllSigned, scripts can be executed, but they must be Authenticode-signed before they will run.

RemoteSigned – RemoteSigned requires that all scripts that are downloaded from a remote location must be Authenticode-signed before they can be executed.

Unrestricted – When the execution policy is unrestricted, PowerShell will run any script. It will still prompt the user when it encounters a script that has been downloaded however, this is the least secure setting.

In Our case we are going to use RemoteSigned option and we will run the following command

Set-ExecutionPolicy RemoteSigned –Force

SNAGHTML6074aa5 

Now if we Run the same Script as before we will be able to do that as follows

image 

In the screen above the script just open a Balloon in the System tray. I will be sharing the script in my next post.

So, after performing the above steps now you can run the scripts in your power shell and exploit the feature of this excellent creation

Information on this Post is helpful, Please don’t forget to rate or comment.

Visit us on http://www.bytebeats.com

Webinar on 10/19/2011 at 2pm Eastern – Using SharePoint Designer in the ‘Real World’

This is a good opportunity to get free webinar by someone like Asif Rehmani. Following is the detail of the event as received.

See more at http://bytebeats.com/2011/10/19/webinar-on-10192011-at-2pm-eastern-using-sharepoint-designer-in-the-real-world/

SharePoint Automation – Power Shell Scripts

Hi,

How often I think about PowerShell Scripts while working on SharePoint 2007 and deploying solutions using Stsadm. Though, it worked well for me, but never got control as promissed by the powershell scripts.

Recently, I got chance to start working and ext exploring my experiences with PowerShell Scripts for deployment of SharePoint 2010 solution and doing a lot with Microsoft .Net object model siting outside Visual Studio and working in colorful Power Shell Snap In 🙂

Today, I’m gonna share a piece of work that we (SharePoint developers) needs to deal with almost in every SharePoint project, and that’s the deployment of SharePoint Solutions. You may find the contents of this post on google, but I tried to keep things simple and planned.

First of all, for those who are new to Power Shall, you may be wondering about the Commands that you can use with power shell. I use a better way to keep them with me, try the following command in Power Shell to dump all available SharePoint commands in a text file.

Get-Command -module Microsoft.SharePoint.PowerShell > textfilename.txt

Once You have all the commands, its easy for you to go and explore commands based on your requirements, I would say the Get-help is really helpful here 🙂

Now let’s play with Power shell and deploy our Solution files for the SharePoint Farm.

Lets take the case where we have some solution files, and we want to write a script that will Add and deploy solution files to specified Farm or Web.
To make it clean and dynamic I use a xml Configuration file for deployment.

<ProjectName>
<Solutions>
<Solution Name=”Usman.SP.Projects.Utilities.wsp” Path=”C:\Users\afzalu\PS_Scripts\Installer\Usman.SP.Projects.Utilities.wsp” CASPolicies=”false” GACDeployment=”true”>    </Solution>
<Solution Name=”Usman.SP.Projects.Branding.wsp” Path=”C:\Users\afzalu\PS_Scripts\Installer\Usman.SP.Projects.Branding.wsp” CASPolicies=”false” GACDeployment=”true”>    </Solution>
<Solution Name=”Usman.SP.Projects.Core.wsp” Path=”C:\Users\afzalu\PS_Scripts\Installer\Usman.SP.Projects.Core.wsp” CASPolicies=”false” GACDeployment=”true”>    </Solution>
<Solution Name=”Usman.SP.Projects.Pages.wsp” Path=”C:\Users\afzalu\PS_Scripts\Installer\Usman.SP.Projects.Pages.wsp” CASPolicies=”false” GACDeployment=”true”>    </Solution>
<Solution Name=”Usman.SP.Projects.RequestHandling.wsp” Path=”C:\Users\afzalu\PS_Scripts\Installer\Usman.SP.Projects.RequestHandling.wsp” CASPolicies=”false” GACDeployment=”true”>    </Solution>
<Solution Name=”Usman.SP.Projects.WebStructure.wsp” Path=”C:\Users\afzalu\PS_Scripts\Installer\Usman.SP.Projects.WebStructure.wsp” CASPolicies=”false” GACDeployment=”true”>    </Solution>
<Solution Name=”Usman.SP.Projects.Presentation.wsp” Path=”C:\Users\afzalu\PS_Scripts\Installer\Usman.SP.Projects.Presentation.wsp” CASPolicies=”false” GACDeployment=”true”>
<WebApplications>
</WebApplications>
</Solution>
<Solution Name=”Usman.SP.Projects.Sites.wsp” Path=”C:\Users\afzalu\PS_Scripts\Installer\Usman.SP.Projects.Sites.wsp” CASPolicies=”false” GACDeployment=”true”>
<WebApplications>
</WebApplications>
<Solution>
</Solutions>

</ProjectName>

For Now, I just take an example where I need to deploy the solution, but ofcourse with this design you can also do feature activation and other webapplication chnages (we will do that in some other post).

Now let’s see how easily we can add a Power Shell Script to add these solution to specific WebApplication or Farm

# add SharePoint Powershell snapin
add-PSSnapin Microsoft.Sharepoint.powershell
write-host “———————————————————-” -foregroundcolor Green
write-host “Deploying Soultions” -foregroundcolor Green

if($args){

# Getting web.Config File

$configFile = $args[0];

if ([string]::IsNullOrEmpty($configFile)) { return }

[xml]$solutionsConfig = Get-Content $configFile

if ($solutionsConfig -eq $null) { return }

$solutionsConfig.DLW.Solutions.Solution | ForEach-Object{
[string]$path = $_.Path
[bool]$gac = [bool]::Parse($_.GACDeployment)
[bool]$cas = [bool]::Parse($_.CASPolicies)
$webApps = $_.WebApplications.WebApplication

#Add the solution

$spAdminServiceName = “SPAdminV4”
[string]$name = Split-Path -Path $path -Leaf
$solution = Get-SPSolution $name -ErrorAction SilentlyContinue
Write-Host “Adding solution $name…”
$solution = Add-SPSolution $path

#Deploy the solution

if (!$solution.ContainsWebApplicationResource) {
Write-Host “Deploying solution $name to the Farm…”
$solution | Install-SPSolution -GACDeployment:$gac -CASPolicies:$cas -Confirm:$false
}
else {
if ($webApps -eq $null -or $webApps.Length -eq 0) {
Write-Warning “The solution $name contains web application resources but no web applications were specified to deploy to.”
return
}
$webApps | ForEach-Object {
Write-Host “Deploying solution $name to $_…”
$solution | Install-SPSolution -GACDeployment:$gac -CASPolicies:$cas -WebApplication $_ -Confirm:$false
}
}
# Restarting the Service
Stop-Service -Name $spAdminServiceName
Start-SPAdminJob -Verbose
Start-Service -Name $spAdminServiceName

#Block until we’re sure the solution is deployed.

do { Start-Sleep 2 } while (!((Get-SPSolution $name).Deployed))
} #End of $solutionsConfig.Solutions.Solution | ForEach-Object
}
write-host “Solutions Deployed Successfully” -foregroundcolor Green

write-host “———————————————————–” -foregroundcolor Green

Sorry for Formating, but it takes too much time so I prefer sharing things rather than spending lots of time on formating.
Once you run the above code you will see a very informative Power Shell Window, that will show you all the deployment setps in a friendly way so your deployement team can really enjoy the deployment.
You can use the below code to uninstall and delete the solution files using the same XML file

# add SharePoint Powershell snapin

add-PSSnapin Microsoft.Sharepoint.powershell

write-host “———————————————————-” -foregroundcolor Green

write-host “Deleting Soultions” -foregroundcolor Green

if($args){

# Getting web.Config File

$configFile = $args[0];

if ([string]::IsNullOrEmpty($configFile)) { return }

[xml]$solutionsConfig = Get-Content $configFile

if ($solutionsConfig -eq $null) { return }

$solutionsConfig.DLW.Solutions.Solution | ForEach-Object{

[string]$name = $_.Name

$spAdminServiceName = “SPAdminV4”

$solution = Get-SPSolution $name

# Un-Install Solutions

if($solution.Deployed){

if (!$solution.ContainsWebApplicationResource) {

Write-Host “Un-Installing solution $name from the Farm…”

$solution | UnInstall-SPSolution -Confirm:$false

}

else{

Write-Host “Un-Installing solution $name …”

$solution | UnInstall-SPSolution -AllWebApplications:$true -Confirm:$false

}

Stop-Service -Name $spAdminServiceName

Start-SPAdminJob -Verbose

Start-Service -Name $spAdminServiceName

#Block until we’re sure the solution is deployed.

do { Start-Sleep 2 } while (((Get-SPSolution $name).Deployed))

}

} #End of $solutionsConfig.Solutions.Solution | ForEach-Object

# Remove Solutions

$solutionsConfig.DLW.Solutions.Solution | ForEach-Object{

if(!$solution.Deployed){

[string]$name = $_.Name

Write-Host “Getting uninstall solution $name…” -foregroundcolor YELLOW

$unInstallSolution = Get-SPSolution $name

$unInstallSolution | Remove-SPSolution -Confirm:$false

Write-Host “Solutoin $name… Removed” -foregroundcolor YELLOW

}

}

}

write-host “Solutions Deleted Successfully” -foregroundcolor Green

write-host “———————————————————–” -foregroundcolor Green

Activate Site Directory Site Template in SharePoint 2010

If you are wondering about the “Site Directory Sit Template” in SharePoint 2010, then follow this blog post to use this feature onto your Share Point Server.

Actually, this feature is made Hidden by Intentionality for upgrade purpose from Share Point Server 2003 to 2010, and you need to make this feature visible and than activate for your specific web site.

Follow these steps to get rid of Hidden Directory Site Template Feature.

1. Open C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\1033\XML

2. Open webtempsps.xml for Eidt

3. Find section for “Site Directory” and change Hidden value

<Configuration ID="0" Title=”Site Directory” Type=”0″ Hidden=”FALSE” ImageUrl=”/_layouts/1033/images/template_site_dir.png” Description=”A site for listing and categorizing important sites in your organization. It includes different views for categorized sites, top sites, and a site map.” DisplayCategory=”Enterprise” VisibilityFeatureDependency=”5F3B0127-2F1D-4cfd-8DD2-85AD1FB00BFC”>

4. After that open command prompt and browse to
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN

5. Activate the feature ” SharePoint Server Publishing Infrastructure” onto your site (if not activated earlier)

6. Run following commaned:
stsadm.exe -o activatefeature -id 5F3B0127-2F1D-4cfd-8DD2-85AD1FB00BFC –url http://yoursite

After these steps, go to your site and Create a new site using Site Directory Site Template, it is there now :-).

Useful Information, Rate It.