strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "!\\" & strComputer & "\root\cimv2")
Set colAdapters = objWMIService.ExecQuery("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled = True")
Set objShell = CreateObject("Wscript.Shell")
For Each objAdapter In colAdapters
If Not IsNull(objAdapter.IPAddress) Then
For i = LBound(objAdapter.IPAddress) To UBound(objAdapter.IPAddress)
address = objAdapter.IPAddress(i)
VLAN30 = instr(address, "10.14.3.")
VLAN40 = instr(address, "10.14.4.")
VLAN80 = instr(address, "10.14.8.")
VLANHighSecurity = instr(address, "10.14.15.")
If VLAN40 = 1 Then
objShell.Run "\\DCServer\NetLogon\Z001.bat", 0, TRUE
End If
If VLAN30 = 1 Then
objShell.Run "\\DCServer\NetLogon\Z002.bat", 0, TRUE
End If
If VLAN50 = 1 Then
objShell.Run "\\DCServer\NetLogon\Z003.bat", 0, TRUE
End If
If VLANHighSecurity = 1 Then
S = split(address, ".")
H = S(3)
If H > 0 AND H < 32 Then
objShell.Run "\\DCServer\NetLogon\Z004.bat", 0, TRUE
End If
If H > 32 AND H < 64 Then
objShell.Run "\\DCServer\NetLogon\Z005.bat", 0, TRUE
End If
If H > 64 AND H < 96 Then
objShell.Run "\\DCServer\NetLogon\Z006.bat", 0, TRUE
End If
If H > 96 AND H < 128 Then
objShell.Run "\\DCServer\NetLogon\Z007.bat", 0, TRUE
End If
End If
Next
End If
Next
Bookmark this post:
|
0 评论:
发表评论