Last active
June 21, 2020 16:22
-
-
Save Zerg00s/202139e73ccdb8838ff3ba3b58976c52 to your computer and use it in GitHub Desktop.
Crawl Private SharePoint.COM sites
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$sites = @("IT","HR","FINANCE","ACCOUNTING","PR", 'PM',"B2B","B2C", "MARKETING","OPERATIONS", "LEGAL", "MICROSOFT", "TRAINING", "BD", "SALES", "EXPORT", | |
"Administration", "Admin", "Production", "Logistics", "Security", "Support", 'Staff', "Branding", 'Production', 'Purchasing', | |
"RnD", "Network", "Planning", "Dispatch", "Demo", 'Learning', "Education", "Communication", 'Communications', "distribution", | |
"Management") | |
$tenantUrl = "https://microsoft.sharepoint.com" | |
$ManagedPath = "/sites/" | |
# $ManagedPath = "/teams/" | |
foreach($site in $sites){ | |
try{ | |
$fullSiteUrl = $tenantUrl + $ManagedPath + $site | |
$response = Invoke-WebRequest -Uri $fullSiteurl | |
Write-Host $fullSiteUrl exists -BackgroundColor green | |
} | |
catch{ | |
if($_.Exception.Message -match "404"){ | |
Write-Host $fullSiteUrl does not exists | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment