Category Archives: Systems Management

Systems Management

Bulk expanding disks after increasing their physical size

About

This script deals with expanding the logical volumes in windows after they have been expanded in the hypervisor. It will work on any windows server which you have remote PowerShell access to, in fact it tests for that before attempting to expand the disks.

It does however make an assumption about disks and volumes. They are hard coded rather than dynamically determined. You’ll need to update it for your server drive lettering standards.

Features

  • Works remotely
  • Works on multiple servers at once

Script

 

Free SharePoint 2010 Foundation add-ons everyone should have

a-motor-cycle-with-a-side-car-machine-gun

We have several customers who use SharePoint 2010 Foundation and are constantly trying to get the most out of the product, envious of what SharePoint standard and enterprise can do, frustrated by Foundations limitations but liking its price tag.

I’ve compiled a list of useful add-on’s here but I’ll come back and keep adding to it as we find more that are note worthy.

Continue reading Free SharePoint 2010 Foundation add-ons everyone should have

Mount-SPContentDatabase and Test-SPContentDatabase fail with either Invalid object name ‘Sites’ or ‘Webs’

homer-doh

While trying to restore some SharePoint 2010 “content” databases I kept on getting errors about invalid objects… Found some links talking about incorrect SharePoint versions but as it turned out that all it was because the databases were service application database backups with slightly ambiguous names, not content databases.

Continue reading Mount-SPContentDatabase and Test-SPContentDatabase fail with either Invalid object name ‘Sites’ or ‘Webs’

Best of Microsoft Management Summit (MMS) UK 2013

Today we are at Microsoft’s Cardinal Place offices in London Victoria for ‘Best of MMS’ – a regular fixture in The Full Circle calendar for a rapid-fire immersion in the latest Microsoft System Center technologies.  It’s also a great opportunity to catch-up with key System Center partners, the leader in this space being our good friends at Inframon.

image

‘Best of MMS’ is a one-day synopsis of the week long main event held in Las Vegas in April – see www.2013mms.com/ for the official MSFT site inc. videos, keynotes, etc…

This year’s event is just 1-day at 1-venue (last year was 3), however last year was product launch cycle with the 2012 wave whereas this year is mid-release improvements.

Continue reading Best of Microsoft Management Summit (MMS) UK 2013

Edition downgrade for SharePoint Search Server Express 2010 from SQL 2008 R2 Enterprise to SQL 2012 Express

DowngradeThis is just a quick post to highlight issues with two SharePoint Search Server Express 2010 databases when downgrading from SQL 2008 R2 Enterprise to SQL 2012 Express (although applies to any Express version, 2008 R2 or higher).

The customer needed to swap out an Enterprise trial version of SQL and replace it with Express since the investment for Enterprise wasn’t forthcoming and neither was the investment for further immediate work in SharePoint.

They were however getting great value from Search within Search Server Express 2010 so didn’t want that to go anywhere, it was the entire companies home page!

Continue reading Edition downgrade for SharePoint Search Server Express 2010 from SQL 2008 R2 Enterprise to SQL 2012 Express

Create a SharePoint group with permissions and add an AD group to it

group_add

Requirement

  • Create a SharePoint group in a site collection
  • Assign that group an existing permission for Site Permissions list
  • Add an Active Directory group to that SharePoint group
  • Read the values from a CSV file
  • Repeat for 1000 groups spread across multiple site collections
  • The Site Collection Admin will run the script and be added as owner automatically

 

Solution

function global:New-SPGroup {
#Parameters that the script offers out to use,
# e.g. New-SPGroup -SiteCollection “
http://intranet/sitecollection” -ADGroupName “domain\ADgroup” -SPGroupName “SharePoint Group 1” -SPGroupDescription “Group Description” -SPGroupPermission “Permission”
[CmdletBinding()]
Param(
[Microsoft.SharePoint.PowerShell.SPWebPipeBind]
[string]$SiteCollection,
[string]$ADGroupName,
[string]$SPGroupName,
[string]$SPGroupDescription,
[string]$SPGroupPermission
)

#Required variabales for dev or single item runs, remove # and highlight from here down to above CSV section in Powershell ISE
#$SiteCollection = “
http://site/sitecollection”
#$ADGroupName = “domain\adgroup”
#$SPGroupName = “My Test Group A1”
#$SPGroupDescription = “Test Group A1’s Description” #Note: do not use” – ” in description, i.e. space hyphen space
#$SPGroupPermission = “Read”

#Start of script
$site = Get-SPWeb $SiteCollection

#Check if the group already exists
if ($site.SiteGroups[“SPGroupName”] -eq $null)
{

#Ensure Group/User is part of site collection users beforehand and add them if needed
$site.EnsureUser(“$ADGroupName”)

# Get the AD Group/User in a format that PowerShell can use otherwise there will be a string error
$ADGroupSPFriendly = $site | Get-SPUser $ADGroupName

#Create the SharePoint Group – Group Name, Group Owner, Group Member, Group Description. Can’t add AD group yet…
$NewSPGroup = $site.SiteGroups.Add($SPGroupName, $site.CurrentUser, $site.CurrentUser, $SPGroupDescription)
$site.AssociatedGroups.Add($site.SiteGroups[“$SPGroupName”]);
$NewSPAccount = $site.SiteGroups[“$SPGroupName”]

#Assign the Group permission
$GroupAssignment = New-Object Microsoft.SharePoint.SPRoleAssignment($NewSPAccount)
$GroupRole = $site.RoleDefinitions[“$SPGroupPermission”]
$GroupAssignment.RoleDefinitionBindings.Add($GroupRole)
$site.RoleAssignments.Add($GroupAssignment)

#Add the AD Group/User to the group, can’t be done during group creation when using Powershell otherwise errors so is done now.
Set-SPUser -Identity $ADGroupSPFriendly -Web $SiteCollection -Group $SPGroupName
}
$site.Dispose()
}

#Read from the CSV input file
#CSV file must have header row – SiteColl, AdSecGroup, SPSecGroupName, SPGroupDesc, SPGroupPerm
#No “” around any items in the CSV file are needed
$csv = Import-csv -path D:\DEVGroupNameCSVFile2.csv
if ($csv -ne $null) {
foreach($line in $csv)
{
[string]$SiteCollection = $line.SiteColl;
[string]$ADGroupName = $line.AdSecGroup;
[string]$SPGroupName = $line.SPSecGroupName;
[string]$SPGroupDescription = $line.SPGroupDesc;
[string]$SPGroupPermission = $line.SPGroupPerm

New-SPGroup -Site $SiteCollection -ADGroupName $ADGroupName -SPGroupName $SPGroupName -SPGroupDescription $SPGroupDescription -SPGroupPermission $SPGroupPermission;
}
}

 

I hope someone else finds this script useful since all I found on the web were partial answers at best, and with a few solutions that didn’t match the requirement.

Errors encountered along the way and running the script

“You cannot add a domain group to a group.” – You can however add your AD group to the SharePoint group after is it created, just not while you are creating it. Resolved by the last part of the function.

Exception calling “Add” with “4” argument(s): “The specified name is already in use. Please try again with a new name.” – As it implies, this is a duplicate item in your CSV file.

References

Basis for script –

http://sharepointryan.com/2011/07/20/create-sharepoint-groups-using-powershell/

http://addictedtosharepoint.com/2011/07/23/adding-a-security-group-to-a-sharepoint-site-via-powershell/

http://www.iotap.com/Blog/tabid/673/entryid/154/Powershell-script-for-Adding-Active-Directory-Users-to-Sharepoint-2010-Groups.aspx

http://get-spscripts.com/2011/02/add-sharepoint-or-ad-groupuser-to-all.html

http://stackoverflow.com/questions/4512548/how-to-add-ad-group-to-sharepoint-2010-spgroup-programmatically

http://shpstuff.blogspot.co.uk/2012/05/create-groups-in-site-collection-using.html

http://stackoverflow.com/questions/3713497/how-to-get-spuser-object-using-user-id-domain-name-userid

Additional information that you might find useful –

http://sharepoint.stackexchange.com/questions/20739/add-users-to-sp-group

http://social.msdn.microsoft.com/Forums/eu/sharepointdevelopment/thread/2df1f82b-ba04-4378-9df8-6fb0bf8eeaa3

http://www.learningsharepoint.com/forum/sharepoint-2010-programming/add-user-with-powershell-in-sharepoint-2010-site/

http://social.technet.microsoft.com/forums/en-GB/sharepointadminprevious/thread/c9e11537-6b1a-46f6-b030-395f8ed1fbf7

http://social.technet.microsoft.com/forums/en-ZA/sharepointgeneralprevious/thread/0632b071-617f-4e93-bd06-ed85ab7ef4a6

[aboutme username=”ashley.lawrence”]

 

How to structure a software media library folder

Most of our commercial customers with The Full Circle (www.thefullcircle.com) aren’t technology businesses so managing software isn’t what they do.
Whilst we often perform this as part of a managed service, we still implement a software library (AKA Media Library) for them comprising of their software installers, ISO images, drivers, patches, etc… which makes various rollout & upgrade activities easier & faster in the long run and easier to audit when the time comes.

Having been asked a few times what this structure looks like I thought I’d do a post on it. It’s a very small piece of the data storage puzzle but one which makes life a lot easier for techie and companies with a lot of software assets.

Once in place, the next step is to carefully decide who has write access. No easy task figuring out who you can trust to put things in the right place, but one thing is for sure whatever you decide – it should be read only by default and write access by exception. The best practise would be to have several people nominated as librarians but this isn’t always possible. Whether you store your licence/activation keys here though is down to your businesses policy. Some prefer to keep them secure in something like Keypass, while other are comfortable keeping keys in text files along with the media.

In the ITIL world this structure be known as the Definitive Software Library or DSL.

The core structure follows this basic pattern:

Documentation >
Drivers > Major Driver Categories >
Major Platform Binaries >Vendor > Package/Package Group >Product Version >

 

image

 

You can download a zip of the folder structure here –