Agreed, but if you use a discovery script, don't try to build any logic into 
it, just echo out (or PS equivalent) what the setting is and set the compliance 
rule to:
"The value returned by the specified script"
"Equals"
the following values: <your desired config> (Running in this case)



From: [email protected] [mailto:[email protected]] On 
Behalf Of Jason Sandys
Sent: Tuesday, July 30, 2013 9:48 AM
To: [email protected]
Subject: RE: [mssms] DCM Discovery Script Return Value

So, I do truly like PowerShell and advocate its use as often as possible, but 
why not use a WMI CI for this? In this case, it's much easier.

J

From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]] On Behalf Of Ryan
Sent: Tuesday, July 30, 2013 9:34 AM
To: [email protected]<mailto:[email protected]>
Subject: Re: [mssms] DCM Discovery Script Return Value

Try setting it to boolean and simplify your script to this:

(Get-Service -name <ServiceName>).Status -eq "Running"

This will return a true if the statement is true, or false if the statement is 
false.

Note, I've not done anything with Powershell and CI, so I can't say from 
experience that this will work. This is just how I'd approach it.

On Tue, Jul 30, 2013 at 9:25 AM, Beardsley, James 
<[email protected]<mailto:[email protected]>> wrote:
I never used DCM much in 2007 but in 2012, I want to use it a lot more. So I've 
been playing around with it and as a test, I set up a CI to check if a service 
is running by using a Powershell script. The script I'm using is this:

If ( $(Get-Service -Name <servicename>).Status -eq "Running" ) { Write-Host 
"True" } Else { Write-Host "False" }

I set the Data Type as "Script" and got it working but it got me thinking about 
using "Boolean" instead. If I were to use Boolean, would True/False be the 
current return value or would I need to use something else (like 0 and 1)?

Is there any good documentation on each of the data types? Technet doesn't 
elaborate much on the different options. Like "Date and Time" for example, does 
it require a certain format? Or if my script was checking the version of a file 
and it returned "2013.1", would I use the Version data type or would I just use 
String?

Also, I've used AutoIt a lot in the past for scripting. Is there any way to use 
that or maybe a .bat file as a discovery/remediation script? I'm assuming I'd 
have to use Jscript, VBScript, or Powershell to call the AutoIt script (which 
is compiled to an .exe) but just wanted to confirm that. Maybe there was a way 
through the SDK to add an additional scripting language.

Thanks.

________________________________

IRS Compliance: Any tax advice contained in this communication (including any 
attachments) is not intended or written to be used, and cannot be used, for the 
purpose of (i) avoiding penalties imposed under the Internal Revenue Code or 
applicable state or local tax law or (ii) promoting, marketing, or recommending 
to another party any transaction or matter addressed herein.

________________________________

Confidentiality Notice: This e-mail is intended only for the addressee named 
above. It contains information that is privileged, confidential or otherwise 
protected from use and disclosure. If you are not the intended recipient, you 
are hereby notified that any review, disclosure, copying, or dissemination of 
this transmission, or taking of any action in reliance on its contents, or 
other use is strictly prohibited. If you have received this transmission in 
error, please reply to the sender listed above immediately and permanently 
delete this message from your inbox. Thank you for your cooperation.





________________________________


DISCLAIMER: This is a PRIVATE AND CONFIDENTIAL message for the ordinary user of 
this email address. If you are not the intended recipient, please delete 
without copying and kindly advise us by e-mail of the mistake in delivery. 
NOTE: Regardless of content, this e-mail shall not operate to bind 1E to any 
order or other contract unless pursuant to explicit written agreement or 
government initiative expressly permitting the use of e-mail for such purpose.



Reply via email to