2016-08-19 6 views
0

私持って次のコード その質量への外部SPO上の共有とODを有効にするユーザー 取得セットSPOsiteエラー

Connect-SPOService -Url https://######-admin.sharepoint.com 

$currentSiteCollection = (Get-Content "siteCollectionsEnabled.txt") 
$collectionCount = $currentSiteCollection.Count 
if ($currentSiteCollection){ 
    foreach ($currentSite in $currentSiteCollection) 
    { 
    Clear-Host 
     Write-Output "Enabling " $currentSite.ToString() $collectionCount.ToString() " sites left" 
     Set-SPOSite -Identity $currentSite -SharingCapability ExternalUserSharingOnly 
    Add-Content ODFBSiteSharingEnabled.log $currentSite.ToString() 
     $collectionCount = $collectionCount - 1 
    } 
} 

しかし、私はこのサイトは セットSPOSiteを左に取得する実行している場合:いいえ接続可能です。このCmdLetを実行する前にConnect-SPOServiceを使用してください。 Cで :### \ siteCollectionsDisabledEnable \ siteEnable.ps1:10文字:9 +セットSPOSite -Identity $ currentSite -SharingCapability ExternalUserSharin ... + ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~ + CategoryInfo:NotSpecified:(:) [Set-SPOSite]、InvalidOperationException

ここにいくつかの助け?

答えて

0

Connect-SPOServiceコマンドレットを単独で実行できますか?何かエラーが出ますか?

うまく動作してサインインできる場合は、ここでスクリプトの最初の行を削除し、残りの部分を実行します。