Wednesday, September 25, 2013

Powershell Script to Connect to Domain Controllers

We have been seeing some issues with our servers not being able to connect to DC's - to help diagnose the issues the following scripts were useful 

This gets all the DC's and pings

[System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain() | % { $_.DomainControllers } | %{Test-Connection $_.Name}

The next one-liner connects to each of the DC's on 389

[System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain() | % { $_.DomainControllers } | %{$o=new-object Net.Sockets.TcpClient;$o.Connect( $_.IPAddress, 389); new-object PSObject -Property @{name=$_.Name;connected=$o.Connected}}

Wednesday, January 30, 2013

SharePoint 2007 - stsadm error


After trying to restore a site collection from another environment I received the following error :


No content databases are available for this operation. Create a content database, and then try the operation again. To create a content database, click "Content databases" on the Application Management page, select the Web application to use, and then click "Add a content database".

Check CA and all was as expected, content DB's online.

I realised that the site collection had actually been restored before, even though it has a new name it had the same GUID within SharePoint and therefore needed to be on a new contentDB.



Wednesday, October 31, 2012

SharePoint 2007 "Code blocks are not allowed in this file" after saving a file from Word

Received the error after trying to save to a SharePoint document library via Word.
The method I used to resolve was to 

Go to Site Actions -> Site Settings.Click the "Reset to site definition" link.
The type in the link that is not working "Latest Documents/Forms/AllItems.aspx" and just reset this library 
This was fine for me as I didn't have any customizations as they will be reset.