Hi, I'm quite new to SAM and have some problems.
I have set up a PS monitor. The script runs a utility (microsoft log parser) which again parses a IIS log on a remote server. The Log Parser tool is installed locally (on the SAM server which is 32bit).
The script is as follows:
$a = & "c:\Program Files\Log Parser 2.2\LogParser.exe" -i:iisw3c -o:csv -stats:off -headers:off -icheckpoint:c:\crmlogs.lpc "SELECT top 100 cs-uri-stem, avg(time-taken) as avgtimeMS, count(*) as Hits FROM \\xxxxxxxx\e$\inetpub\logs\LogFiles\W3SVC3\u_ex*.log group by cs-uri-stem "
foreach($line in $a){
$url, $avg, $hits = $line -split ','
if($url){
Write-host "Statistic.AvgMS: $avg"
Write-host "Message.AvgMS: $url"
Write-host "Statistic.Hits: $hits"
Write-host "Message.Hits: $url"
}
}
exit(0)
I have given the SAM server "Full control" on the IIS logfolder (and all files).
The problem is an access denied error I get on the remote folder. See output below:
Output: ==============================================
Statistic.AvgMS:
Message.AvgMS: Task aborted.
Statistic.Hits:
Message.Hits: Task aborted.
Errors: ==============================================
LogParser.exe : Cannot open : Error opening files: Error searching for files in
At line:1 char:7
+ $a = & <<<< "c:\Program Files\Log Parser 2.2\LogParser.exe" -i:iisw3c -o:csv -stats:off -headers:off -icheckpoint:c:\crmlogs.lpc "SELECT top 100 cs-uri-stem, avg(time-taken) as avgtimeMS, count(*) as Hits FROM \\xxxxxxx\e$\inetpub\logs\LogFiles\W3SVC3\u_ex*.log group by cs-uri-stem "
+ CategoryInfo : NotSpecified: (Cannot open + FullyQualifiedErrorId : NativeCommandError
folder \\xxxxxxx\e$\inetpub\logs\LogFiles\W3SVC3: Access is denied.
Execution mode is Localhost and the Credential for Monitoring is a domain admin. I have also tried to "Run the script under specified account:"
What am I missing here?