Hi,
Is it possible to pass the %LastReply% value of a PowerShell Script Test Item to a variable within a PowerShell Script as a Parameter? If so, could you provide an example of how this can be achieved?
I want to write a PowerShell Script to check how many Active Directory User Account Objects are currently active within Active Directory and then compare the current reply from within the script for counting user objects to that of the last reply from when the script was last executed.
I intend to use percentage based increase in user account objects, for example: if the last reply equalled 1400 user accounts I need to be able to retrieve this value from Hostmonitors LastReply variable so that I can then perform a percentage based comparison between the previous test result and current test result and then send back an bad status if there has been a sudden increase or decrease in user accounts (say 20% for example).
I know how to develop a PowerShell Script for this behaviour, I just don't know how I go about passing the LastReply value to the script.
Kind Regards
Craig
PowerShell Script Test
You cannot use this variable as parameter of the test but I don't think you need script to compare old and new reply.
You may use Optional Status Processing
http://www.ks-soft.net/hostmon.eng/mfra ... processing
You may use option like
- Use Warning status if (((%Reply%-%SuggestedReply%)*100 div %SuggestedReply%) > 20) or (((%SuggestedReply%-%Reply%)*100 div %Reply%) > 20)
Regards
Alex
You may use Optional Status Processing
http://www.ks-soft.net/hostmon.eng/mfra ... processing
You may use option like
- Use Warning status if (((%Reply%-%SuggestedReply%)*100 div %SuggestedReply%) > 20) or (((%SuggestedReply%-%Reply%)*100 div %Reply%) > 20)
Regards
Alex
-
- Posts: 5
- Joined: Wed Mar 16, 2016 5:12 pm
- Location: London
KS-Soft wrote:You cannot use this variable as parameter of the test but I don't think you need script to compare old and new reply.
You may use Optional Status Processing
http://www.ks-soft.net/hostmon.eng/mfra ... processing
You may use option like
- Use Warning status if (((%Reply%-%SuggestedReply%)*100 div %SuggestedReply%) > 20) or (((%SuggestedReply%-%Reply%)*100 div %Reply%) > 20)
Regards
Alex
Thanks Alex, will give this a go.
-
- Posts: 5
- Joined: Wed Mar 16, 2016 5:12 pm
- Location: London
One other question, I am setting up another PowerShell Script for reporting when an Administrator Password was last set, it returns a reply in the date format as: 03/17/2016 19:59:01 (MM/DD/YYYY HH:MM:SS), is it possible to configure a warning status to report if the date has changed since the previous reply?KS-Soft wrote:You cannot use this variable as parameter of the test but I don't think you need script to compare old and new reply.
You may use Optional Status Processing
http://www.ks-soft.net/hostmon.eng/mfra ... processing
You may use option like
- Use Warning status if (((%Reply%-%SuggestedReply%)*100 div %SuggestedReply%) > 20) or (((%SuggestedReply%-%Reply%)*100 div %Reply%) > 20)
Regards
Alex
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
-
- Posts: 5
- Joined: Wed Mar 16, 2016 5:12 pm
- Location: London
Worked perfectly, thanks again.C0deBreak3r wrote:KS-Soft wrote:You cannot use this variable as parameter of the test but I don't think you need script to compare old and new reply.
You may use Optional Status Processing
http://www.ks-soft.net/hostmon.eng/mfra ... processing
You may use option like
- Use Warning status if (((%Reply%-%SuggestedReply%)*100 div %SuggestedReply%) > 20) or (((%SuggestedReply%-%Reply%)*100 div %Reply%) > 20)
Regards
Alex
Thanks Alex, will give this a go.
-
- Posts: 5
- Joined: Wed Mar 16, 2016 5:12 pm
- Location: London