Windows PowerShell Command Builder

Recently we have been researching how Windows PowerShell could help with the some of the more advanced administration tasks of SharePoint Server 2010 and Office 365. Our most recent discovery of Windows PoweShell is an online Command Builder, which enables users with limited knowledge of Windows PowerShell the ability to create commands to perform certain functions. The command builder, shown below, lets users select the product they have, either SharePoint Server 2010, SharePoint Foundation 2010 or Office 365. There is then the option to filter all the commands based on what you wish to do.

It is through exploring this command builder that we have seen the difference of what Windows PowerShell can do for SharePoint Server 2010 and Office 365. The difference in functionality is greater than what I expected. With Office 365 you appear to only get basic functionality such as ‘Get’, ‘Set’, ‘Add’, ‘Remove’ and ‘Update’ etc. In comparison SharePoint Server 2010 offers much more. As shown in the image above there are functions to revoke and grant permissions, publish and un-publish content, and also options to install and uninstall.

Here is an example of a command that was built in the command builder and sent to clipboard:

“Set-SPUser -Identity “Robert Everatt” -Group “Administrator Extraordinaire” -MobileNumber “666” -IsSiteCollectionAdmin”

Office 365 & Windows Powershell

So today Rob and I discovered that it is possible to work with Windows Powershell in the Office 365 environment, using the Microsoft Online Services module. We decided to follow the instructions and install the necessary components. Following some basic commands we were able to perform some basic administration on users, such as, changing display names, contact numbers and names.

However after some more research into the matter, Rob discovered that the data being changed by these commands was the data held in the main Office 365 user profiles, and not in the SharePoint user profiles. This is why we were not able to access the custom user properties that we had created to handle the extra functionality of the annual leave process. However, this should be possible when using SharePoint Server 2010 instead of SharePoint Online with Office 365.

Administration With PowerShell

SharePoint workflows’ aren’t as complex as I would like them. without Visual Studio, the options that you are given are quite limited, and not very flexible when you want to do something a little more complicated. The action that I wished to carry out was to edit a users properties from the workflow, however the workflow can only read user properties, and not write to them.

After searching the internet for an answer, I saw someone talking about Windows PowerShell scripts.

PowerShell in SharePoint 2010 is an administrative tool that carries out its work in a command line. This allows the administrator to carry out commands’ and is great for repetitive process’. One of the features that intrigues me the most is the ability to easily create PowerShell scripts, they can also be initiated by workflows which makes the task of editing User properties very simple, if the PowerShell can grab data from the workflow then the Powershell uses this to find the relative data and edit it accordingly.

Unfortunately I still don’t know much about this as it is only usable on SharePoint 2010, which we do not yet have. More info when I get it.

RE