When I run this script,
$site = new-object Microsoft.SharePoint.SPSite($SiteCollectionURL)
$web = $site.openweb()
$siteUsers = $web.SiteUsers
foreach($user in $siteUsers)
{
if($user.IsSiteAdmin -eq $true)
{
Write-Host "ADMIN: ", $user.LoginName
}
else
{
Write-Host "USER: ", $user.LoginName
}
}
I get this output
ADMIN: i:0#.w|exampledomain\my.user
USER: EXAMPLEDOMAIN\my.user
Any idea why ?
Update:
New-SPSite 'https://example1.myportal.com/us/SCTest1' -HostHeaderWebApplication 'https://example1.myportal.com’ -Name 'SCTest1' -Description '' -OwnerAlias 'exampledomain\myuser.name' -language 1033 -Template 'STS#1'
When I create a site collection like this, I still get same output as above,
ADMIN: i:0#.w|exampledomain\myuser.name
USER: EXAMPLEDOMAIN\myuser.name