Skip to content

Instantly share code, notes, and snippets.

@expiscornovus
Last active March 29, 2021 21:25
Show Gist options
  • Save expiscornovus/f1eaeeabf91d471480d99b4af65f1c6d to your computer and use it in GitHub Desktop.
Save expiscornovus/f1eaeeabf91d471480d99b4af65f1c6d to your computer and use it in GitHub Desktop.
How to verify ULS log and Usage log file access in SharePoint 2013 via PowerShell
$usageservice = Get-SPUsageservice
$servers = Get-SpServer | ? {$_.Role -ne "Invalid"}
$usagelogdirunc = $usageservice.UsageLogDir -replace ':','$'
foreach
($server in $servers)
{
$testuncpath = '\\' + $server.Address + '\' + $usagelogdirunc
$testuncpath
get-acl -Path $testuncpath | select -expand access | ? {$_.IdentityReference -like "*WSS_WPG" -or $.IdentityReference -like "*WSS_Admin_WPG"}
# get-acl -Path $testuncpath | select -expand access | ? {$_.IdentityReference -like "*Administrators"}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment