Quantcast
Channel: Microsoft Intune
Viewing all articles
Browse latest Browse all 1216

Detection script help - failing even when sucessful

$
0
0

Hi all,

I'm struggling with a detection script, which to my eyes seems to be absolutely correct. It outputs $true as it should, but detection always fails.

I'm getting "Exitcode is defined as success but it actually failed according to detection result" - but I'm sure the SD Out is 0. (I know there's a bit of redundancy in there, and some stupidly named variables!)

I'm sure this is very simple - please someone spot what's wrong?

Powershell
$time=(Get-Date-Format"dddd dd-MM-yyyy HH-mm")$printername=get-contentprintername.txtStart-Transcript-Path"c:\temp\$printername - $time.txt"$printers=get-printer$printersWrite-Output$env:USERNAMEforeach($printerin$printers){if($printer.Name-like"*\\azuksaadc01\Harlow Toshiba 3005AC MFP - Main Office*"){$ihazprinter="yes"break}else{$ihazprinter="no"}}if(...

Viewing all articles
Browse latest Browse all 1216

Trending Articles