Showing posts with label SharePoint. Show all posts
Showing posts with label SharePoint. Show all posts

Tuesday, August 15, 2017

All about SharePoint Licensing

SharePoint involves lots of components and hence the licensing of those components can be challenging . So the below video will help you grasp some of the terminology and practices involved in SharePoint Licensing. We have also look into different pain areas of software licensing and have tried to understand cost with small and medium farm setup


 Download the slide deck : https://drive.google.com/file/d/0B5Qpxy54-PeeWFdYZlRHRnViNnM/view?usp=sharing

Saturday, December 29, 2012

How to identify if user is in a particular permission group using Web Service

Some days back I was faced with a task of changing the behavior of the list new /Edit form based on the user presence in a particular permission group.

Problem Statement: If the user was present in “Members” group I need to hide some fields and if he was present in the “Owners” Group, I need to show all those fields.

Solution: By calling the GetGroupCollectionFromUser operation of the Users and Groups Web Service, you can determine whether your user is in the group. I got this from Marc post.

The only small issue fixed in that post code was that it worked not on every browser, hence I need to modify it a little to support cross browser. I used responseText instead of responseXML.

  1. First we need to add JavaScript directives to the page, I have provided the CDN link which you can directly use or can download the libraries to use it.
  2. 
    
    
    
    
    
  3. Then include the below script to check the current logged user’s group
  4. 
    


    These scripts can be used on CEWP to achieve the desired result.

Sunday, June 17, 2012

Disk Size Report of all SharePoint Databases using PowerShell into Mailbox


As an administrator I always use to find the database size of all the SharePoint DB. Which I use to do with the PowerShell script, but lately I got pissed off doing this same activity everyday so I decided finally, write a PowerShell script and using a windows scheduler automate this. So now I will get all these details on my mail every morning when I come to office.
 


So what the below script do………………

The script first section (1) is used to get information about the mail exchange. 

The script second section (2) is, for-each loop which gets content database of all the web application. This then writes this information on to a file.

The script third Section (3) is, for-each loop which get all the SharePoint database size details which is also appended to the file.

Finally the fourth section (4) sends this information on a mail as an attachment.
The result of this code will be:

So the full code for download is :
#Get SharePoint Content database sizes 
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue 
$date = Get-Date -Format "dd-mm-yyyy"
 
#Variables that you can change to fit your environment 
$TXTFile = "C:\ContentDatabase_$date.txt" 
$SMTPServer = "yourmailserver" 
$emailFrom = "SharePointReports@company.com" 
$emailTo = "youradmin@company.com" 
$subject = "Content Database size reports" 
$emailBody = "Daily/Weekly/Monthly report on Content databases"
 
$webapps = Get-SPWebApplication 
foreach($webapp in $webapps) 
{ 
    $ContentDatabases = $webapp.ContentDatabases 
    Add-Content -Path $TXTFile -Value "";
    Add-Content -Path $TXTFile -Value "----------------------------------------";
    Add-Content -Path $TXTFile -Value "Content databases for $($webapp.url)" 
    Add-Content -Path $TXTFile -Value "----------------------------------------";
    Add-Content -Path $TXTFile -Value "";
    foreach($ContentDatabase in $ContentDatabases) 
    { 
        $ContentDatabaseSize = [Math]::Round(($ContentDatabase.disksizerequired/1GB),2) 
        Add-Content -Path $TXTFile -Value "-     $($ContentDatabase.Name): $($ContentDatabaseSize)GB" 
    } 
} 
 
$databases = Get-SPDatabase
Add-Content -Path $TXTFile -Value "";
Add-Content -Path $TXTFile -Value "------------------------------------";
Add-Content -Path $TXTFile -Value "Content Size of Individual Databases";
Add-Content -Path $TXTFile -Value "------------------------------------";
Add-Content -Path $TXTFile -Value "";
foreach($database in $databases)
{
    Add-Content -Path $TXTFile -Value  " $($database.Name)  ---- $($database.disksizerequired/1024/1024) MB"    
}
 
if(!($SMTPServer) -OR !($emailFrom) -OR !($emailTo)) 
{ 
Write-Host "No e-mail being sent, if you do want to send an e-mail, please enter the values for 
            the following variables: $SMTPServer, $emailFrom and $emailTo." 
} 
else 
{ 
Send-MailMessage -SmtpServer $SMTPServer -From $emailFrom -To $emailTo -Subject $subject -Body $emailBody 
                 -Attachment $TXTFile 
}
Now How to use windows scheduler to automate this mailer on a daily basis you can refer to my earlier post http://sharepointdrive.blogspot.sg/2012/04/automating-sharepoint-site-backup-using_14.html

Please let me know if you face any difficulty in understanding or running this up. Also for more information on PowerShell go to http://sharepointrelated.com/

Sunday, April 29, 2012

Content Organizer in SharePoint 2010

The Content Organizer feature is a new routing feature that allows you to automatically route documents to different libraries and folders within a site collection. The document can be automatically routed to various document libraries based on the metadata.
Simply put it allows us to create rules that examine the content type and site columns of a document that was uploaded and move it someplace else.

It can also be used to do some housekeeping activities for the document Library for e.g. making sure that not any folder in a document Library contain more than specified no of records. If this happens it will create another folder and move the records to the new folder.

The requirement which came to me by a client was to develop a page where Legal department will upload the entire document and based on the metadata I will be pushing them in their respective document libraries. This will solve also the problem where sometime user don’t put the metadata on the document and just upload them. Hence now with this technique if they don’t provide the metadata the files will not reach the destination and will be just there sitting in the drop library.

How to Setup the Document Library

Now first we need to activate the Content Organizer Site Feature.


Once you activate this feature, there are three things get added to the site
-    A document Library called “DropOffLibrary”
-    Two new Links in Site Setting: Content Organizer Settings and Content Organizer Rules

The “Content Organizer Rules” link will take you to the rules List where you can add a new rule based on the content type and then you can specify condition based on the site column of the content type.

Lets see this with an Example.

Lets first see the high level diagram of what we are trying to achieve.
a)   We created a Content Type based on Document Content Type called “Support Request”.
       There we included new columns
                Support Name (Text Column)
                Support Type (Choice Column) whose option is IT Support and HR Support

b)    Then we created two documents Library based on the above content Type called HR Support and IT Support.

c)    Then we create Two Content Organizer Rule. Check out below how I have created “HR Document Rule”

d) In a similar way create a second rule called “IT Document Rule” where just change the condition to the one as shown below.

e) Now when we upload the document in a document library and from the Support Type dropdown column if we select HR Support the document will auto redirect to HR Support Library and we will get a similar message like the one shown below.


This is really a cool feature of SharePoint as we don’t require bothering where to push the document. If the rules are well placed just upload the document and it will reach its place.