Wednesday, 9 September 2015

Remove User in Office 365

In this Article, we will cover how to remove users using PowerShell in Office 365. Users can be removed using Office 365 Admin Center as well.

In order to use the following command lets , the pre-requisite is to Install Windows Azure for Active Directory PowerShell, please refer to Microsoft TechNet Article.

Launch the Windows Azure for Active Directory Shortcut

Connect to Office 365 using the following command , and enter your credentials

Connect-msolservice 

Once you are connected, you can use the following command to remove a user

To Remove a User,

Remove-MsolUser –UserPrincipalName JohnSmith@contoso.com

This will prompt to remove any licenses that are assigned to the user. Once the account is removed, the user account is recoverable within 30 days from recycle bin

To Remove a User from Recycle Bin i.e. permanently delete

Remove-MsolUser –UserPrincipalName JohnSmith@contoso.com -RemoveFromRecycleBin

Adding Users in Office 365


There are various ways in which users can be added in Office 365. You can add the users using the following ways

  • Office 365 Admin Center
  • Bulk Import using CSV Files
  • Directory Sync
  • PowerShell

In this Article, we will cover how to add users using PowerShell

In order to use the following command lets , the pre-requisite is to Install Windows Azure for Active Directory PowerShell.

Launch the Windows Azure for Active Directory Shortcut

Connect to Office 365 using the following command , pand enter your credentials

Connect-msolservice 

Once you are connected, you can use the following command to create a new user
New-MsolUser –UserPrincipalName “JohnSmith@Contoso.com”–Displayname “John Contoso” –Fristname “John” – Lastname “Smith”

Note:  the user account will be created , a random password is generated,  in Windows Azure Active Directory but no licenses are assigned to the user. 

Some other commands to get some help, which I find really helpful are:

For Help > Get-Help  New-MsolUser

For Examples > Get-Help New-MsolUser –examples 

Fore More Information > Get-Help New-MsolUser –detailed 

For Technical Information > Get-Help New-MsolUser –full  

For Online help > Get-Help New-Msoluser –online


Thursday, 27 August 2015

SharePoint 2016 Preview New Integartion Capability

SharePoint 2016 preview is out and SharePoint professional across the world out there aredoing a deep dive to get up to speed to understand the newer capabilities of what platform has to offer.

Biggest one which I See , based on what I have seen is

Integration capabilities

Hybrid Integration

Project Server is now fully integrated by default on 2016, how the licensing will be interesting to see.

Here is a screen capture of the Project Server Integration



Some of the capabilities may change when RTM is released not covered here.

Friday, 24 April 2015

SharePoint 2013 update conflict has occurred, and you must re-tr this action. The object SPWebApplication Name

While running the command to remove the dodgy extranet web app, got this error

Remove-SPWebApplication : An update conflict has occurred, and you must re-tr
this action. The object SPWebApplication Name=extranetppd.contoso.com was updated by Service Account, in the w3wp
(6180) process, on machine Contoso001.  View the tracing log for more
information about the conflict.
At line:1 char:1

Clear the SharePoint cache , refer to the technet article

Ran the command again, works absolutely fine

Remove-SPWebApplication https://extranetppd.contoso.com/  -Confirm -DeleteIISSite -RemoveContentDatabases

Thursday, 23 April 2015

Delete / Force / Remove Rogue or Orphaned Site Collection in SharePoint 2013

Whilst provisioning app catalog site, encountered an issue with the database permissions. Aftering sorting that out, whilst re-provisioning the app catalog site , found the previous attempt added a rogue / orphaned site colleciton.

Though the site colleciton was visible in central admin, however, the option to delete was graded out.

Use the following Powershell, this did the trick.

$site = Get-SPSite https://intranet.contoso.com/apps/appstore
$siteId = $site.Id
$siteDatabase = $site.ContentDatabase
$siteDatabase.ForceDeleteSite($siteId, $false, $false)

Monday, 26 January 2015

Error while crawling LOB contents. ( Error caused by exception: Microsoft.BusinessData.Infrastructure.BdcException The shim execution failed unexpectedly - Exception has been thrown by the target of an invocation..: System.Net.WebException The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.; SearchID

Error while crawling LOB contents. ( Error caused by exception: Microsoft.BusinessData.Infrastructure.BdcException The shim execution failed unexpectedly - Exception has been thrown by the target of an invocation..: System.Net.WebException The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.; SearchID 

The issue with the certificates not being recognized as trusted in the SharePoint Farm. To resolve this:


  • Go the the Certificate, Click on Certificate Path 
  • Select the Root Certifcate, Double Click on it
  • Click on Details 
  • Click on Copy to File
  • Save the file
  • Now Go to SharePoint > Security > Manage Trust
  • Create a New Trust >  Import the Root certificate
  • Click oK
  • Run and iisreset on the SharePoint servers
  • Run a full crawl now


Issue resolved for me.

Check the ULS to find more information , may have to switch on verbose extended logging, but generally speaking, the cause of the issue will be the certificates.