begin process at 2012 02 12 23:36:32
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Réseau & Internet

 > LISTER LES SITES INTERNET CONFIGURER DANS IIS AVEC ADSI

LISTER LES SITES INTERNET CONFIGURER DANS IIS AVEC ADSI


 Information sur la source

Note :
6 / 10 - par 1 personne
6,00 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :Réseau & Internet Source .NET ( DotNet ) Niveau :Initié Date de création :26/12/2004 Vu :8 183

Auteur : ABL-Online

Ecrire un message privé
Site perso
Commentaire sur cette source (1)
Ajouter un commentaire et/ou une note

 Description

Bonjour, ce code à pour but de vous montré comment lister les sites web répertoriés dans IIS en local ou sur une machine distance de votre réseaux.

Je n'ai pas encore trouver comment faire pour par exemeple stop un site ou le mettre en pause avec la propriété start, stop, pause.

Dès que je trouve, je vous tiens au courant

Source

  • Private Sub LoadSites(ByVal ServerName As String)
  • Dim oIISAdmin As System.DirectoryServices.DirectoryEntry
  • Dim oChildDirectory As System.DirectoryServices.DirectoryEntry
  • Dim oProperties As System.DirectoryServices.DirectoryEntries
  • oIISAdmin = New System.DirectoryServices.DirectoryEntry("IIS://" + ServerName + "/W3SVC")
  • cboSite.Items.Clear()
  • For Each oChildDirectory In oIISAdmin.Children
  • If IsNumeric(oChildDirectory.Name) Then
  • cboSite.Items.Add(oChildDirectory.Name & " - " & oChildDirectory.Properties("ServerComment").Value)
  • End If
  • Next
  • If cboSite.Items.Count > 0 Then cboSite.SelectedIndex = 0
  • End Sub
    Private Sub LoadSites(ByVal ServerName As String)

        Dim oIISAdmin As System.DirectoryServices.DirectoryEntry
        Dim oChildDirectory As System.DirectoryServices.DirectoryEntry

        Dim oProperties As System.DirectoryServices.DirectoryEntries

        oIISAdmin = New System.DirectoryServices.DirectoryEntry("IIS://" + ServerName + "/W3SVC")

        cboSite.Items.Clear()


        For Each oChildDirectory In oIISAdmin.Children

            If IsNumeric(oChildDirectory.Name) Then

                cboSite.Items.Add(oChildDirectory.Name & " -  " & oChildDirectory.Properties("ServerComment").Value)

            End If



        Next

        If cboSite.Items.Count > 0 Then cboSite.SelectedIndex = 0

    End Sub



 Sources du même auteur

Source avec Zip Source avec une capture Source .NET (Dotnet) GÉNÉRATION DE CODE BARRE 3 DE 9 (CODE39)
Source .NET (Dotnet) CALCUL DE L'IBAN
Source avec Zip Source avec une capture Source .NET (Dotnet) DLL COMBOSENSE , LE COMBOBOX À SAISIE SEMI-AUTOMATIQUE PARFA...
Source avec une capture Source .NET (Dotnet) RETROUVER LES FONCTIONNALITÉS DE VB6
Source .NET (Dotnet) DÉPLACEMENT D'UNE FORM N'AYANT PAS DE BARRE TITRE

 Sources de la même categorie

Source avec Zip Source avec une capture GESTIONNAIRE DE TÉLÉCHARGEMENT, AVEC REPRISE ET MULTITHREADI... par Madx23
Source avec Zip Source avec une capture CONVERTIR DU TEXTE RTF EN CODE HTML ET VICE-VERSA par vicosta
Source avec Zip Source avec une capture DICTIONAIRE TEXT/AUDIO/VISUELLE ANGLAIS AVEC WEBBROWSER CONT... par majnounmajda
Source avec Zip Source .NET (Dotnet) NSLOOKUP EN VB.NET OU COMMENT FAIRE UNE REQÛETE DNS EN PRÉCI... par ShareVB
Source avec Zip Source avec une capture MINI SEVEUR HTTP AVEC INTERFACE GRAPHIQUE ET IMPLÉMENTATIONS... par lemout

Commentaires et avis

Commentaire de thorspark le 24/11/2006 12:38:58

Pour info, voici un script (vbscript) permettant d'arrêter ou de démarrer un service web IIS sur un des serveurs du domaine

---------------------------------------------------------------------------------------

'Script d'arrêt ou de démarrage d'un service Web
'sur ordinateur distant
'-------------------------------------------------------------------------
'Usage :
'ServIIS -s nomserveur -n nomservice -a action -?
'nomserveur : nom du serveur sur le domaine
'nomservice : nom descriptif du service web à stopper ou démarrer
'action     : Start ou Stop selon s'il faut démarrer ou arrêter le service
'-?     : Affiche l'utilisation
'-------------------------------------------------------------------------


' On force la déclaration des variables
Option Explicit
On Error Resume Next

' Variables

dim fullPath,Service
dim fini,i
dim Options,numopt
dim nserveur,nservice,action

Set Options = wscript.Arguments
numopt=0

' Récupération des infos mises en arguments de la ligne de commande

while numopt< Options.count
Select Case LCase(Options(numopt))
Case "-s":
numopt=numopt+1
nserveur=Options(numopt)
Case "-n":
numopt=numopt+1
nservice=Options(numopt)
Case "-a":
numopt=numopt+1
action=Options(numopt)
Case "-?":
call usage
Case Else:
call usage
End Select
numopt=numopt+1
wend

' Programme d'arrêt ou de démarrage

fini= false
i=1:i=cint(i)
fullPath = "IIS://"&nserveur&"/w3svc/"
Do while Not fini
Set Service = GetObject(fullPath&i)
if Service.ServerComment=nservice then
if action="Start" then
Service.Start
else
Service.Stop
End if
fini=True
End if
i=i+1
Loop

' fonction qui indique la façon d'utiliser le programme

Sub Usage
MsgBox  _
"ServIIS -s nomserveur -n nomservice -a action -?"&VBCRLF& _
"             -s nomserveur : nom du serveur sur le domaine"&VBCRLF& _
"             -n nomservice : nom du service Web dans IIS"&VBCRLF& _
"             -a action : Start ou Stop"&VBCRLF& _
"             -? aide",vbInformation,"Usage"
WScript.Quit (1)
End Sub

 Ajouter un commentaire




Nos sponsors


Sondage...

CalendriCode

Février 2012
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
272829    

Consulter la suite du CalendriCode

Photothèque

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,499 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales