We have EXE/script sensor defined running script below.
net use s: /delete net use s: \\10.10.0.43\MyLibrary\Zalohy\Miranda /user:jmeno heslo /PERSISTENT:NO $result = Get-ChildItem s:\|where{$_.LastWriteTime -gt (get-date).AddDays(-2)} $result = @($result).Count; if($result -eq 2) { write-host -f green 1:OK } else { if ($result -gt 0){ write-host -f yellow 2:WARNING } else {write-host -red 0:ERROR} }
After running this script in command line on Win-machine is everything OK.... But running the same in sensor ends with this error message:
System Error: Cannot find drive. A drive with the name 's' does not exist. At D:\RPTG\custom sensors\EXE\Miranda.ps1:5 char:24 + $result = Get-ChildItem <<<< s:\|where{$_.LastWriteTime -gt (get-date).AddDa ys(-2)} + CategoryInfo : ObjectNotFound: (s: (code: PE022)
It seems like problem using net use command...
Thank you in advance, Jan
Add comment