SharePoint 2010 Diagnostic Logging

Posted: 9th May 2012 by JR52MAR in Microsoft, SharePoint

Here is the link on how to configure Diagnostic Logging on SharePoint 2010… put here for reference :-)

 

http://technet.microsoft.com/en-us/library/ee748656.aspx

The Visio 2010 Viewer allows anyone to view Visio drawings and diagrams (created with Visio 5.0, 2000, 2002, 2003, 2007 or 2010) inside their Microsoft Internet Explorer version 5.0 or later Web browser.

Download: http://www.microsoft.com/downloads/details.aspx?FamilyID=f9ed50b0-c7df-4fb8-89f8-db2932e624f7&displaylang=en

You can use this viewer inside a content editor web part by pasting the following into the Content Editor Source Editor (for SharePoint 2010, add the HTML Form web part instead).

 <OBJECT classid=”CLSID:279D6C9A-652E-4833-BEFC-312CA8887857″
codebase=”http://www.microsoft.com/downloads/info.aspx?na=90&p=&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId=d88e4542-b174-4198-ae31-6884e9edd524&u=http%3a%2f%2fdownload.microsoft.com%2fdownload%2f6%2ff%2f5%2f6f569198-e7d0-49af-b162-54a11f38d301%2fvisioviewer.exe”
id=”viewer1″ width=”100%” height=”400″>
<param name=”BackColor” value=”16777120″>
<param name=”AlertsEnabled” value=”1″>
<param name=”ContextMenuEnabled” value=”1″>
<param name=”GridVisible” value=”0″>
<param name=”HighQualityRender” value=”1″>
<param name=”PageColor” value=”16777215″>
<param name=”PageVisible” value=”1″>
<param name=”PropertyDialogEnabled” value=”1″>
<param name=”ScrollbarsVisible” value=”1″>
<param name=”ToolbarVisible” value=”1″>
<param name=”SRC” value=”http://www.wssdemo.com/Shared%20Documents/carpark.vsd”>
<param name=”CurrentPageIndex” value=”0″>
<param name=”Zoom” value=”-1″>
</object>

This is subject to Microsoft’s Licence Terms & Conditions :-)

Taken from http://www.wssdemo.com/Pages/visio.aspx?menu=Articles

Visio Services – Force Data Refresh

Posted: 18th April 2012 by JR52MAR in Microsoft, SharePoint

Copied from http://blogs.msdn.com/b/chhopkin/archive/2010/09/28/force-data-refresh-for-published-diagrams.aspx

 

When you publish Visio diagrams with Visio 2010 Professional or Visio 2010 Premium using the new Web Diagram file format (VDW), Visio Services can render these diagrams in the browser.  Better yet, if these published diagrams are linked to a supported data source Visio Services can refresh the linked data in the diagram as well, including updating any Data Graphics.  Click here for an overview of Visio Services.

If you have viewed data connected diagrams using Visio Services then you are familiar with the security prompts warning you that the diagram you are viewing is linked to a data source and enabling Refresh will update the data linked to the diagram from the external data source, ensuring that you trust the data source the diagram is linked to.

clip_image004

I have been asked many times now how to disable this prompt so that diagrams are always refreshed and the user is never prompted to trust the operation.

DO THIS AT YOUR OWN RISK

The reason for this security prompt is to allow the user the chance to trust the query that is defined in the published Visio diagram.  If you force the refresh this will cause the embedded queries for all published Visio diagrams to be trusted for all users that view the diagram in the browser.

ForceRefresh = true

To alter this behavior you will need to add a setting to the web.config file for the Visio Services service application.

The web.config file can be found here…

C:\Program Files\Microsoft Office Servers\14.0\WebServices\Shared\VisioGraphicsServer\

Edit this file in NotePad and simply add the following section and setting to the configuration section if it does not already exist…

<appSettings>

<add key=”ForceRefresh” value=”true” />

</appSettings>

After making the modifications, the web.config file should look like this…

clip_image002

You will need to recycle the application domain for the Visio Graphics Service service application to pick up this change to the web.config file immediately, or you can  wait for it to pick up this change on its own.

 

Ok so you should be able to access Workspaces from within Windows Explorer as shown here

 

If its not there then

On the Windows task bar, click the Windows Start button and the click your name (profile).

Then you can drag and drop the Workspace folder as a shotcut under the favorite folder at the left pane of the Windows Explorer.

and hey preston you can now access fro mwindows explorer and save direct into your workspace :-)

 

Change SharePoint site icon for all sites

Posted: 12th March 2012 by JR52MAR in Microsoft

I have just had a request from the boss, she wants to see the company logo as the icon for all sharepoint sites, now manually you can do this by going to each site and click Site Settings, “Title, description and icon.” or use powershell…..

Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue
$siteUrl = "https://intranet.braindumpblog.co.uk"
$siteLogo = "/SiteAssets/logo.png"
$rootSite = Get-SPSite $siteUrl
$allWebs = $rootSite.AllWebs
foreach ($web in $allWebs) {
Write-Host "Updating " + $web.Title + " " + $web.Url
$web.SiteLogoUrl = $siteLogo
$web.Update()
}

Ok so I am surprised there is no functionality with SharePoint 2010 to import from a CSV file…. so I have created a powershell script just for this single requirement, its dirty but works!!!!

Not the addition of Get-SPUser and Get-Date for the fields which require the people picker / date method.

***PowerShell Script***

$csv = Import-Csv ‘C:\ImportFile.csv‘

$web = Get-SPWeb -identity “https://intranet.braindumpblog.co.uk/”

$list = $web.Lists["ListNameHere"]

foreach ($row in $csv) {
$item = $list.Items.Add();
$item["Title"] = $row.Title
$item["Requested By"] =Get-SPUser $row.RequestedBy -web https://intranet.braindumpblog.co.uk
$item["System"] = $row.System
$item["Description"] = $row.Description
$item["Priority"] = $row.Priority
$item["Sponsor"] =Get-SPUser $row.Sponsor -web https://intranet.braindumpblog.co.uk
$item["Assigned to"] =Get-SPUser $row.AssignedTo -web https://intranet.braindumpblog.co.uk
$item["Work Status"] = $row.WorkStatus
$item["Current Action / Update"] = $row.CurrentActionUpdate
$item["Due Date"] =Get-Date $row.DueDate
$item.Update()
}

********Here is the format for the CSV file*******

Title,RequestedBy,System,Description,Priority,Sponsor,AssignedTo,WorkStatus,CurrentActionUpdate,DueDate
“Powershell”,”braindumpblog\jr52mar”,Other,” Test”,Low,”braindumpblog\jr52mar”,”braindumpblog\jr52mar”,”New”,”text here”,03/12/12

Powershell – Add to SharePoint List

Posted: 29th February 2012 by JR52MAR in Microsoft, SharePoint
Tags: ,

Ok so I have created a team site list which is published on a publishing site.

I want to show a list of all teams sites on a publishing on a different site collection so i used the following script to export all sites and a few select details to a csv file, which i then created a sharepoint list for and added to the page.

get-SPSite -identity https://intranet.braindumpblog.co.uk/teams/sites | Get-SPWeb -limit all | Select-Object -Property Title, Description, ParentWeb, IsMultilingual, RequestAccessEnabled, RequestAccessEmail, RecycleBinEnabled, ServerRelativeURL | export-csv c:\scripts\Team_site_Setup_Audit.csv

 

The next challenge was to update the list as an when new sites are created, for which i have already created a powershell scripts for. so i ahev amended this to add in the new details to the list, here is the site creation script with the add to list section at the bottom

 

$SiteTitle = Read-Host “Enter The Site Name Here”

$SiteDescription = Read-Host “Enter a brief description of the site”

$SiteUrl = Read-Host “Enter the Url of the team site after https://intranet.braindumpblog.co.uk/  eg site1/subsite1″

$SiteOwner = Read-Host ”Enter the Site Owner in the form Domain\user ie braindumpblog\jr52mar”

$FullSiteURL = “https://intranet.braindumpblog.co.uk/teams/sites/$SiteURL”

$spWeb = Get-SPWeb https://intranet.braindumpblog.co.uk

$spList = $spWeb.GetList(“en/TeamSites/Lists/TeamSitesList”)

$newItem = $splist.Items.Add()

$newItem["Title"] = “$SiteTitle”

$newItem["Description"] = “$SiteDescription”

$URL = “$FullSiteURL, $SiteTitle”

$newitem["Site Title and Link"] = $URL

$newitem["Site Owner"]=Get-SPUser $SiteOwner -web

$newItem.Update()

 

Url for DocIDs

Posted: 16th January 2012 by JR52MAR in Microsoft

I can never remember how to do a URL for a DocID with BRAIN-197-3 or any other DocID for that matter, well here it is.

http://intranet.braindumpblog.co.uk/_layouts/DocIdRedir.aspx?ID=BRAIN-197-3

 

Now I needed to create the Site….. again keeping it simple and standard.

$DeptSiteName = Read-Host “Enter the Department Site Name”

$DeptSiteURL = “https://intranet.braindumplblog.com/en/Departments/$DeptSiteName”

$DeptSiteDescription = read-host “Enter brief description of site here”

$DeptSiteTemplate = “BLANKINTERNET#0″

New-SPWeb -Url $DeptSiteURL -Name $DeptSiteName -Template $DeptSiteTemplate -Description $DeptSiteDescription

so i saved the file and then when i run the ps1 file it asked me for the Department Site name, I entered TESTING which is the same thing i entered in Part One

The site was created….. right i better add some permissions, but that will have to wait till later. ;-)

As you can probably tell from the vast number of SharePoint Blog posts lately, I have been working on a SharePoint project. We have just launched a new intranet using SharePoint 2010 and we are expecting a large number of publishing sites requests from the internal departments. As part of the governance framework, we have created standard groups for each site type and these groups are to be managed within AD and not SharePoint. We also have deployed the SharePoint Servers to the root domain and all the users are in child domains. We have variations applied, a challenging infrastructure design also…. so this was not going to be easy.

My High level approach was taking me down the following phases and requirements (and over the next few blogs will cover each one in detail)

  • Creation of the AD Groups in the ROOT and CHILD domains, and wanted to standardise as much information as possible. – Part One
  • Creation of the Site itself – Part Two
  • Creation of the SharePoint Groups, again standardising as much information as possible – Part Three
  • Add the AD Groups into the SharePoint Groups and assign the site permissions – Part Four
  • Nest the CHILD Domain Groups into the ROOT Domain Groups as all security is controlled by the ROOT Domain (we plan to add more child domains in soon) – Part Five
  • Change the Master Page in all variations of the site to the custom page. – Part Six

Before I start…. I am not a master in powershell and in fact have only just started to explore it…. but i am impressed!

Ok so here goes.

Script 1 – Creation of the AD Groups in the ROOT and CHILD Domains

Our governance framework decreed that all site groups would be called the same (the only difference would be the Dept Site Name, so i thought about using a variable for this. I wanted to create four domain local security groups in the ROOT Domain and three global security groups in the CHILD domain. So here are the groups I will create $DeptSiteName would be the variable.
CHILD Domain Groups
GLS-CHILD-$DeptSiteName-Owners
GLS-CHILD-$DeptSiteName-Contributors
GLS-CHILD-$DeptSiteName-Approvers

ROOT Domain Groups
DLS-ROOT-$DeptSiteName-Owners
DLS-ROOT-$DeptSiteName-Contributors
DLS-ROOT-$DeptSiteName-Approvers
DLS-ROOT-$DeptSiteName-ReadOnly
The follwing powersell command would do the trick.
  • Specify the server to run
New-ADGroup -server “AD02.CHILD.braindumpblog.plc”
  • Specify the name of the group using our variable
-Name GLS-CHILD-$DeptSiteName-Owners
  • Specify the SAM Account name as i would need this later…..
-SamAccountName GLS-CHILD-$DeptSiteName-Owners
  • Specify the Group Type (Global Security in this Case)
-GroupCategory Security -GroupScope Global
  • Specify the display name
-DisplayName GLS-CHILD-$DeptSiteName-Owners
  • Specify the description
-Description “This provides full access control to the SharePoint Site $DeptSiteName”
  • Specify where in AD i wanted to store it
-Path “OU=Sharepoint,OU=Application Access Control,OU=Global,OU=Access Control,OU=braindumpblog,DC=CHILD,DC=braindumpblog,dc=plc”
I then needed to declare the variables at the top of the script, so thought this is where i will prompt the admin to enter it.
$DeptSiteName = Read-Host “Enter The SharePoint Site Name Here”
…….
So for a new TESTING Department Publishing Site, I would need the follwing groups greated
CHILD Domain Global Security Groups
GLS-CHILD-TESTING-Owners
GLS-CHILD-TESTING-Contributors
GLS-CHILD-TESTING-Approvers

ROOT Domain Groups
DLS-ROOT-TESTING-Owners
DLS-ROOT-TESTING-Contributors
DLS-ROOT-TESTING-Approvers
DLS-ROOT-TESTING-ReadOnly
And here is the script that i can use over and over again to do it….. and all i will be asked for is the Dept Site Name

START OF SCRIPT

Import-Module ActiveDirectory

$DeptSiteName = Read-Host “Enter The SharePoint Site Name Here”

Echo $DeptSiteName

Echo “Creating CHILD Domain Groups”

New-ADGroup -server “AD02.CHILD.braindumpblog.plc” -Name GLS-CHILD-$DeptSiteName-Owners -SamAccountName GLS-CHILD-$DeptSiteName-Owners -GroupCategory Security -GroupScope Global -DisplayName GLS-CHILD-$DeptSiteName-Owners -Description “This provides full access control to the SharePoint Site $DeptSiteName” -Path “OU=Sharepoint,OU=Application Access Control,OU=Global,OU=Access Control,OU=braindumpblog,DC=CHILD,DC=braindumpblog,dc=plc”

New-ADGroup -server “AD02.CHILD.braindumpblog.plc” -Name GLS-CHILD-$DeptSiteName-Contributors -SamAccountName GLS-CHILD-$DeptSiteName-Contributors -GroupCategory Security -GroupScope Global -DisplayName GLS-CHILD-$DeptSiteName-Contributors -Description “This provides read/write access control to the SharePoint Site $DeptSiteName” -Path “OU=Sharepoint,OU=Application Access Control,OU=Global,OU=Access Control,OU=braindumpblog,DC=CHILD,DC=braindumpblog,dc=plc”

New-ADGroup -server “AD02.CHILD.braindumpblog.plc” -Name GLS-CHILD-$DeptSiteName-Approvers -SamAccountName GLS-CHILD-$DeptSiteName-Approvers -GroupCategory Security -GroupScope Global -DisplayName GLS-CHILD-$DeptSiteName-Approvers -Description “This provides Approve access control to the SharePoint Site $DeptSiteName” -Path “OU=Sharepoint,OU=Application Access Control,OU=Global,OU=Access Control,OU=braindumpblog,DC=CHILD,DC=braindumpblog,dc=plc”

Echo “Creating ROOT Domain Groups”

New-ADGroup -server “AD02.braindumpblog.plc” -Name DLS-ROOT-$DeptSiteName-Owners -SamAccountName DLS-ROOT-$DeptSiteName-Owners -GroupCategory Security -GroupScope DomainLocal -DisplayName DLS-ROOT-$DeptSiteName-Owners -Description “This provides full access control to the SharePoint Site $DeptSiteName, No Users should be added to this group they should be added to the CHILD Domain Groups” -Path “OU=Sharepoint,OU=Application Access Control,OU=Domain Local,OU=Access Control,OU=braindumpblog,DC=braindumpblog,DC=plc”

New-ADGroup -server “AD02.braindumpblog.plc” -Name DLS-ROOT-$DeptSiteName-Contributors -SamAccountName DLS-ROOT-$DeptSiteName-Contributors -GroupCategory Security -GroupScope DomainLocal -DisplayName DLS-ROOT-$DeptSiteName-Contributors -Description “This provides read/write access control to the SharePoint Site $DeptSiteName, No Users should be added to this group they should be added to the CHILD Domain Groups” -Path “OU=Sharepoint,OU=Application Access Control,OU=Domain Local,OU=Access Control,OU=braindumpblog,DC=braindumpblog,DC=plc”

New-ADGroup -server “AD02.braindumpblog.plc” -Name DLS-ROOT-$DeptSiteName-ReadOnly -SamAccountName DLS-ROOT-$DeptSiteName-ReadOnly -GroupCategory Security -GroupScope DomainLocal -DisplayName DLS-ROOT-$DeptSiteName-ReadOnly -Description “This provides read only access control to the SharePoint Site $DeptSiteName, No Users should be added to this group they should be added to the CHILD Domain Groups” -Path “OU=Sharepoint,OU=Application Access Control,OU=Domain Local,OU=Access Control,OU=braindumpblog,DC=braindumpblog,DC=plc”

New-ADGroup -server “AD02.braindumpblog.plc” -Name DLS-ROOT-$DeptSiteName-Approvers -SamAccountName DLS-ROOT-$DeptSiteName-Approvers -GroupCategory Security -GroupScope DomainLocal -DisplayName DLS-ROOT-$DeptSiteName-Approvers -Description “This provides Approve access control to the SharePoint Site $DeptSiteName, No Users should be added to this group they should be added to the CHILD Domain Groups” -Path “OU=Sharepoint,OU=Application Access Control,OU=Domain Local,OU=Access Control,OU=braindumpblog,DC=braindumpblog,DC=plc”

END OF SCRIPT

Open Up Powershell and run the script, it will ask you to enter the SharePoint Site Name Here, I entered TESTING and it created the following groups in the correct OUs in my child and root domains.

GLS-CHILD-TESTING-Owners
GLS-CHILD-TESTING-Contributors
GLS-CHILD-TESTING-Approvers

DLS-ROOT-TESTING-Owners
DLS-ROOT-TESTING-Contributors
DLS-ROOT-TESTING-Approvers
DLS-ROOT-TESTING-ReadOnly

So we now have our AD groups created and the next time i want to create the next site, i would just run the script and then enter the new site name…..so now thats the AD Groups created its on to part two. :-)