New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


account lockout script

Votes:

0

Your Vote:

Up

Down

hello i am using the following script to monitor lockout accounts

the problem is that i have locked 2 tested accounts and yet in prtg sensor, i see that value is 0 when i am running this script in PowerShell is perfect it sows all i need but in prtg dashboard, i get 0 reports can some help

Import-Module ActiveDirectory

$server=Search-ADAccount -LockedOut -UsersOnly |  Where-Object {$_.Enabled -like “true”}
if ($server.count -eq $null -and $server -eq $null){
    $a=0
}
Elseif ($server.count -eq $null -and $server -ne $null){
    $a=1
}
Else
{
    [email protected]($server.count)
    
}
Write-Host "<prtg>"
Write-Host "<result>" 
"<channel>Locked Out Users</channel>" 
    
"<value>"+ $a +"</value>" 
"</result>"
"<text>" + (($server | select SamAccountName | ConvertTo-Csv -NoTypeInformation | select -skip 1 ) -join ", ").replace("""","") + "</text>"
Write-Host "</prtg>"

exe-script-sensor exexml prtg-server-exe

Created on Jul 22, 2019 2:47:17 PM by  cgav (0) 1

Last change on Jul 22, 2019 3:10:59 PM by  Dariusz Gorka [Paessler Support]



8 Replies

Votes:

0

Your Vote:

Up

Down

Hi there,

Please activate the "Write EXE result to disk" option in the sensor's settings and check the log files (Result of Sensor XXX.Data.txt and Result of Sensor XXX.txt) located on the corresponding probe under "C:\ProgramData\Paessler\PRTG Network Monitor\Logs (Sensors)".
Do you see any reasons for the sensor to fail?

Best regards.

Created on Jul 22, 2019 3:11:40 PM by  Dariusz Gorka [Paessler Support]



Votes:

0

Your Vote:

Up

Down

the sensor is not failing g is in green state and bellow the sesnor name is simple ok no lockout account name no nothing :)

Created on Jul 23, 2019 6:28:38 AM by  cgav (0) 1



Votes:

0

Your Vote:

Up

Down

Hi there,

As long as the sensor offers output and valid channels, you won't see an error. Therefore please still check the sensor results.

Best regards.

Created on Jul 23, 2019 7:39:31 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

Your Vote:

Up

Down

hey guys thanks for your replys the problem is they are lockout accounts in my ad when i run the script simple from powershell i can see them the sensor in prtg simple gives me an ok and the vallue stays to 0 for some reason but for sure i have lockout accounts

Created on Jul 23, 2019 8:08:41 AM by  cgav (0) 1



Votes:

0

Your Vote:

Up

Down

Hi there,

Have you read my initial reply? Please activate the "Write Result to Disk"-option in the sensor settings and check the result files. It is possible that the scripts acts completely different when executed via PRTG.

Best regards.

Created on Jul 23, 2019 10:31:00 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

Your Vote:

Up

Down

i did activate it but for some reason, no logs are created

Created on Jul 23, 2019 10:32:19 AM by  cgav (0) 1



Votes:

0

Your Vote:

Up

Down

Hi there,

Have you checked the folder on the correct probe?

Best regards.

Created on Jul 23, 2019 10:59:23 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

Your Vote:

Up

Down

fixed the problem was the account was running under system i changed the creadntia to parent windows and is working thank you all for your support

Created on Jul 24, 2019 8:37:20 AM by  cgav (0) 1



Please log in or register to enter your reply.


Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.