SOLVED

Setting Sharing Allowed Domain List - SPO PowerShell

%3CLINGO-SUB%20id%3D%22lingo-sub-655434%22%20slang%3D%22en-US%22%3ESetting%20Sharing%20Allowed%20Domain%20List%20-%20SPO%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-655434%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20having%20issues%20trying%20to%20set%20up%20an%20allowed%20domain%20list%20for%20external%20sharing%20for%20one%20of%20our%20sites%20in%20SharePoint%20Online.%20I%20have%20a%20list%20of%20about%2080%20domains%20which%20includes%20subdomains%20that%20we%20need%20to%20add%20to%20this%20list%20via%20the%20%3CSTRONG%3ESet-SPOSite%3C%2FSTRONG%3E%20cmdlet.%20I%20keep%20receiving%20an%20improperly%20formed%20input%20allow%20list%20error%20even%20though%20the%20list%20is%20space%20delimited%20and%20have%20checked%20to%20make%20sure%20each%20domain%20is%20correct.%20I'm%20wondering%20if%20there%20is%20somehow%20a%20character%20limit%20for%20the%20string%20or%20if%20there%20is%20a%20way%20to%20do%20this%20in%20a%20foreach%20loop%20to%20add%20each%20domain%20as%20a%20space%20delimited%20string%3F%20Thank%20you.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-655434%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-655672%22%20slang%3D%22en-US%22%3ERe%3A%20Setting%20Sharing%20Allowed%20Domain%20List%20-%20SPO%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-655672%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F227157%22%20target%3D%22_blank%22%3E%40Kenneth%20Conaway%3C%2FA%3E%26nbsp%3BPost%20a%20sample%20of%20what%20you're%20using%20for%20the%20script%20and%20redact%20info%20that%20we%20don't%20need%20to%20see%3F%20Best%20guess%20might%20be%20that%20you're%20missing%20or%20not%20using%20the%20right%20quotes%20that%20are%20recognized%20by%20powershell.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-655764%22%20slang%3D%22en-US%22%3ERe%3A%20Setting%20Sharing%20Allowed%20Domain%20List%20-%20SPO%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-655764%22%20slang%3D%22en-US%22%3EI%20just%20did%20a%20manual%20input%20of%20what%20I%20did%20and%20I%20think%20I'm%20reaching%20a%2060%20domain%20limit.%20If%20I%20add%20a%2061st%20one%20it%20throws%20the%20error%20so%20there%20must%20be%20an%20upper%20limit%20to%20how%20many%20domains%20are%20allowed%20in%20the%20list.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-655796%22%20slang%3D%22en-US%22%3ERe%3A%20Setting%20Sharing%20Allowed%20Domain%20List%20-%20SPO%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-655796%22%20slang%3D%22en-US%22%3E%3CP%3EThe%20limit%20is%20indeed%2060%2C%20as%20indicated%20in%20the%20documentation%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Frestricted-domains-sharing%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Frestricted-domains-sharing%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-655818%22%20slang%3D%22en-US%22%3ERe%3A%20Setting%20Sharing%20Allowed%20Domain%20List%20-%20SPO%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-655818%22%20slang%3D%22en-US%22%3EThanks%20for%20the%20input.%20Hopefully%20Microsoft%20will%20increase%20this%20limit%20at%20some%20point.%20I'll%20see%20if%20there%20is%20a%20uservoice%20for%20this%20already.%3C%2FLINGO-BODY%3E
Occasional Contributor

I'm having issues trying to set up an allowed domain list for external sharing for one of our sites in SharePoint Online. I have a list of about 80 domains which includes subdomains that we need to add to this list via the Set-SPOSite cmdlet. I keep receiving an improperly formed input allow list error even though the list is space delimited and have checked to make sure each domain is correct. I'm wondering if there is somehow a character limit for the string or if there is a way to do this in a foreach loop to add each domain as a space delimited string? Thank you.

5 Replies

@Kenneth Conaway Post a sample of what you're using for the script and redact info that we don't need to see? Best guess might be that you're missing or not using the right quotes that are recognized by powershell.

I just did a manual input of what I did and I think I'm reaching a 60 domain limit. If I add a 61st one it throws the error so there must be an upper limit to how many domains are allowed in the list.
best response confirmed by Kenneth Conaway (Occasional Contributor)
Solution

The limit is indeed 60, as indicated in the documentation: https://docs.microsoft.com/en-us/sharepoint/restricted-domains-sharing

Thanks for the input. Hopefully Microsoft will increase this limit at some point. I'll see if there is a uservoice for this already.
it is in-between increased to 3000 at organizational level and 500 at site level ;)
https://docs.microsoft.com/en-us/sharepoint/restricted-domains-sharing