use Win32::AdminMisc; use Win32::NetAdmin; srand(time); $Domain = "SOUTH_PARK"; $Server = "\\\\ServerName"; Win32::NetAdmin::GetServers($Server, $Domain, SV_TYPE_ALL, \@List); foreach $Machine (@List) { $Time = sprintf("3:%02d am", int(rand(60))); if (Win32::AdminMisc::ScheduleAdd($Machine, $Time, 0, SUNDAY, JOB_RUN_PERIODICALLY | JOB_NONINTERACTIVE, "net time \\\\server /s /y") { print "Job added to $Machine for $Time every Sunday.\n"; } else { print "Job not added to $Machine.\n"; } }