[TUTO] – Desktop Info: how to configure and deploy Desktop Info by GPO

14
20953

Sommaire

Desktop Info displays information about your system in real time directly on your screen. This application is fully customizable via its configuration file, it will be possible to adjust the information displayed, adjust the position of the display, set the display colors and etc…

The application is self-contained and requires no installation on your system, simply run the program to start the process. It is also good to note that this application uses only very little system resource and will work perfectly in all your environments.

A little more information about Desktop Info: http://www.glenn.delahoy.com/software/

 

Download sources

The sources are available via the official website here: http://www.glenn.delahoy.com/software/

Several files will be present:

  • DesktopInfo.exe: This is the application executable.
  • Desktopinfo.ini: This is the configuration file, we will return later on.
  • Readme.txt: This is a help file.

 

Copy these files in a share, we will use later with the script.

 

The application configuration

Edit the file “desktopinfo.ini”.

 

For each category, you can configure:

  • Activation or not of the display
  • The refresh interval
  • The display color

 

Here is an example of my configuration file (see image above for example) :

[options]
top=15
#left=5
#bottom=40
right=15
width=600
fontface=Arial
fontsize=13
cleartype=0
ssfontsize=17
formcolor=000000
contextmenu=1
allowdrag=0
offset=1
#language=english.ini
msnstatus=0
inimonitortime=10
#log=desktopinfo.log

[items]
# date / time
COMMENT=active:0,interval:0,color:aaaaaa,style:biu,text:Desktop Info
DATETIME=active:0,interval:1,color:EECC00
TIMEZONE=active:1,interval:60,color:EECC00
HOST=active:1,interval:0,color:EECC00,style:b
USER=active:1,interval:0,color:EECC00
BOOTTIME=active:1,interval:0,color:EECC00
UPTIME=active:0,interval:1,color:EECC00

# hardware
COMMENT=active:0,interval:0,color:aaaaaa,style:i,text:Hardware
OEMINFO=active:0,interval:0,color:0099EE
CPUTYPE=active:0,interval:0,color:0099EE
CPUCOUNT=active:0,interval:0,color:0099EE
CPUTEMP=active:0,interval:10,color:00CCEE
BATTERY=active:0,interval:60,color:00CCEE,chart:1
MOTHERBOARD=active:0,interval:0,color:0099EE
BIOS=active:0,interval:0,color:0099EE
DISPLAYCONTROLLER=active:0,interval:0,color:0099EE
AUDIOCONTROLLER=active:0,interval:0,color:0099ee
SERIALNUMBER=active:0,interval:0,color:0099ee

# windows configuration
COMMENT=active:0,interval:0,color:aaaaaa,text:Windows Configuration
OSVERSION=active:1,interval:0,color:CCCCEE
OSBUILD=active:1,interval:0,color:CCCCEE
SERVICEPACK=active:1,interval:0,color:CCCCEE
IEVERSION=active:0,interval:0,color:CCCCEE
DIRECTX=active:0,interval:0,color:CCCCEE
SCREEN=active:0,interval:120,color:CCCCEE

# network adapters
COMMENT=active:0,interval:0,color:aaaaaa,text:Network Adapters
NETWORKADAPTER=active:1,interval:30,color:55CC77,activeonly:1,count:8,filter:
IPADDRESS=active:1,interval:30,color:55CC77,offset=1
MACADDRESS=active:1,interval:60,color:55CC77,offset=1
GATEWAY=active:1,interval:30,color:55CC77,offset=1
DHCPSERVER=active:0,interval:30,color:55CC77,offset=1
WINSSERVER=active:0,interval:30,color:55CC77,offset=1
# network stack
COMMENT=active:0,interval:0,color:aaaaaa,text:Network Stack
DNSSERVER=active:0,interval:30,color:55CC77
LEASEEXPIRY=active:0,interval:30,color:55CC77
PROXY=active:0,interval:60,color:55cc77
DOMAIN=active:1,interval:30,color:55CC77
DOMAINCONTROLLER=active:1,interval:30,color:55CC77
WORKGROUP=active:0,interval:30,color:55CC77
NETCONNECTIONS=active:0,interval:10,color:55CC77,chart:0,threshold:150,tcolor:0000FF
NETPACKETS=active:0,interval:10,color:55CC77
NETPACKETSRATE=active:0,interval:10,color:55CC77,chart:2,threshold:500,tcolor:0000FF

# disks
COMMENT=active:0,interval:0,color:aaaaaa,text: 
FIXEDDISK=active:1,interval:10,color:FF9955,chart:1,threshold:90,tcolor:0000FF,count:8,shortdisplay:1,filter:
DISKIO=active:0,interval:10,color:FF9955,chart:0,threshold:10000,tcolor:0000FF

# processes
COMMENT=active:0,interval:0,color:aaaaaa,text:Processes
CPU=active:1,interval:5,color:00CCEE,chart:2,threshold:95,tcolor:0000FF
CPUUSAGE=active:0,interval:5,color:00CCEE,chart:2,threshold:95,tcolor:0000FF,count:8
PROCESSCOUNT=active:0,interval:5,color:00CCEE,chart:0,threshold:100,tcolor:0000FF
TOPPROCESSCPU=active:0,interval:5,color:00CCEE,chart:0,threshold:95,tcolor:0000FF
TOPPROCESSMEM=active:0,interval:5,color:00CCEE,chart:0,threshold:500,tcolor:0000FF
TOPPROCESSPF=active:0,interval:5,color:00CCEE,chart:0,threshold:5000,tcolor:0000FF

# memory
COMMENT=active:0,interval:0,color:aaaaaa,text:Memory
PHYSICALRAM=active:1,interval:5,color:AA77AA,chart:1,threshold:90,tcolor:0000FF,shortdisplay:1
VIRTUALMEMORY=active:0,interval:5,color:AA77AA,chart:0,threshold:90,tcolor:0000FF,shortdisplay:1
PAGEFILE=active:0,interval:5,color:AA77AA,chart:0,threshold:90,tcolor:0000FF,shortdisplay:1
PAGEFAULTS=active:0,interval:5,color:AA77AA,chart:0,threshold:5000,tcolor:0000FF

# printers
COMMENT=active:0,interval:0,color:aaaaaa,text:Printers
PRINTER=active:0,interval:60,color:888888,count:8
PRINTERSTATUS=active:0,interval:60,color:888888
DEFAULTPRINTER=active:0,interval:60,color:888888
# misc
COMMENT=active:0,interval:0,color:aaaaaa,style:iu,text:Miscellaneous - Testing
FILE=active:0,interval:10,color:ff8888,type:text,text:Setup,file:
REGISTRY=active:0,interval:10,color:ff8888,tree:0,text:Run Key,key:HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\
EVENTLOG=active:0,interval:10,color:ff8888,text:System Events,log:System
TSSESSIONS=active:0,interval:10,color:888888
UNREADMAIL=active:0,interval:60,color:888888,chart:0,threshold:10,tcolor:0000FF
ENVVAR=active:0,interval:60,color:888888,text:Logon Server,key:logonserver
LOGONSESSION=active:0,interval:60,color:888888

 

Scripting and deployment

We will now focus on scripting and automatic deployment of Desktop Info. The goal is to automate the launching of the application when you open a new session on a server.

The script will be performed in Powershell and we automate the deployment by a GPO.

 

Scripting

Here is the script that I propose, it works like this:

  • Copy local sources (overwrites the configuration at each logon .ini file)
  • Local implementation of Desktop Info

Note: Remember to modify and adapt the variables of the scripts in your environment (see “Variables” block :)).

#########################################################################################
#
# (c) Copyright 2017 - Jérémy LEBON - sys-advisor.com
#  
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#  
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
#########################################################################################

# ---------------------------------------------------------------------------------------
# Script  :  Deploy_DesktopInfo.ps1
# Objet   :  Main Script
# Author  :  Jérémy LEBON, sys-advisor.com 
# Version :  1.2
# Date    :  29/09/2017
# ---------------------------------------------------------------------------------------

#########################################################################################
###### VARIABLES 
#########################################################################################

#Local computer/server folder created for DesktopInfo
$DesktopInfoLocalPath = "C:\Exploit\DesktopInfo\"
#Path where you keep DesktopInfo
$DesktopInfoSourcePath = "\\SourcePath\"
#DesktopInfo.exe => Default Name
$DesktopInfoExe = "DesktopInfo.exe"
#DesktopInfo.ini => Default Name
$DesktopInfoIniPath = "DesktopInfo.ini"

$DesktopInfoExePath = $DesktopInfoSourcePath + $DesktopInfoExe #DesktoInfo.exe Source Path
$DesktopInfoIniPath = $DesktopInfoSourcePath + $DesktopInfoIniPath #DesktoInfo.ini path
$DesktopInfoLocalExePath = $DesktopInfoLocalPath + $DesktopInfoExe #DesktoInfo.exe Local Path

#########################################################################################

#Check if folder exist
if (-NOT (Test-Path $DesktopInfoLocalPath)) {
    New-Item -ItemType Directory c:\Exploit\DesktopInfo #Create folder
    Copy-Item $DesktopInfoExePath -Destination $DesktopInfoLocalPath #Copy DesktopInfo.exe
    Copy-Item $DesktopInfoIniPath -Destination $DesktopInfoLocalPath #Copy DesktopInfo.ini
        
}
else {
    if (-NOT (Test-Path $DesktopInfoLocalExePath)) {
        Copy-Item $DesktopInfoExePath -Destination $DesktopInfoLocalPath #Copy DesktopInfo.exe
    }

        Copy-Item $DesktopInfoIniPath -Force -Destination $DesktopInfoLocalPath #Force Copy DesktopInfo.ini
}

$Command = $DesktopInfoLocalExePath
$Argument1 = "/ini=$DesktopInfoIniPath"

& $Command $Argument1

 

GPO deployment

Create a new GPO, and then edit the.

Appointment in :

  • User Configuration
    • Windows Settings
      • Scripts (Logon/Logoff)
        • Logon

 

Click on the tab “PowerShell Scripts”, then click on “Add…” to add the script that we just created.

 

Add the script via “Browse…” without entering parameters and then click “OK”

 

If you have configured everything correctly, then the Info Desktop application should automatically begin at each logon.

JL
Fondateur de sys-Advisor.com, Passionné avant tout, je partage mon quotidien à travers ce site. #sysadmin #microsoft #vmware #tech #geek @sysadvisor

14 Commentaires

  1. Hi (does anybody read that?), I don’t get the configureation right, no matter what I do. Somehow I don’t get the IP Address (MAC aswell not) displayed.

    • Hello, Can you tell us what is absolutely wrong? I checked the powershell script and I agree with you, some characters have disappeard. I pasted back the script, it should be ok now. Do not hesitate to feedback me on this.
      Jérémy

      • Sorry for barking like that, I’m trying to get it work and I’m kinda in a hurry. It works now, but for some reason when I click on “open file location” of desktopinfo.exe process it opens the network location (the source path) instead of the local disc location created by the script. Looks like it still runs from the network.

        • Yea it runs from the local path now. I also use the english.ini for language corrections for my language so I modified your script (for my personal use only) to copy also english.ini and it works flawlessly. Thank you very much

        • Oh one more thing. After the first run of the script I deleted “desktopinfo.exe” and let ini files remain in the local folder and run the script. It threw an error. I think that the script should copy the exe file if it’s missing.

        • Very nice 🙂 looks like it is finished.

          I’m trying to make it so the script copies it to the %USERPROFILE%\Appdata\local\temp but even with powershell variable $ENV:UserProfile so far no luck.

  2. Hi, when I try to run the script on my DC it doesn’t run because the script is “not digitally signed. You cannot run this script on the current system”

    How can we fix that?

LAISSER UN COMMENTAIRE

Please enter your comment!
Please enter your name here