Bonjour,
Je voudrais savoir si qqun a un script qui fait l'inventaire détaill é de
toutes les taches planifiées (compte,planification,command,path du job, date
de création,derniere/prochaine execution...) sur tous les serveurs 2000 2003
et 2008.
Serait il possible qu'il recherche dans l'AD tous les serveurs avec ces 3
OS et recense tour à tour les taches planifiées de chacun?
J'ai 200 serveurs à sonder et j'ai pas envie de passer sur chacun pour le
faire car il m'ont donné bcp de boulot à faire et y a peut être une
possibilité de recrutement à la fin du stage (j'aimerai réussi ce g ros
chantier de restructuration d'active directory/exchange car c'est super
intéressant) .
Merci beaucoup à vous tous .
Lyes
Bonjour,
Je voudrais savoir si qqun a un script qui fait l'inventaire détaill é de
toutes les taches planifiées (compte,planification,command,path du job, date
de création,derniere/prochaine execution...) sur tous les serveurs 2000 2003
et 2008.
Serait il possible qu'il recherche dans l'AD tous les serveurs avec ces 3
OS et recense tour à tour les taches planifiées de chacun?
J'ai 200 serveurs à sonder et j'ai pas envie de passer sur chacun pour le
faire car il m'ont donné bcp de boulot à faire et y a peut être une
possibilité de recrutement à la fin du stage (j'aimerai réussi ce g ros
chantier de restructuration d'active directory/exchange car c'est super
intéressant) .
Merci beaucoup à vous tous .
Lyes
Bonjour,
Je voudrais savoir si qqun a un script qui fait l'inventaire détaill é de
toutes les taches planifiées (compte,planification,command,path du job, date
de création,derniere/prochaine execution...) sur tous les serveurs 2000 2003
et 2008.
Serait il possible qu'il recherche dans l'AD tous les serveurs avec ces 3
OS et recense tour à tour les taches planifiées de chacun?
J'ai 200 serveurs à sonder et j'ai pas envie de passer sur chacun pour le
faire car il m'ont donné bcp de boulot à faire et y a peut être une
possibilité de recrutement à la fin du stage (j'aimerai réussi ce g ros
chantier de restructuration d'active directory/exchange car c'est super
intéressant) .
Merci beaucoup à vous tous .
Lyes
On 21 fév, 01:33, Lyes wrote:
> Bonjour,
>
> Je voudrais savoir si qqun a un script qui fait l'inventaire détaillé de
> toutes les taches planifiées (compte,planification,command,path du job,date
> de création,derniere/prochaine execution...) sur tous les serveurs 2000 2003
> et 2008.
> Serait il possible qu'il recherche dans l'AD tous les serveurs avec ces 3
> OS et recense tour à tour les taches planifiées de chacun?
> J'ai 200 serveurs à sonder et j'ai pas envie de passer sur chacun pour le
> faire car il m'ont donné bcp de boulot à faire et y a peut être une
> possibilité de recrutement à la fin du stage (j'aimerai réussi ce gros
> chantier de restructuration d'active directory/exchange car c'est super
> intéressant) .
>
> Merci beaucoup à vous tous .
>
> Lyes
Bonjour,
voici un vbscript qui fait cela, mais je ne l'ai jamais testé sur
Windows 2008:
strComputer = "."
Set oDomain = GetObject("WinNT://MONDOMAINWINDOWS")
Set objShell = CreateObject ("wscript.shell")
on error resume next
Dim objGroup
strGroupSID = "S-1-5-32-544" ' Well Known SID of the group
oDomain.Filter = Array("computer")
For Each oComputer In oDomain
If IsConnectible(oComputer.Name, 1, 50) Then
'-----------------------
err.number = 0
Set objWMIService = GetObject("winmgmts:" & oComputer.Name & "root
cimv2")
Set colItems = objWMIService.ExecQuery _
("Select * from Win32_Group WHERE SID = '" & strGroupSID & "'")
if err.number = 0 then
For Each objItem in colItems
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!" & oComputer.Name & "root
cimv2")
Set colScheduledJobs = objWMIService.ExecQuery _
("Select * from Win32_ScheduledJob")
For Each objJob in colScheduledJobs
Wscript.Echo "On: " & oComputer.Name
''''Wscript.Echo "Caption: " & objJob.Caption
Wscript.Echo "Command: " & objJob.Command
'''Wscript.Echo "Days of Month: " & objJob.DaysOfMonth
'''Wscript.Echo "Days of Week: " & objJob.DaysOfWeek
Wscript.Echo "Description: " & objJob.Description
'''Wscript.Echo "Elapsed Time: " & objJob.ElapsedTime
''''Wscript.Echo "Install Date: " & objJob.InstallDate
''''Wscript.Echo "Interact with Desktop: " &
objJob.InteractWithDesktop
''''Wscript.Echo "Job ID: " & objJob.JobID
Wscript.Echo "Job Status: " & objJob.JobStatus
Wscript.Echo "Name: " & objJob.Name
''''Wscript.Echo "Notify: " & objJob.Notify
Wscript.Echo "Owner: " & objJob.Owner
''''Wscript.Echo "Priority: " & objJob.Priority
'''Wscript.Echo "Run Repeatedly: " & objJob.RunRepeatedly
'''Wscript.Echo "Start Time: " & objJob.StartTime
Wscript.Echo "Status: " & objJob.Status
'''Wscript.Echo "Time Submitted: " & objJob.TimeSubmitted
'''''Wscript.Echo "Until Time: " & objJob.UntilTime
Next
Next
Else
wscript.echo oComputer.name & ": probleme de securite: acces refuse"
End if
Else
wscript.echo oComputer.name & ": pas present sur le réseau"
End if
Next
Function IsConnectible(sHost, iPings, iTO)
If iPings = "" Then iPings = 2
If iTO = "" Then iTO = 750
Const OpenAsASCII = 0
Const FailIfNotExist = 0
Const ForReading = 1
Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
sTemp = oShell.ExpandEnvironmentStrings("%TEMP%")
sTempFile = sTemp & "runresult.tmp"
oShell.run "%comspec% /c ping.exe -n " & iPings & " -w " & iTO & " "
& sHost & ">" & sTempFile, 0 , True
Set fFile = oFSO.OpenTextFile(sTempFile, ForReading, FailIfNotExist,
OpenAsASCII)
sResults = fFile.ReadAll
fFile.Close
oFSO.DeleteFile(sTempFile)
Select Case InStr(sResults,"TTL=")
Case 0 IsConnectible = False
Case Else IsConnectible = True
End Select
End Function
Cordialement,
Mathieu CHATEAU
http://www.lotp.fr
On 21 fév, 01:33, Lyes <L...@discussions.microsoft.com> wrote:
> Bonjour,
>
> Je voudrais savoir si qqun a un script qui fait l'inventaire détaillé de
> toutes les taches planifiées (compte,planification,command,path du job,date
> de création,derniere/prochaine execution...) sur tous les serveurs 2000 2003
> et 2008.
> Serait il possible qu'il recherche dans l'AD tous les serveurs avec ces 3
> OS et recense tour à tour les taches planifiées de chacun?
> J'ai 200 serveurs à sonder et j'ai pas envie de passer sur chacun pour le
> faire car il m'ont donné bcp de boulot à faire et y a peut être une
> possibilité de recrutement à la fin du stage (j'aimerai réussi ce gros
> chantier de restructuration d'active directory/exchange car c'est super
> intéressant) .
>
> Merci beaucoup à vous tous .
>
> Lyes
Bonjour,
voici un vbscript qui fait cela, mais je ne l'ai jamais testé sur
Windows 2008:
strComputer = "."
Set oDomain = GetObject("WinNT://MONDOMAINWINDOWS")
Set objShell = CreateObject ("wscript.shell")
on error resume next
Dim objGroup
strGroupSID = "S-1-5-32-544" ' Well Known SID of the group
oDomain.Filter = Array("computer")
For Each oComputer In oDomain
If IsConnectible(oComputer.Name, 1, 50) Then
'-----------------------
err.number = 0
Set objWMIService = GetObject("winmgmts:\" & oComputer.Name & "root
cimv2")
Set colItems = objWMIService.ExecQuery _
("Select * from Win32_Group WHERE SID = '" & strGroupSID & "'")
if err.number = 0 then
For Each objItem in colItems
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\" & oComputer.Name & "root
cimv2")
Set colScheduledJobs = objWMIService.ExecQuery _
("Select * from Win32_ScheduledJob")
For Each objJob in colScheduledJobs
Wscript.Echo "On: " & oComputer.Name
''''Wscript.Echo "Caption: " & objJob.Caption
Wscript.Echo "Command: " & objJob.Command
'''Wscript.Echo "Days of Month: " & objJob.DaysOfMonth
'''Wscript.Echo "Days of Week: " & objJob.DaysOfWeek
Wscript.Echo "Description: " & objJob.Description
'''Wscript.Echo "Elapsed Time: " & objJob.ElapsedTime
''''Wscript.Echo "Install Date: " & objJob.InstallDate
''''Wscript.Echo "Interact with Desktop: " &
objJob.InteractWithDesktop
''''Wscript.Echo "Job ID: " & objJob.JobID
Wscript.Echo "Job Status: " & objJob.JobStatus
Wscript.Echo "Name: " & objJob.Name
''''Wscript.Echo "Notify: " & objJob.Notify
Wscript.Echo "Owner: " & objJob.Owner
''''Wscript.Echo "Priority: " & objJob.Priority
'''Wscript.Echo "Run Repeatedly: " & objJob.RunRepeatedly
'''Wscript.Echo "Start Time: " & objJob.StartTime
Wscript.Echo "Status: " & objJob.Status
'''Wscript.Echo "Time Submitted: " & objJob.TimeSubmitted
'''''Wscript.Echo "Until Time: " & objJob.UntilTime
Next
Next
Else
wscript.echo oComputer.name & ": probleme de securite: acces refuse"
End if
Else
wscript.echo oComputer.name & ": pas present sur le réseau"
End if
Next
Function IsConnectible(sHost, iPings, iTO)
If iPings = "" Then iPings = 2
If iTO = "" Then iTO = 750
Const OpenAsASCII = 0
Const FailIfNotExist = 0
Const ForReading = 1
Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
sTemp = oShell.ExpandEnvironmentStrings("%TEMP%")
sTempFile = sTemp & "runresult.tmp"
oShell.run "%comspec% /c ping.exe -n " & iPings & " -w " & iTO & " "
& sHost & ">" & sTempFile, 0 , True
Set fFile = oFSO.OpenTextFile(sTempFile, ForReading, FailIfNotExist,
OpenAsASCII)
sResults = fFile.ReadAll
fFile.Close
oFSO.DeleteFile(sTempFile)
Select Case InStr(sResults,"TTL=")
Case 0 IsConnectible = False
Case Else IsConnectible = True
End Select
End Function
Cordialement,
Mathieu CHATEAU
http://www.lotp.fr
On 21 fév, 01:33, Lyes wrote:
> Bonjour,
>
> Je voudrais savoir si qqun a un script qui fait l'inventaire détaillé de
> toutes les taches planifiées (compte,planification,command,path du job,date
> de création,derniere/prochaine execution...) sur tous les serveurs 2000 2003
> et 2008.
> Serait il possible qu'il recherche dans l'AD tous les serveurs avec ces 3
> OS et recense tour à tour les taches planifiées de chacun?
> J'ai 200 serveurs à sonder et j'ai pas envie de passer sur chacun pour le
> faire car il m'ont donné bcp de boulot à faire et y a peut être une
> possibilité de recrutement à la fin du stage (j'aimerai réussi ce gros
> chantier de restructuration d'active directory/exchange car c'est super
> intéressant) .
>
> Merci beaucoup à vous tous .
>
> Lyes
Bonjour,
voici un vbscript qui fait cela, mais je ne l'ai jamais testé sur
Windows 2008:
strComputer = "."
Set oDomain = GetObject("WinNT://MONDOMAINWINDOWS")
Set objShell = CreateObject ("wscript.shell")
on error resume next
Dim objGroup
strGroupSID = "S-1-5-32-544" ' Well Known SID of the group
oDomain.Filter = Array("computer")
For Each oComputer In oDomain
If IsConnectible(oComputer.Name, 1, 50) Then
'-----------------------
err.number = 0
Set objWMIService = GetObject("winmgmts:" & oComputer.Name & "root
cimv2")
Set colItems = objWMIService.ExecQuery _
("Select * from Win32_Group WHERE SID = '" & strGroupSID & "'")
if err.number = 0 then
For Each objItem in colItems
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!" & oComputer.Name & "root
cimv2")
Set colScheduledJobs = objWMIService.ExecQuery _
("Select * from Win32_ScheduledJob")
For Each objJob in colScheduledJobs
Wscript.Echo "On: " & oComputer.Name
''''Wscript.Echo "Caption: " & objJob.Caption
Wscript.Echo "Command: " & objJob.Command
'''Wscript.Echo "Days of Month: " & objJob.DaysOfMonth
'''Wscript.Echo "Days of Week: " & objJob.DaysOfWeek
Wscript.Echo "Description: " & objJob.Description
'''Wscript.Echo "Elapsed Time: " & objJob.ElapsedTime
''''Wscript.Echo "Install Date: " & objJob.InstallDate
''''Wscript.Echo "Interact with Desktop: " &
objJob.InteractWithDesktop
''''Wscript.Echo "Job ID: " & objJob.JobID
Wscript.Echo "Job Status: " & objJob.JobStatus
Wscript.Echo "Name: " & objJob.Name
''''Wscript.Echo "Notify: " & objJob.Notify
Wscript.Echo "Owner: " & objJob.Owner
''''Wscript.Echo "Priority: " & objJob.Priority
'''Wscript.Echo "Run Repeatedly: " & objJob.RunRepeatedly
'''Wscript.Echo "Start Time: " & objJob.StartTime
Wscript.Echo "Status: " & objJob.Status
'''Wscript.Echo "Time Submitted: " & objJob.TimeSubmitted
'''''Wscript.Echo "Until Time: " & objJob.UntilTime
Next
Next
Else
wscript.echo oComputer.name & ": probleme de securite: acces refuse"
End if
Else
wscript.echo oComputer.name & ": pas present sur le réseau"
End if
Next
Function IsConnectible(sHost, iPings, iTO)
If iPings = "" Then iPings = 2
If iTO = "" Then iTO = 750
Const OpenAsASCII = 0
Const FailIfNotExist = 0
Const ForReading = 1
Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
sTemp = oShell.ExpandEnvironmentStrings("%TEMP%")
sTempFile = sTemp & "runresult.tmp"
oShell.run "%comspec% /c ping.exe -n " & iPings & " -w " & iTO & " "
& sHost & ">" & sTempFile, 0 , True
Set fFile = oFSO.OpenTextFile(sTempFile, ForReading, FailIfNotExist,
OpenAsASCII)
sResults = fFile.ReadAll
fFile.Close
oFSO.DeleteFile(sTempFile)
Select Case InStr(sResults,"TTL=")
Case 0 IsConnectible = False
Case Else IsConnectible = True
End Select
End Function
Cordialement,
Mathieu CHATEAU
http://www.lotp.fr
On 21 fév, 01:33, Lyes wrote:
> Bonjour,
>
> Je voudrais savoir si qqun a un script qui fait l'inventaire détaillé de
> toutes les taches planifiées (compte,planification,command,path du job,date
> de création,derniere/prochaine execution...) sur tous les serveurs 2000 2003
> et 2008.
> Serait il possible qu'il recherche dans l'AD tous les serveurs avec ces 3
> OS et recense tour à tour les taches planifiées de chacun?
> J'ai 200 serveurs à sonder et j'ai pas envie de passer sur chacun pour le
> faire car il m'ont donné bcp de boulot à faire et y a peut être une
> possibilité de recrutement à la fin du stage (j'aimerai réussi ce gros
> chantier de restructuration d'active directory/exchange car c'est super
> intéressant) .
>
> Merci beaucoup à vous tous .
>
> Lyes
Bonjour,
voici un vbscript qui fait cela, mais je ne l'ai jamais testé sur
Windows 2008:
strComputer = "."
Set oDomain = GetObject("WinNT://MONDOMAINWINDOWS")
Set objShell = CreateObject ("wscript.shell")
on error resume next
Dim objGroup
strGroupSID = "S-1-5-32-544" ' Well Known SID of the group
oDomain.Filter = Array("computer")
For Each oComputer In oDomain
If IsConnectible(oComputer.Name, 1, 50) Then
'-----------------------
err.number = 0
Set objWMIService = GetObject("winmgmts:" & oComputer.Name & "root
cimv2")
Set colItems = objWMIService.ExecQuery _
("Select * from Win32_Group WHERE SID = '" & strGroupSID & "'")
if err.number = 0 then
For Each objItem in colItems
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!" & oComputer.Name & "root
cimv2")
Set colScheduledJobs = objWMIService.ExecQuery _
("Select * from Win32_ScheduledJob")
For Each objJob in colScheduledJobs
Wscript.Echo "On: " & oComputer.Name
''''Wscript.Echo "Caption: " & objJob.Caption
Wscript.Echo "Command: " & objJob.Command
'''Wscript.Echo "Days of Month: " & objJob.DaysOfMonth
'''Wscript.Echo "Days of Week: " & objJob.DaysOfWeek
Wscript.Echo "Description: " & objJob.Description
'''Wscript.Echo "Elapsed Time: " & objJob.ElapsedTime
''''Wscript.Echo "Install Date: " & objJob.InstallDate
''''Wscript.Echo "Interact with Desktop: " &
objJob.InteractWithDesktop
''''Wscript.Echo "Job ID: " & objJob.JobID
Wscript.Echo "Job Status: " & objJob.JobStatus
Wscript.Echo "Name: " & objJob.Name
''''Wscript.Echo "Notify: " & objJob.Notify
Wscript.Echo "Owner: " & objJob.Owner
''''Wscript.Echo "Priority: " & objJob.Priority
'''Wscript.Echo "Run Repeatedly: " & objJob.RunRepeatedly
'''Wscript.Echo "Start Time: " & objJob.StartTime
Wscript.Echo "Status: " & objJob.Status
'''Wscript.Echo "Time Submitted: " & objJob.TimeSubmitted
'''''Wscript.Echo "Until Time: " & objJob.UntilTime
Next
Next
Else
wscript.echo oComputer.name & ": probleme de securite: acces refuse"
End if
Else
wscript.echo oComputer.name & ": pas present sur le réseau"
End if
Next
Function IsConnectible(sHost, iPings, iTO)
If iPings = "" Then iPings = 2
If iTO = "" Then iTO = 750
Const OpenAsASCII = 0
Const FailIfNotExist = 0
Const ForReading = 1
Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
sTemp = oShell.ExpandEnvironmentStrings("%TEMP%")
sTempFile = sTemp & "runresult.tmp"
oShell.run "%comspec% /c ping.exe -n " & iPings & " -w " & iTO & " "
& sHost & ">" & sTempFile, 0 , True
Set fFile = oFSO.OpenTextFile(sTempFile, ForReading, FailIfNotExist,
OpenAsASCII)
sResults = fFile.ReadAll
fFile.Close
oFSO.DeleteFile(sTempFile)
Select Case InStr(sResults,"TTL=")
Case 0 IsConnectible = False
Case Else IsConnectible = True
End Select
End Function
Cordialement,
Mathieu CHATEAU
http://www.lotp.fr
On 21 fév, 01:33, Lyes <L...@discussions.microsoft.com> wrote:
> Bonjour,
>
> Je voudrais savoir si qqun a un script qui fait l'inventaire détaillé de
> toutes les taches planifiées (compte,planification,command,path du job,date
> de création,derniere/prochaine execution...) sur tous les serveurs 2000 2003
> et 2008.
> Serait il possible qu'il recherche dans l'AD tous les serveurs avec ces 3
> OS et recense tour à tour les taches planifiées de chacun?
> J'ai 200 serveurs à sonder et j'ai pas envie de passer sur chacun pour le
> faire car il m'ont donné bcp de boulot à faire et y a peut être une
> possibilité de recrutement à la fin du stage (j'aimerai réussi ce gros
> chantier de restructuration d'active directory/exchange car c'est super
> intéressant) .
>
> Merci beaucoup à vous tous .
>
> Lyes
Bonjour,
voici un vbscript qui fait cela, mais je ne l'ai jamais testé sur
Windows 2008:
strComputer = "."
Set oDomain = GetObject("WinNT://MONDOMAINWINDOWS")
Set objShell = CreateObject ("wscript.shell")
on error resume next
Dim objGroup
strGroupSID = "S-1-5-32-544" ' Well Known SID of the group
oDomain.Filter = Array("computer")
For Each oComputer In oDomain
If IsConnectible(oComputer.Name, 1, 50) Then
'-----------------------
err.number = 0
Set objWMIService = GetObject("winmgmts:\" & oComputer.Name & "root
cimv2")
Set colItems = objWMIService.ExecQuery _
("Select * from Win32_Group WHERE SID = '" & strGroupSID & "'")
if err.number = 0 then
For Each objItem in colItems
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\" & oComputer.Name & "root
cimv2")
Set colScheduledJobs = objWMIService.ExecQuery _
("Select * from Win32_ScheduledJob")
For Each objJob in colScheduledJobs
Wscript.Echo "On: " & oComputer.Name
''''Wscript.Echo "Caption: " & objJob.Caption
Wscript.Echo "Command: " & objJob.Command
'''Wscript.Echo "Days of Month: " & objJob.DaysOfMonth
'''Wscript.Echo "Days of Week: " & objJob.DaysOfWeek
Wscript.Echo "Description: " & objJob.Description
'''Wscript.Echo "Elapsed Time: " & objJob.ElapsedTime
''''Wscript.Echo "Install Date: " & objJob.InstallDate
''''Wscript.Echo "Interact with Desktop: " &
objJob.InteractWithDesktop
''''Wscript.Echo "Job ID: " & objJob.JobID
Wscript.Echo "Job Status: " & objJob.JobStatus
Wscript.Echo "Name: " & objJob.Name
''''Wscript.Echo "Notify: " & objJob.Notify
Wscript.Echo "Owner: " & objJob.Owner
''''Wscript.Echo "Priority: " & objJob.Priority
'''Wscript.Echo "Run Repeatedly: " & objJob.RunRepeatedly
'''Wscript.Echo "Start Time: " & objJob.StartTime
Wscript.Echo "Status: " & objJob.Status
'''Wscript.Echo "Time Submitted: " & objJob.TimeSubmitted
'''''Wscript.Echo "Until Time: " & objJob.UntilTime
Next
Next
Else
wscript.echo oComputer.name & ": probleme de securite: acces refuse"
End if
Else
wscript.echo oComputer.name & ": pas present sur le réseau"
End if
Next
Function IsConnectible(sHost, iPings, iTO)
If iPings = "" Then iPings = 2
If iTO = "" Then iTO = 750
Const OpenAsASCII = 0
Const FailIfNotExist = 0
Const ForReading = 1
Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
sTemp = oShell.ExpandEnvironmentStrings("%TEMP%")
sTempFile = sTemp & "runresult.tmp"
oShell.run "%comspec% /c ping.exe -n " & iPings & " -w " & iTO & " "
& sHost & ">" & sTempFile, 0 , True
Set fFile = oFSO.OpenTextFile(sTempFile, ForReading, FailIfNotExist,
OpenAsASCII)
sResults = fFile.ReadAll
fFile.Close
oFSO.DeleteFile(sTempFile)
Select Case InStr(sResults,"TTL=")
Case 0 IsConnectible = False
Case Else IsConnectible = True
End Select
End Function
Cordialement,
Mathieu CHATEAU
http://www.lotp.fr
On 21 fév, 01:33, Lyes wrote:
> Bonjour,
>
> Je voudrais savoir si qqun a un script qui fait l'inventaire détaillé de
> toutes les taches planifiées (compte,planification,command,path du job,date
> de création,derniere/prochaine execution...) sur tous les serveurs 2000 2003
> et 2008.
> Serait il possible qu'il recherche dans l'AD tous les serveurs avec ces 3
> OS et recense tour à tour les taches planifiées de chacun?
> J'ai 200 serveurs à sonder et j'ai pas envie de passer sur chacun pour le
> faire car il m'ont donné bcp de boulot à faire et y a peut être une
> possibilité de recrutement à la fin du stage (j'aimerai réussi ce gros
> chantier de restructuration d'active directory/exchange car c'est super
> intéressant) .
>
> Merci beaucoup à vous tous .
>
> Lyes
Bonjour,
voici un vbscript qui fait cela, mais je ne l'ai jamais testé sur
Windows 2008:
strComputer = "."
Set oDomain = GetObject("WinNT://MONDOMAINWINDOWS")
Set objShell = CreateObject ("wscript.shell")
on error resume next
Dim objGroup
strGroupSID = "S-1-5-32-544" ' Well Known SID of the group
oDomain.Filter = Array("computer")
For Each oComputer In oDomain
If IsConnectible(oComputer.Name, 1, 50) Then
'-----------------------
err.number = 0
Set objWMIService = GetObject("winmgmts:" & oComputer.Name & "root
cimv2")
Set colItems = objWMIService.ExecQuery _
("Select * from Win32_Group WHERE SID = '" & strGroupSID & "'")
if err.number = 0 then
For Each objItem in colItems
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!" & oComputer.Name & "root
cimv2")
Set colScheduledJobs = objWMIService.ExecQuery _
("Select * from Win32_ScheduledJob")
For Each objJob in colScheduledJobs
Wscript.Echo "On: " & oComputer.Name
''''Wscript.Echo "Caption: " & objJob.Caption
Wscript.Echo "Command: " & objJob.Command
'''Wscript.Echo "Days of Month: " & objJob.DaysOfMonth
'''Wscript.Echo "Days of Week: " & objJob.DaysOfWeek
Wscript.Echo "Description: " & objJob.Description
'''Wscript.Echo "Elapsed Time: " & objJob.ElapsedTime
''''Wscript.Echo "Install Date: " & objJob.InstallDate
''''Wscript.Echo "Interact with Desktop: " &
objJob.InteractWithDesktop
''''Wscript.Echo "Job ID: " & objJob.JobID
Wscript.Echo "Job Status: " & objJob.JobStatus
Wscript.Echo "Name: " & objJob.Name
''''Wscript.Echo "Notify: " & objJob.Notify
Wscript.Echo "Owner: " & objJob.Owner
''''Wscript.Echo "Priority: " & objJob.Priority
'''Wscript.Echo "Run Repeatedly: " & objJob.RunRepeatedly
'''Wscript.Echo "Start Time: " & objJob.StartTime
Wscript.Echo "Status: " & objJob.Status
'''Wscript.Echo "Time Submitted: " & objJob.TimeSubmitted
'''''Wscript.Echo "Until Time: " & objJob.UntilTime
Next
Next
Else
wscript.echo oComputer.name & ": probleme de securite: acces refuse"
End if
Else
wscript.echo oComputer.name & ": pas present sur le réseau"
End if
Next
Function IsConnectible(sHost, iPings, iTO)
If iPings = "" Then iPings = 2
If iTO = "" Then iTO = 750
Const OpenAsASCII = 0
Const FailIfNotExist = 0
Const ForReading = 1
Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
sTemp = oShell.ExpandEnvironmentStrings("%TEMP%")
sTempFile = sTemp & "runresult.tmp"
oShell.run "%comspec% /c ping.exe -n " & iPings & " -w " & iTO & " "
& sHost & ">" & sTempFile, 0 , True
Set fFile = oFSO.OpenTextFile(sTempFile, ForReading, FailIfNotExist,
OpenAsASCII)
sResults = fFile.ReadAll
fFile.Close
oFSO.DeleteFile(sTempFile)
Select Case InStr(sResults,"TTL=")
Case 0 IsConnectible = False
Case Else IsConnectible = True
End Select
End Function
Cordialement,
Mathieu CHATEAU
http://www.lotp.fr