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


Can I Get A List Of Used Usernames In Of PRTG?

Votes:

0

Your Vote:

Up

Down

I have an awful lot of devices and groups using different accounts for monitoring. One of them has changed and PRTG keeps locking the account because it's still using the old username.

Is there any way to retrieve a list of usernames configured in the groups and devices?

credentials devices groups list powershell

Created on Oct 26, 2016 9:12:45 AM by  Stephan Linke [Paessler Support]

Last change on Dec 14, 2016 7:14:31 AM by  Stephan Linke [Paessler Support]



5 Replies

Accepted Answer

Votes:

4

Your Vote:

Up

Down

The following script will give you a sortable list of all usernames configured in devices and groups, which can be filtered as necessary. Simply save it as PRTG-GetCredentials.ps1 and execute it in a PowerShell window. The list will look like this:

Credential Overview

Note that inherited can also mean "not configured".

Attention You can't retrieve passwords with this. Only configured domains and usernames.

Here's the actual script:

#requires -version 4.0
# ___ ___ _____ ___
#| _ \ _ \_   _/ __|
#|  _/   / | || (_ |
#|_| |_|_\ |_| \___|
#  Credential Lister
###################
#
# What exactly is this? 
###################
# This script shows you all the configured credentials in PRTG (only domain and username).
# This will allow you to discern where a faulty account is stored in case it gets locked due to PRTG
# still using outdated credentials. It will show all types of credentials.
################### 
#
# How does it work? 
###################
# Simply execute the script on your PRTG server and it will show a filterable and sortable list. 
# Depending on the size of your configuration, it may take a while, please be patient. 
###################
#
# How do I configure the script itself? 
###################
# The script doesn't need any configuration. 
#
# Version History
# ----------------------------
# 1.1        [Bugfix] Groups were discarded and are now included in the view
# 1.0        Initial Release
# # # # # # # # # # # # # # # # # # # # # # # # # #

#region configuration
## PRTG configuration 
[string] $ConfigurationFilePath = ((Get-ItemProperty -Path "hklm:SOFTWARE\Wow6432Node\Paessler\PRTG Network Monitor\Server\Core" -Name "Datapath").DataPath) + "PRTG Configuration.dat"
   [xml] $configuration = New-Object -TypeName XML;
         $configuration.Load($ConfigurationFilePath)

## nodes 
$prtgGroups  = $configuration.SelectNodes("//group")
$prtgDevices = $configuration.SelectNodes("//device")
#endregion

#region function
<# Function Section
#################################
All functions of the script are defined here. 
############################### #>

<# Function Name: This-GetXMLValue
#################################
Used For: Retrieving XML values. Returns inherited if the trim fails (i.e. if there's nothing to trim
#################################
Parameters: 
# [xml]    object - the object that should have it's node extracted
# [string] node   - the node you want retrieved
################################# #>
function This-GetXMLValue($object,[string]$node){

    try   { $value = $object.data.$node.trim(); }
    catch { $value = "Inherited" }

    return $value;

}
#endregion

$Credentials = foreach($prtgGroup in $prtgGroups){
    [pscustomobject]@{
            ID   = $prtgGroup.ID
            Name = $prtgGroup.data.name.Trim()
            Type = "Group"
            "Windows Domain"  = (This-GetXMLValue -node "windowslogindomain" -object $prtgGroup)
            "Windows Login" = $prtggroup.data.windowsloginusername.InnerText.trim()
            "Linux Login"     = (This-GetXMLValue -node "linuxloginusername" -object $prtgGroup)
            "ESX Login"       = (This-GetXMLValue -node "esxuser" -object $prtgGroup)
            "Database Login"  = (This-GetXMLValue -node "dbuser" -object $prtgGroup)
            "SNMP Community"  = (This-GetXMLValue -node "snmpuser" -object $prtgGroup)
           }
}

$Credentials += foreach($prtgDevice in $prtgDevices){
    [pscustomobject]@{
            ID   = $prtgDevice.ID
            Name = $prtgDevice.data.name.Trim()
            Type = "Device"
            "Windows Domain" = (This-GetXMLValue -node "windowslogindomain" -object $prtgDevice)
            "Windows Login" = $prtggroup.data.windowsloginusername.InnerText.trim()
            "Linux Login"    = (This-GetXMLValue -node "linuxloginusername" -object $prtgDevice)
            "ESX Login"      = (This-GetXMLValue -node "esxuser" -object $prtgDevice)
            "Database Login" = (This-GetXMLValue -node "dbuser" -object $prtgDevice)
            "SNMP Username"  = (This-GetXMLValue -node "snmpuser" -object $prtgDevice)
           }
}
#>

$Credentials | Out-GridView -Title "PRTG Credentials"

Created on Oct 26, 2016 9:20:41 AM by  Stephan Linke [Paessler Support]

Last change on Dec 10, 2018 10:47:01 AM by  Stephan Linke [Paessler Support]



Votes:

0

Your Vote:

Up

Down

does not show windowsloginusername correctly (shows "inherited" for all names)

used following line instead to get the correct login name:

"Windows Login" = $prtggroup.data.windowsloginusername.InnerText.trim() instead of: "Windows Login" = (This-GetXMLValue -node "windowsloginusername" -object $prtgGroup)

analog for $prtgDevice

Created on Dec 6, 2018 9:37:36 AM by  computerix (0) 1

Last change on Dec 6, 2018 10:45:25 AM by  Sven Roggenhofer [Paessler Technical Support]



Votes:

0

Your Vote:

Up

Down

@computerix Thanks for the hint, fixed it in the initial post :)


PRTG Scheduler | PRTGapi | Feature Requests | WMI Issues | SNMP Issues

Kind regards,
Stephan Linke, Tech Support Team

Created on Dec 10, 2018 10:47:31 AM by  Stephan Linke [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Where i need to Run this script? Core Server or Probes? Are you sure this script works in last versions of PRTG? Trying to use at 18.4.46.1754+ and it show none of my SNMP community of entire PRTG and it shows some of my Windows Servers Logins.

Created on Dec 14, 2018 8:55:59 AM by  Vasiliy (0) 1



Votes:

0

Your Vote:

Up

Down

This needs to be run on the PRTG Server itself. It's normal for the communities not to show up, as they're encrypted (since they're considered passwords internally).


PRTG Scheduler | PRTGapi | Feature Requests | WMI Issues | SNMP Issues

Kind regards,
Stephan Linke, Tech Support Team

Created on Dec 14, 2018 9:05:29 AM by  Stephan Linke [Paessler Support]



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.