Skip to content

Instantly share code, notes, and snippets.

@Zerg00s
Last active June 21, 2020 16:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zerg00s/202139e73ccdb8838ff3ba3b58976c52 to your computer and use it in GitHub Desktop.
Save Zerg00s/202139e73ccdb8838ff3ba3b58976c52 to your computer and use it in GitHub Desktop.
Crawl Private SharePoint.COM sites
$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