Resolve conflict Domain Control SID and member SID

To play around with SharePoint 2013 I need a decent setup of a Domain Controller, SQL Server 2012 and SharePoint 2013 Server. To achieve this I use Hyper-V and want to reuse as much as possible, but it has it limits…

SharePoint 2013 Server Topology

Every machine, virtual of physical, has it’s own SID. This can be retrieved via PsGetSid.exe from The thing is, it seems that the Domain Controller needs to have an unique SID within the domain. Although the domain members are allowed to have similar SIDs.

When I setup my topology I use a base image for every machine. Meaning these all have the same SID. After I installed my Domain Controller and second machine which I wanted to join to the domain I got this error “The domain join cannot be completed because the SID of the domain you attempted to join was identical to the SID of this machine”.


The solution to this is renewing the SID of the member machine. I needed to run sysprep.exe to change the SID of my base image, which I use to create the SQL Server 2012 and SharePoint 2013 machines. After running sysprep everything worked as expected!

PowerShell script for retrieving AD user attributes based on display name

Populating more than 1.000 people picker values based on users display name can be quite challenging when doing it manually. PowerShell to the rescue!

This script reads a TXT-file with 1 users’ display name per line. Per user it searches the local directory and outputs the displayName and sAMAccountName in a semicolon separated line (easy for Excel extraction).

PowerShell script:

function ConvertUser($user) { $search = New-Object DirectoryServices.DirectorySearcher([ADSI]“”) $search.filter = “(&(objectClass=user)(displayName=$user))” $results = $search.Findall() foreach($result in $results){ $userEntry = $result.GetDirectoryEntry() Write-Output('' + $userEntry.displayName + ';' + $userEntry.sAMAccountName) } } function ConvertUsers { process{ foreach($user In $_){ ConvertUser($user) } } } Get-Content “.\Users.txt” | ConvertUsers

TXT-file with users (filename: “Users.txt”):

Aaron Painter Adam Barr Alan Brewer Alan Steiner

Make a TXT-file with users display name (see example below). Then copy, paste and run the script above should do the trick.