Monitoring of \\njiofxxx shares
i have a found script, but don't know if this correct or wrong
#sharename,\\njiofxxx
$sharename = $args[0]
$sharepath = $args[1]
if (Get-WmiObject win32_share -computername ${IP} | where-object {$_.path -eq "$sharepath"}) {
Write-Host 'Message.sharepath: Share Exists'
Write-Host 'Statistic.sharepath: 1'
}
else {
Write-Host 'Message.sharepath: SHARE NOT FOUND'
Write-Host 'Statistic.sharepath: 0'
}
Exit 0