Forum

Active directoryde ...
 
Bildirimler
Hepsini Temizle

Active directoryde otomatik program çalıştırmak?

2 Yazılar
2 Üyeler
0 Likes
1,129 Görüntüleme
(@hayrettin_duzgun)
Gönderiler: 23
Eminent Member
Konu başlatıcı
 

Active directory de istediğimiz zamanda (sadece logonda değil) butun clientlarda eşzamanlı bir program çalıştırmak istiyoruz ornegin internet explorer da bir web sayfası goruntulenmesi yardımcı olabilecek arkadas varmı? Active directory yapısında  boyle bir istek yapılabilirmi..?

 

 
Gönderildi : 01/04/2009 13:59

(@cozumpark)
Gönderiler: 16309
Illustrious Member Yönetici
 

merhabalar


SCHTASKS.exe yi bir logon script olarak ayarlayın ardından uygulayın. bu işlem sadece clientlarda SCHTASKS.exe'yi çalıştırır.


SCHTASKS.exe istemci tarafında çalışır ancak zamanlanmış görevin zamanı gelmediği için görev başlamaz. siz uygulamanın çalışacağı zamanı tanımlıyorsunuz script içinde ve ozaman gelince çalışıyor.


yada SCHTASKS.exe'yi her clientta servis olarak ekleyeceksiniz. bu durumda client her açıldığında SCHTASKS.exe bir servis olarak çalışacak ve zamanlanmış görevlerin gelmesini bekleyecek. SCHTASKS.exe'yi servis olarak eklemek için de SRVINSTW uygulamasını microsoftun sitesinde aratın ve indirin. ardından da bütün clientlarda çalıştırıp SCHTASKS.exe'yi servis olarak ekleyebilirsiniz. tabi bu işlemi GPO üzerinden de yapabilirsiniz.


 ' Run this vbscript as a Start-up script for computers.
' Or, you can also run this script periodically from
' a server by choosing the target computers
' for the "strComputer" variable

' DaysOfWeek
'(used only when RunRepeatedly )
Const  Monday    = 1
Const  Tuesday   = 2
Const  Wednesday = 4
Const  Thursday  = 8
Const  Friday    = 16
Const  Saturday  = 32
Const  Sunday    = 64

' DaysOfMonth
'(used only when RunRepeatedly )
Const  Day_1  = 1
Const  Day_2  = 2
Const  Day_3  = 4
Const  Day_4  = 8
Const  Day_5  = 16
Const  Day_6  = 32
Const  Day_7  = 64
Const  Day_8  = 128
Const  Day_9  = 256
Const  Day_10 = 512
Const  Day_11 = 1024
Const  Day_12 = 2048
Const  Day_13 = 4096
Const  Day_14 = 8192
Const  Day_15 = 16364
Const  Day_16 = 32768
Const  Day_17 = 65536
Const  Day_18 = 131072
Const  Day_19 = 262144
Const  Day_20 = 524288
Const  Day_21 = 1048576
Const  Day_22 = 2097152
Const  Day_23 = 4194304
Const  Day_24 = 8388608
Const  Day_25 = 16777216
Const  Day_26 = 33554432
Const  Day_27 = 67108864
Const  Day_28 = 134217728
Const  Day_29 = 268435456
Const  Day_30 = 536870912
Const  Day_31 = 1073741824


'-------------example-------------
'Schedules Notepad on the target computer ( "." = local)
'to run at 12:30 PM every Monday, Wednesday, and Friday.

strComputer         = "."
strCommand          = "Notepad.exe"          '(include parameters)
startTime           = "12:30"                '(hh:mm = 24h-notation!)
InteractWithDesktop = False
'RunRepeatedly;
DaysOfWeek         = Monday OR Wednesday OR Friday
DaysOfMonth        = Empty                  '(Use 'OR' to select more days)


Set objWMIService = GetObject("winmgmts:" _
     & "{impersonationLevel=impersonate}!" _
     & "\\" & strComputer & "\root\cimv2")

'First..
'Delete all previous scripted "AT_jobs"
Set colScheduledJobs = objWMIService.ExecQuery _
    ("Select * from Win32_ScheduledJob")'.AT_Jobs
For Each objJob in colScheduledJobs
   err = objJob.Delete
Next

'Create a new AT_Job (AT1)
Set objNewJob = objWMIService.Get("Win32_ScheduledJob")
If Not CBool(Len(DaysOfWeek & DaysOfMonth)) Then _
RunRepeatedly = False Else RunRepeatedly = True
sBIAS = GetBIAS()
errJobCreated = objNewJob.Create _
   (strCommand, _
   "********" & Replace(startTime,":", "") &"00.000000" & sBIAS, _
   RunRepeatedly, DaysOfWeek, DaysOfMonth, InteractWithDesktop, _
   JobID)


'-------------------------------------------------------------
Function GetBIAS() 'from the initiating computer !!!
  'Set objSWbemServices
  With GetObject("winmgmts:" _
       & "{impersonationLevel=impersonate}!" _
       & "\root\cimv2")
    Set colComputer = .ExecQuery _
       ("SELECT CurrentTimeZone FROM Win32_ComputerSystem")
  End With
  For Each objComputer in colComputer
    GetBIAS = objComputer.CurrentTimeZone
    Exit For
  Next
  If Int(instr(Cstr(GetBIAS),"-"))=1 Then a="-" Else a="+"
  GetBIAS = a & Right(1000 + Abs(GetBIAS),3)
End Function



diğer bir yöntem ise aşağıdaki gibidir;

 

JT.exe /saj NAMEFORSCHEDULE /sc DOMAIN\Username PASSWORD" /sj ApplicationName="C:\Temp\reboot.vbs" Parameters="" MaxRunTime=2700000 SystemRequired=1 /ctj Startdate=01/07/2005 Starttime=03:00 minutesduration=960 minutesinterval=60 KillAtDuration=1 Type=Daily Disabled=0

 

JT.exe'yi microsoftun sitesinden indirebilirsiniz. aratırsanız karşınıza çıkar.

 

kolay gelsin


 

 
Gönderildi : 02/04/2009 19:10

Paylaş: