[TUTO] – Desktop Info : Comment configurer et déployer Desktop Info par GPO

0
5427

Sommaire

Desktop Info affiche des informations à propos de votre système en temps réel directement sur votre écran. Cette application est entièrement paramétrable via son fichier de configuration, il vous sera possible de régler les informations affichées, régler la position de l’affichage, régler les couleurs d’affichage et etc…

L’application est autonome et ne nécessite aucune installation sur votre système, il vous suffit d’exécuter le programme pour lancer le processus. Il est également bien de souligner que cette application ne consomme que très peu de ressource système et fonctionnera donc parfaitement dans tous vos environnements.

Un peu plus d’informations concernant Desktop Info : http://www.glenn.delahoy.com/software/

 

Téléchargement des sources

Les sources sont disponibles via le site internet officiel ici même : http://www.glenn.delahoy.com/software/

Plusieurs fichiers seront présents :

  • DesktopInfo.exe : Il s’agit de l’application exécutable.
  • desktopinfo.ini : Il s’agit du fichier de configuration, nous reviendrons plus tard dessus
  • readme.txt : Il s’agit d’un fichier d’aide.

 

Copiez ces fichiers dans un partage, nous les utiliserons par la suite avec le script.

 

Configuration de l’application

Editez le fichier « desktopinfo.ini ».

 

Pour chaque catégorie, vous pourrez configurer :

  • L’activation ou non de l’affichage
  • L’intervalle de rafraîchissement
  • La couleur d’affichage

 

Voici un exemple de mon fichier de configuration (CF image ci-dessus pour l’exemple) :

[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 et déploiement

Nous allons maintenant nous attarder sur le scripting et le déploiement automatique de Desktop Info. Le but étant d’automatiser le lancement de l’application lorsque vous ouvrez une nouvelle session sur un serveur.

Le script sera effectué en Powershell et nous automatiserons le déploiement par une GPO.

 

Scripting

Voici le script que je vous propose, il fonctionne comme cela :

  • Copie en local des sources (écrase le fichier de configuration .ini à chaque ouverture de session)
  • Exécution de Desktop Info en local

Note : N’oubliez pas de modifier et adapter les variables du scripts à votre environnement (CF bloc « Variables » 🙂 ).

#########################################################################################
#
# (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 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

 

Déploiement GPO

Créez une nouvelle GPO puis éditez la.

Rendez-vous dans :

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

 

Cliquez sur l’onglet « PowerShell Scripts » puis cliquez sur « Add… » pour ajouter le script que nous venons de créer.

 

Ajoutez le script via « Browse… » sans saisir de paramètres puis cliquez sur « OK »

 

Si vous avez tout correctement configuré, alors l’application Desktop Info devrait automatiquement se lancer à chaque ouverture de session.

LAISSER UN COMMENTAIRE

S'il vous plaît entrez votre commentaire!
S'il vous plaît entrez votre nom ici