Je partage ce que je trouve avec la toile
16 May 2012 by Etienne

Petit coup de main sur un TP de Web Referencements!

Bonjour a tous,

Pour un TP en cours j’ai besoin d’un petit coup de main !
Allez sur les liens suivants :
Twitter
Page Facebook
Le site de l’inspecteur Gadget au chapeau Rouge
le compte Facebook!

 

Merci!!

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
  •   •   •   •   •
15 January 2012 by Etienne

Changer le mot de passe Root sans démarrer le système (Dockstar)

Bonjour!

Hier j’ai réinstallé une débina sur mon DockStar, je n’ai pas pensé a changer mon password par défaut avec un SSH activé …

J’ai donc réinitialisé mon mot de passe sans pouvoir me logguer sur la clé USB ou est mon installation de Debian.

Pogoplug:~$ mount /dev/sda1 /mnt
## d'abord je monte ma clé USB
Pogoplug:~$ mount -o bind /dev /mnt/dev/
#je liste mes devices sur le système que je vais chrooter
Pogoplug:~$ mount -o bind /proc /mnt/proc/
#la même chose pour les procs
Pogoplug:~$ mount -o bind /sys /mnt/sys
#le sys
Pogoplug:~$ /usr/sbin/chroot /mnt
#je chroot
root@Pogoplug:/# passwd
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
#et hop...

Moralité ça m’apprendra !

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
  •   •   •   •   •
4 January 2012 by Etienne

DockStar ArchLinux kernel 3

Mon frère m’a récemment prêté un DockStar de chez Seagate sur lequel il est possible d’installer Linux en remplaçant une partie du bootloader.

J’ai donc installé un Arch Linux (Debian Based). Comme ce DockStar dispose que de peu de ressource en mémoire vive (128 Mo) et que je veux faire tourner un maximum d’éléments je suis en train d’optimisé les packages installés, je vous donne la liste des packages que j’ai trouvés avec les équivalents “lourds”.

  • Nginx en remplacement d’Apache
  • Jetty en remplacement de Tomcat
  • DropBear en remplacement de OpenSSH
  • Udhcp en remplacement de dhcpcd (j’ai des soucis avec la Freebox V6 et une éventuelle IP fixe, que j’aurais préférée, tant pis je fais une réservation et puis c’est tout!)
  • Vsftpd en remplacement de FTPd, pour plusieurs raisons : Je l’aime bien, les fichiers de configuration sont clairs et en termes de sécurité je n’ai pas eu de retour de failles nombreuses. Voir mon tuto sur un FTP encrypté en mode anonyme http://etiennedeneuve.free.fr/?p=69

J’ajouterais des éléments au fur et à mesure de mon avancé ainsi que les configurations que j’utilise ainsi que les éléments du système que j’ai désactivés.

DHCP :

PID     USER      PR  NI  VIRT    RES     SHR S   %CPU %MEM    TIME+  COMMAND
300    root        20   o    1888     520    416 S      0.0        0.4    0:00.00        dhcpcd
0,4 % de la ram pour un DHCP client ça fait beaucoup je trouve…
Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
  •   •   •   •   •
2 November 2011 by Etienne

VMware tools sur une machine virtuelle Centos

Installation des Vmware Tools pour Centos 6.0 sur Vmware Workstation 8.0

dans le Menu de VMware Workstations, il suffit de cliquer sur le Menu VM puis de choisir Install Vmware Tools.

lancer un Shell en tant que root et taper

[root@centos ~]# mkdir /mnt/cdrom
[root@centos ~]# mount /dev/cdrom /mnt/cdrom/
mount: block device /dev/sr0 is write-protected, mounting read-only
[root@centos ~]# cp /mnt/cdrom/
manifest.txt                     VMwareTools-8.8.0-471268.tar.gz
[root@centos ~]# cp /mnt/cdrom/VMwareTools-8.8.0-471268.tar.gz /root/
[root@centos ~]# tar -xf /root/VMwareTools-8.8.0-471268.tar.gz
[root@centos ~]# ll
total 58040
-rw-------. 1 root root     2058 Nov  1 17:39 anaconda-ks.cfg
-rw-r--r--. 1 root root    43095 Nov  1 17:39 install.log
-rw-r--r--. 1 root root    10915 Nov  1 17:37 install.log.syslog
-r--r--r--. 1 root root 59363249 Nov  2 10:31 VMwareTools-8.8.0-471268.tar.gz
drwxr-xr-x. 7 root root     4096 Aug 22 04:17 vmware-tools-distrib
[root@centos ~]# ./vmware-tools-distrib/
bin/               etc/               lib/
doc/               installer/         vmware-install.pl
[root@centos ~]# ./vmware-tools-distrib/vmware-install.pl
Installing VMware Tools.
In which directory do you want to install the binary files?
[/usr/bin]
What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
[/etc/rc.d]
What is the directory that contains the init scripts?
[/etc/rc.d/init.d]
In which directory do you want to install the daemon files?
[/usr/sbin]
In which directory do you want to install the library files?
[/usr/lib/vmware-tools]
In which directory do you want to install the documentation files?
[/usr/share/doc/vmware-tools]
The path "/usr/share/doc/vmware-tools" does not exist currently. This program
is going to create it, including needed parent directories. Is this what you
want? [yes]
The installation of VMware Tools 8.8.0 build-471268 for Linux completed
successfully. You can decide to remove this software from your system at any
time by invoking the following command: "/usr/bin/vmware-uninstall-tools.pl".
Before running VMware Tools for the first time, you need to configure it by
invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want
this program to invoke the command for you now? [yes]
Initializing...
Making sure services for VMware Tools are stopped.
[EXPERIMENTAL] The VMware FileSystem Sync Driver (vmsync) is a new feature that
creates backups of virtual machines. Please refer to the VMware Knowledge Base
for more details on this capability. Do you wish to enable this feature?
[no] no
Found a compatible pre-built module for vmci.  Installing it...
Found a compatible pre-built module for vsock.  Installing it...
The module vmxnet3 has already been installed on this system by another
installer or package and will not be modified by this installer.  Use the flag
--clobber-kernel-modules=vmxnet3 to override.
The module pvscsi has already been installed on this system by another
installer or package and will not be modified by this installer.  Use the flag
--clobber-kernel-modules=pvscsi to override.
The module vmmemctl has already been installed on this system by another
installer or package and will not be modified by this installer.  Use the flag
--clobber-kernel-modules=vmmemctl to override.
The VMware Host-Guest Filesystem allows for shared folders between the host OS
and the guest OS in a Fusion or Workstation virtual environment.  Do you wish
to enable this feature? [yes] yes
Found a compatible pre-built module for vmhgfs.  Installing it...
Found a compatible pre-built module for vmxnet.  Installing it...
!!! [EXPERIMENTAL] !!!
VMware automatic kernel modules enables automatic building and installation of
VMware kernel modules at boot they are not already present.  By selecting yes,
you will be enabling this experimental feature.  You can always disable this
feature by re-running vmware-config-tools.pl.
Would you like to enable VMware automatic kernel modules?
[yes] yes
Disabling timer-based audio scheduling in pulseaudio.
Detected X server version 1.7.7
Stopping HAL daemon:                                       [  OK  ]
Starting HAL daemon:                                       [  OK  ]
X is running fine with the new config file.
Creating a new initrd boot image for the kernel.
vmware-tools start/running
The configuration of VMware Tools 8.8.0 build-471268 for Linux for this running
kernel completed successfully.
You must restart your X session before any mouse or graphics changes take
effect.
You can now run VMware Tools by invoking "/usr/bin/vmware-toolbox-cmd" from the
command line or by invoking "/usr/bin/vmware-toolbox" from the command line
during an X server session.
To enable advanced X features (e.g., guest resolution fit, drag and drop, and
file and text copy/paste), you will need to do one (or more) of the following:
1. Manually start /usr/bin/vmware-user
2. Log out and log back into your desktop session; and,
3. Restart your X session.
Enjoy,
--the VMware team
[root@centos ~]#/./usr/bin/vmware-user
[root@centos ~]# reboot

Une fois le reboot effectué, si vous avez besoin de monter un partage Vmware :

[root@centos ~]# mount.vmhgfs .host:/partage /mnt/hgfs
Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
  •   •   •   •   •
2 August 2011 by Etienne

Wsus Offline, ou l’art de plus attendre après les mises à jours

Bonjour !

Je travaille actuellement pour Informatique et Services à Caen. J’ai constaté que certaines machines pour les particuliers nous demandaient des heures de mises à jour, j’ai donc cherché un moyen d’aller plus vite… Windows Software Update Services ? Non, ce n’est pas possible, il faut être membre de l’Active Directory…

Puis j’ai trouvé ceci :

http://www.wsusoffline.net/

Wsus offline permets de télécharger toutes les mises à jour Microsoft pour Windows et d’Office, et crée un script qui va installé toutes les mises à jour, en fonction de ce qui est nécessaire ou ce que vous avez choisi service pack compris, le tout en mode silencieux s’il vous plait. J’ai mis 24 h à tout téléchargé entre les mises à jour Windows, Office, etc. Mais quel gain de temps !

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
  •   •   •   •   •
1 August 2011 by Etienne

Exchange 2007 – Vérification des bases de données

Exchange 2007 :

De temps en temps, un nettoyage des bases de données d’Exchange est nécessaire, voici comment je procède :

[PS] C : \Windows\system32>Dismount-Database "Public Folder Database"

Confirmer
Êtes-vous sûr de vouloir effectuer cette action ?
Démontage de la base de données « SERVEURIS.i-s.local\Public Folder Database ».
[O] Oui  [T] Oui pour tout  [N] Non  [U] Non pour tout  [S] Suspendre
[?] Aide(la valeur par défaut est « O ») : O
[PS] C : \Windows\system32>isinteg.exe -s serveuris -test Alltests0% complete.
Databases for server serveuris:
Only databases marked as Offline can be checked

Index  Status       Database-Name
Storage Group Name: First Storage Group
1    Offline      Mailbox Database
Storage Group Name: Second Storage Group
2    Offline      Public Folder Database
Enter a number to select a database or press Return to exit.
2
You have selected Second Storage Group / Public Folder Database.
Continue?(Y/N)Y
Test Search Folder Links result: 0 error(s); 0 warning(s); 0 fix(es); 0 row(s);
time: 0h : 0m:0s
Test Global result: 0 error(s); 0 warning(s); 0 fix(es); 1 row(s); time: 0h : 0m : 0s
Test Delivered To result: 0 error(s); 0 warning(s); 0 fix(es); 0 row(s); time: 0h : 0m : 0s
Test Repl Schedule result: 0 error(s); 0 warning(s); 0 fix(es); 0 row(s); time : 0h : 0m : 0s
Test Timed Events result: 0 error(s); 0 warning(s); 0 fix(es); 0 row(s); time: 0h : 0m : 0s
Test reference table construction result: 0 error(s); 0 warning(s); 0 fix(es); 0 row(s); time: 0h : 0m : 1s
Test Folder result: 0 error(s); 16 warning(s); 0 fix(es); 100 row(s); time: 0h : 0m : 0s
Test Deleted Messages result: 0 error(s); 0 warning(s); 0 fix(es); 0 row(s); time: 0h : 0m:0s
Test Message result: 0 error(s); 0 warning(s); 0 fix(es); 660 row(s); time: 0h : 0m : 0s
Test Attachment result: 0 error(s); 0 warning(s); 0 fix(es); 10208 row(s); time: 0h : 0m : 0s
Test Per-User Read result: 0 error(s); 0 warning(s); 0 fix(es); 0 row(s); time : 0h : 0m : 0s
Test Replication result: 0 error(s); 0 warning(s); 0 fix(es); 4 row(s); time: 0h : 0m : 0s
Test Message Tombstone result: 0 error(s); 0 warning(s); 0 fix(es); 6 row(s); time: 0h : 0m : 0s
Test Folder Tombstone result: 0 error(s); 0 warning(s); 0 fix(es); 0 row(s); time: 0h : 0m : 0s
Test reference count verification result: 0 error(s); 0 warning(s); 0 fix(es); 0 row(s); time: 0h : 0m:0s
[PS] C : \Windows\system32>/Dumpster Count) of total  16 tests; 100% complete.
[PS] C : \Windows\system32>eseutil.exe /G 'D : \Program Files\Microsoft\Exchange Server\Mailbox\Second Storage Group\Public Folder Database.edb'

Extensible Storage Engine Utilities for Microsoft(R) Exchange Server
Version 08.03
Copyright (C) Microsoft Corporation. All Rights Reserved.

Initiating INTEGRITY mode...
Database: D:\Program Files\Microsoft\Exchange Server\Mailbox\Second Storage Group\Public Folder Database.edb
Temp. Database: TEMPINTEG15624.EDB

Checking database integrity.

Scanning Status (% complete)

0    10   20   30   40   50   60   70   80   90  100
|----|----|----|----|----|----|----|----|----|----|
...................................................

Integrity check successful.

Operation completed successfully in 331.783 seconds.
[PS] C : \Windows\system32>eseutil.exe /D 'D : \Program Files\Microsoft\Exchange Server\Mailbox\First Storage Group\Mailbox Database.edb'

Extensible Storage Engine Utilities for Microsoft(R) Exchange Server
Version 08.03
Copyright (C) Microsoft Corporation. All Rights Reserved.

Initiating DEFRAGMENTATION mode...
Database: D : \Program Files\Microsoft\Exchange Server\Mailbox\First Storage Group\Mailbox Database.edb

Defragmentation Status (% complete)

0    10   20   30   40   50   60   70   80   90  100
|----|----|----|----|----|----|----|----|----|----|
...................................................

Moving 'TEMPDFRG15392.EDB' to 'D : \Program Files\Microsoft\Exchange Server\Mailbox\First Storage Group\Mailbox Database.edb'...
File Copy Status (% complete)

0    10   20   30   40   50   60   70   80   90  100
|----|----|----|----|----|----|----|----|----|----|
...................................................

Note:
It is recommended that you immediately perform a full backup
of this database. If you restore a backup made before the
defragmentation, the database will be rolled back to the state
it was in at the time of that backup.

Operation completed successfully in 944.336 seconds.
[PS] C : \Windows\system32>Mount-Database "Mailbox Database"
[PS] C : \Windows\system32>Mount-Database "Public Folder Database"
Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
  •   •   •   •   •
30 July 2011 by Etienne

Configuration de Wifi en Shell

Bonjour à tous et à toutes.

J’ai tout récemment installé une Fedora sur un vieux portable qui trainait chez moi : Pentium 4 1ghz, 512 de RAM… Bref un vieux truc, je me suis dit pourquoi ne pas installer un Linux, sans interface graphique pour avoir quelque chose de léger et aussi de bosser le Shell Linux sans autre aide qu’Internet avec “elinks” navigateur internet basé sur du texte, man et éventuellement mon Mac pour avoir quelque chose de plus pratique pour naviguer.

Mon premier problème a été de me connecter en WiFi sur ma connexion sécurisée au moyen d’une clé WPA TKIP.

j’ai cherché et je vous livre ma solution :

tout d’abord la carte ne doit pas être activée donc on fait :

ifdown eth1

Après on vérifie que le service wpa_supplicant est arrété :

service wpa_supplicant stop

ensuite on édite le ficher de conf de wpa_supplicant :

il se trouve par défaut dans

/etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
network={
ssid="xxxxxx"
#psk="xxxxxx"
}

on la on lance

wpa_supplicant -c /chemindevotrefichierwpaconf -B
Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
  •   •   •   •   •
3 November 2010 by Etienne

Script Connexion de Lecteur réseaux

Bonjour,

Voici un script pour connecter un lecteur réseau en VB Script:

Dim oNet
Set oNet = CreateObject("Wscript.Network")
Set objShell = CreateObject("Shell.Application")
oNet.MapNetworkDrive "G:", "\\ip_du_serveur\Partage", True
objShell.NameSpace("G:").Self.Name = "Nom Visible par l'utilisateur"
msgbox "Tous les lecteurs Réseaux sont Connecté"
'optionnel c'est juste quand vous êtes en mode testing...
WSCript.Quit
Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
  •   •   •   •   •
12 October 2010 by Etienne

Première Démo en vidéo

Voici donc une vidéo qui explique comment faire un lecteur réseau personnel accessible uniquement à l’utilisateur lui-même et comment créer un modèle pour pouvoir créé des utilisateurs similaires sans refaire toute la configuration…

Je suis en train de préparer un script avec Excel et Powershell pour automatiser la création des groupes et des utilisateurs.

 

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
  •   •   •   •   •
8 July 2010 by Etienne

Un peu de VBScript?

Récupération d’information d’inventaire dans Excel par du VBscript et des objets WMI

Je vous propose un petit script, en VBScript, il permet de lire des objets WMI en VB et de les écrire dans Microsoft Excel. Ce script permet de récupérer des informations en vue d’une utilisation dans un atelier ou en déplacement si vous n’avez pas de gestionnaire de parc. Il récupère les éléments WMI et Security Center (1 et 2)

const HKEY_CURRENT_USER = &H80000001
const HKEY_LOCAL_MACHINE = &H80000002
' déclaration de deux constantes pour récupéré
' le nom de l'utilisateur
strComputer = "."
'les objets WMI proviennent de la machine locale
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\default:StdRegProv")
'on déclare la variable oReg pour récupéré les infos dans l'arboresence WMI
strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
'Chemin d'acces au nom de l'utilisateur dans la Base des Registres
strValueName = "DefaultUserName"
'Valeur que l'on recherche dans la base des registre
'(le nom de l'utilisateur par défaut)
oReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, strValue
x=2
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
' On le définit comme visible
Set objWorkbook = objExcel.Workbooks.Add()
'on ajoute un classeur
Set objWorksheet = objWorkbook.Worksheets(1)
strEntreprise = "Etienne Deneuve"
'on ajoute une feuille de calcul
' on défini que x est égal a 2 pour la suite
objExcel.Cells(1, 1).Value = strEntreprise
objExcel.Cells(1, 1).Font.Size = 12
objWorksheet.Range(objExcel.Cells(1, 1), objExcel.Cells(1, 8)).Merge
objExcel.Cells(2, 1).Value = "Machine :" '3,2
objExcel.Cells(2, 3).Value = "Model :" '6.2
objExcel.Cells(2, 5).Value = "Fabricant :" '9.2
objExcel.Cells(4, 1).Value = "N° de Série :"
objExcel.Cells(4, 3).Value = "Mémoire :"
objExcel.Cells(4, 5).Value = "IP :"
objExcel.Cells(6, 1).Value = "Masque :" '3,2
objExcel.Cells(6, 3).Value = "Passerelle :" '6.2
objExcel.Cells(3, 1).Value = "Nom de Domaine :" '9.2
objExcel.Cells(8, 1).Value = "Disque dur :"
objExcel.Cells(8, 3).Value = "Anti-Virus :"
objExcel.Cells(8, 5).Value = "Pare Feu :"
objExcel.Cells(11, 1).Value = "OS :"
objExcel.Cells(11, 3).Value = "Dernier Service Pack :"
objExcel.Cells(11, 5).Value = "Licence Windows :"

Set objWMIService = _
GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
'on défini l'objet objWMIService comme chemin de base dans l'ordinateur
'local dans la classe ROOT\cimv2
Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem")
'on defini un tableau dont les objets de la colonne principal provient
'de la classe Win32_ComputerSystem
For Each objItem in colItems
'Boucle pour lire chaque objet de la classe
objWorksheet.Cells(2, 2) = ObjItem.Name
' ecrit dans la cellule le nom de l'ordinateur
objWorksheet.Cells(2 ,4) = objItem.Model
'ecrit le model de l'ordinateur
objWorksheet.Cells(4 ,4).Value = FormatNumber( _
objItem.TotalPhysicalMemory / 1048576,1,false,true,true) & " Mo"
' ecrit la quantité de mémoire Ram installé dans l'ordinateur
Next
' fin de la boucle
Set ColItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystemProduct")
' on défini une nouvelle colonne dans le tableau dont les valeurs proviennent de
' la classe Win32_ComputerSystemProduct
For Each objItem in colItems
'Nouvelle boucle
objWorksheet.Cells(2 ,6).Value = objItem.Vendor
'on écrit le nom du fabricant dans la cellule
Next
'fin de la boucle
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_NetworkAdapterConfiguration", "WQL", _
wbemFlagReturnImmediately + wbemFlagForwardOnly)
' encore un appel d'un objet mais plus spécifique celui ci,
' il va nous permettre de lire la configuration réseau de la machine

'faire une incrémentation de i
'If i = 1 Then
'si i est égal a 1 alors
x=4
y=6
z=6
Set colAdapters = objWMIService.ExecQuery _
("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
For Each objAdapter in colAdapters
If Not IsNull(objAdapter.IPAddress) Then

For i = 0 To UBound(objAdapter.IPAddress)
objWorksheet.Cells(x, 6).Value =  objAdapter.IPAddress(i)
x=x+1
Next
End If

If Not IsNull(objAdapter.IPSubnet) Then

For i = 0 To UBound(objAdapter.IPSubnet)
objWorksheet.Cells(y, 4).Value = objAdapter.IPSubnet(i)
y=y+1
Next
End If

If Not IsNull(objAdapter.DefaultIPGateway) Then

For i = 0 To UBound(objAdapter.DefaultIPGateway)
objWorksheet.Cells(z, 2).Value = objAdapter.DefaultIPGateway(i)
z=z+1
Next
End If

Next

Set colSerial = objWMIService.ExecQuery("SELECT * FROM Win32_BaseBoard", "WQL", _
wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each objSerial In colSerial
objWorkSheet.Cells(4, 2).Value = objSerial.SerialNumber
Next

Set colDisk = objWMIService.ExecQuery("Select * From Win32_LogicalDisk ", "WQL", _
wbemFlagReturnImmediately + wbemFlagForwardOnly)
x = 8
For Each objDisk In colDisk
IF NOT objDisk.Size = "" Then
IF NOT FormatNumber(  objDisk.Size / 1073741824,0,false,true,true) = 1 OR FormatNumber(  objDisk.Size / 1073741824,0,false,true,true) = 5 THEN
objWorkSheet.Cells(x, 2).Value = FormatNumber(  objDisk.Size / 1073741824,0,false,true,true) & " Go"
x=x+1
end if
end if

Next
Set colSettings = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")

For Each objOperatingSystem in colSettings

OSVersion = Left(objOperatingSystem.Version,3)
ProductType = objOperatingSystem.ProductType

'Time to convert numbers into names
Select Case OSVersion
Case "6.1"
OSName = "Windows 7"
objWorkSheet.Cells(11, 2).Value = OSName
Set oWMI = GetObject( _
"winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\SecurityCenter2")
Set colItems = oWMI.ExecQuery("Select * from AntiVirusProduct")
x=8
For Each objItem in colItems
objWorkSheet.Cells(x, 4).Value = objItem.displayName
x=x+1
Next
Set colItems = oWMI.ExecQuery("Select * from FirewallProduct")
For Each objItem in colItems
objWorkSheet.Cells(8, 6).Value = objItem.displayName
x=x+1
Next
Case "6.0"
OSName = "Windows Vista"
objWorkSheet.Cells(11, 2).Value = OSName
Set oWMI = GetObject( _
"winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\SecurityCenter2")
Set colItems = oWMI.ExecQuery("Select * from AntiVirusProduct")
x=8
For Each objItem in colItems
objWorkSheet.Cells(x, 4).Value = objItem.displayName
x=x+1
Next
Set colItems = oWMI.ExecQuery("Select * from FirewallProduct")
For Each objItem in colItems
objWorkSheet.Cells(8, 6).Value = objItem.displayName
Next
Case "5.2"
OSName = "Windows 2003"
Case "5.1"
OSName = "Windows XP"
objWorkSheet.Cells(11, 2).Value = OSName
Set oWMI = GetObject( _
"winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\SecurityCenter")
Set colItems = oWMI.ExecQuery("Select * from AntiVirusProduct")
x=8
For Each objItem in colItems
objWorkSheet.Cells(x, 4).Value =  objItem.displayName & " " & objItem.versionNumber
x=x+1
Next
Case "5.0"
OSName = "Windows 2000"
Case "4.0"
OSName = "NT 4.0"
Case Else
OSName = "Windows ME ou +"
End Select

FindOSType = OSName
Next
Set WshShellKey = CreateObject("WScript.Shell")
Set WshNetworkKey = WScript.CreateObject("WScript.Network")
Set env = WshShellKey.environment("Process")

Set objWMIServiceKey = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Const UnInstPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
".\root\default:StdRegProv")
strDigitalProductId="HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId"
objWorkSheet.Cells(11, 6).Value = GetKey(WshShellKey.RegRead(strDigitalProductId))

Function GetKey(rpk)

Const rpkOffset=52:i=28
szPossibleChars="BCDFGHJKMPQRTVWXY2346789"

Do 'Rep1
dwAccumulator=0 : j=14
Do
dwAccumulator=dwAccumulator*256
dwAccumulator=rpk(j+rpkOffset)+dwAccumulator
rpk(j+rpkOffset)=(dwAccumulator\24) and 255
dwAccumulator=dwAccumulator Mod 24
j=j-1
Loop While j>=0
i=i-1 : szProductKey=mid(szPossibleChars,dwAccumulator+1,1)&szProductKey
if (((29-i) Mod 6)=0) and (i<>-1) then
i=i-1 : szProductKey="-"&szProductKey
End If
Loop While i>=0 'Goto Rep1

GetKey=szProductKey
End Function

x = 13
'on défini x comme egal a 8 pour géré les lignes dans Excel
objWorksheet.Cells(12, 1).Value = "Programmes Installés :"
' on ecrit dans la ligne 7 juste avant 8
Set colSoftware = objWMIService.ExecQuery _
("Select * from Win32_Product")
' on récupère la classe Product
For Each objSoftware in colSoftware
REM ' pour chaque objet dans la colonne
objWorksheet.Range(objExcel.Cells(x, 1), objExcel.Cells(x, 8)).Merge
REM ' on fusionne la ligne pour la lisibilité
objWorkSheet.Cells(x, 1).Value = objSoftware.Name
REM ' on écrit le nom du programme installé
x = x+1
REM ' on incrémente x
Next
' on fini

Set objRange = objWorksheet.UsedRange
' on déclare l'objet objRange comme égal a la dernière ligne utilisée
objRange.EntireColumn.Autofit()
' on égalise la taille des colonnes

Vous mettez le tout dans le bloc-note sauvegarder avec une extension .vbs et voilà

Bonne lecture

PS: le script n’affiche rien pendant quelques minutes au moment de la lecture des programmes installés c’est normal

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
  •   •   •   •   •