Unexpected changes to Login Name for SharePoint service/group IDs

%3CLINGO-SUB%20id%3D%22lingo-sub-51844%22%20slang%3D%22en-US%22%3EUnexpected%20changes%20to%20Login%20Name%20for%20SharePoint%20service%2Fgroup%20IDs%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-51844%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20recently%20noticed%20in%20the%20last%20few%20days%20that%20some%20of%20my%20scripts%2Fwebjobs%2Fapps%20had%20started%20producing%20errors%2C%20these%20were%20to%20do%20with%20setting%20the%20Company%20Administrator%2C%20SharePoint%20Service%20Administrator%20and%20some%20AD%20Security%20Groups%20against%20sites.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20appears%20that%20the%20Login%20Name%20for%20items%20such%20as%20Company%20Administrator%20has%20recently%20changed%2C%20I%20was%20using%20the%20login%20name%20to%20add%20the%20user%2Fgroup%26nbsp%3Bas%20site%20collection%20admin%20i.e.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESet-SPOUser%20-Site%20%24siteUrl%20-LoginName%20%24CompanyAdministrator%20-IsSiteCollectionAdmin%20%24true%3C%2FP%3E%3CP%3Ethe%20above%20cmdlet%20now%20returns%20an%20error%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3ESet-SPOUser%20%3A%20The%20user%20does%20not%20exist%20or%20is%20not%20unique.%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20not%20sure%20whether%20the%20login%20name%20for%20Company%20Administrator%20is%20standard%20within%20a%20tenant%20or%20across%20tenants%2C%20but%20I'm%20a%20bit%20peeved%20that%20it's%20been%20changed%20with%20no%20warning.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnyone%20have%20any%20idea%20why%20this%20change%20has%20happened%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-278491%22%20slang%3D%22en-US%22%3ERe%3A%20Unexpected%20changes%20to%20Login%20Name%20for%20SharePoint%20service%2Fgroup%20IDs%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-278491%22%20slang%3D%22en-US%22%3EHi%20thanks%2C%20first%20reply%20in%20over%20a%20year%20since%20I%20posted%20this%20%3B-)!%3CBR%20%2F%3EI%20sorted%20it%20out%20before%20I%20wrote%20the%20post%20and%20spoke%20to%20our%20TAM%20after%2C%20my%20complaint%20was%20that%20there%20was%20no%20communication%20before%20the%20change%20was%20made%2C%20again%2C%20not%20the%20first%20time%20and%20I'm%20sure%20it%20won't%20be%20the%20last.%3CBR%20%2F%3ETthanks%20again!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-278466%22%20slang%3D%22en-US%22%3ERe%3A%20Unexpected%20changes%20to%20Login%20Name%20for%20SharePoint%20service%2Fgroup%20IDs%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-278466%22%20slang%3D%22en-US%22%3E%3CP%3EThe%20login%20name%20changed%20from%20%3CSPAN%3Ec%3A0-.f%7Crolemanager%7C%3CSID%3E%20to%20%3C%2FSID%3E%3C%2FSPAN%3E%3CSPAN%3Ec%3A0t.c%7Ctenant%7C%3CGUID%3E%3C%2FGUID%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EGo%20to%20a%20site%20where%20you%20have%20them%20added%20and%20get%20the%20GUID%20with%20Get-SPOUser%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3Eor%20to%20filter%20the%20big%20list%20use%20Get-SPOUser%20-site%20https%3A%2F%2F%3CTENANT%3E.sharepoint.com%20%7C%3F%20%7B%24_.DisplayName%20-eq%20%22%3C%2FTENANT%3E%3C%2FSPAN%3E%3CSPAN%3E%3CFONT%3ESharePoint%20Service%20Administrator%22%7D%3C%2FFONT%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CFONT%3EThe%20login%20name%20will%20be%20the%20GUID%20and%20you%20can%20do%20a%20Set-SPOUser%20-LoginName%20%22c%3A0t.c%7Ctenant%7C%3CGUID%3E%22%20-Site%20https%3A%2F%2F%3CTENANT%3E.sharepoint.com%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FTENANT%3E%3C%2FGUID%3E%3C%2FFONT%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CFONT%3EI%20have%20an%20old%20blog%20post%20about%20this%20and%20updated%20the%20scripts%20in%20there%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fworktogether.tech%2F2016%2F05%2F01%2Fsharepoint-online-user-policy%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fworktogether.tech%2F2016%2F05%2F01%2Fsharepoint-online-user-policy%3C%2FA%3E%3C%2FFONT%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Contributor

Hi,

 

I recently noticed in the last few days that some of my scripts/webjobs/apps had started producing errors, these were to do with setting the Company Administrator, SharePoint Service Administrator and some AD Security Groups against sites.

 

It appears that the Login Name for items such as Company Administrator has recently changed, I was using the login name to add the user/group as site collection admin i.e.

 

Set-SPOUser -Site $siteUrl -LoginName $CompanyAdministrator -IsSiteCollectionAdmin $true

the above cmdlet now returns an error:

 

Set-SPOUser : The user does not exist or is not unique.

 

I'm not sure whether the login name for Company Administrator is standard within a tenant or across tenants, but I'm a bit peeved that it's been changed with no warning.

 

Anyone have any idea why this change has happened?

 

2 Replies
Highlighted

The login name changed from c:0-.f|rolemanager|<sid> to c:0t.c|tenant|<guid>

Go to a site where you have them added and get the GUID with Get-SPOUser

or to filter the big list use Get-SPOUser -site https://<tenant>.sharepoint.com |? {$_.DisplayName -eq "SharePoint Service Administrator"}

The login name will be the GUID and you can do a Set-SPOUser -LoginName "c:0t.c|tenant|<guid>" -Site https://<tenant>.sharepoint.com

I have an old blog post about this and updated the scripts in there https://worktogether.tech/2016/05/01/sharepoint-online-user-policy

Highlighted
Hi thanks, first reply in over a year since I posted this ;-)!
I sorted it out before I wrote the post and spoke to our TAM after, my complaint was that there was no communication before the change was made, again, not the first time and I'm sure it won't be the last.
Tthanks again!