Office 365 Como obtener la opción de compartir información de cada colección de sitios de SPO (II)!

Siguiendo con la serie de artículos sobre como obtener la opción de compartir configurada en cada Colección de Sitios en un tenant de SharePoint Online (SPO), en esta ocasión os comparto como obtener dicha información por medio de PowerShell y el script que podéis descargaros desde:https://gallery.technet.microsoft.com/How-to-get-sharing-status-d28b8523

function Get-SPOSharingStatus_SPO_Site_Collections
{
    param ($sSPOSharingCapability)
    try
    {   
        Write-Host "Getting al SPO Site Collections with Sharing Status equals to $sSPOSharingCapability" -ForegroundColor Green
        switch ($sSPOSharingCapability) 
        { 
        "Disabled" {
                Get-SPOSite |Where-Object {$_.SharingCapability -eq $sSPOSharingCapability}|select Url,SharingCapability
            }
        "Enabled"{
                Get-SPOSite |Where-Object {$_.SharingCapability -ne "Disabled"}|select Url,SharingCapability
            }
        "ExternalUserSharingOnly"{            
            Get-SPOSite |Where-Object {$_.SharingCapability -eq $sSPOSharingCapability}|select Url,SharingCapability
            }
        "ExternalUserAndGuestSharing"{
            Get-SPOSite |Where-Object {$_.SharingCapability -eq $sSPOSharingCapability}|select Url,SharingCapability
            }
        default{
            Write-Host "Requested operation is not valid" -ForegroundColor Red
            }           
        }    

    }
    catch [System.Exception]
    {
        Write-Host -Foregroundcolor Red $_.Exception.ToString()   
    }    
}

#Connection to Office 365
$sUserName="<O365User>@<O365Domain>.onmicrosoft.com"
$sSPOAdminCenterUrl="https://<O365Domain>-admin.sharepoint.com/"
$sPassword="<O365Password>"
$sSecurePassword=ConvertTo-SecureString "" -asplaintext -force
$msolcred=New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $sUserName, $sSecurePassword
Connect-SPOService -Url $sSPOAdminCenterUrl -Credential $msolcred

#Sharing Capability Disabled
$sSPOSharingCapability="Disabled"        
#Get-SPOSharingStatus_SPO_Site_Collections -sSPOSharingCapability $sSPOSharingCapability

#Sharing Capability Enabled -> Two options: Enabled with external users & Enabled with external users + Guest links
$sSPOSharingCapability="Enabled"        
#Get-SPOSharingStatus_SPO_Site_Collections -sSPOSharingCapability $sSPOSharingCapability

#Sharing Capability Enabled -> Enabled with external users
$sSPOSharingCapability="ExternalUserSharingOnly"        
#Get-SPOSharingStatus_SPO_Site_Collections -sSPOSharingCapability $sSPOSharingCapability

#Sharing Capability Enabled -> Enabled with external users and Guest links
$sSPOSharingCapability="ExternalUserAndGuestSharing"        
#Get-SPOSharingStatus_SPO_Site_Collections -sSPOSharingCapability $sSPOSharingCapability
Anuncios

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión / Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión / Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión / Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión / Cambiar )

Conectando a %s