Thursday, 6 August 2009

วิธีการปิด Autoplay ในระดับโดเมนของ Windows Server 2003

ให้เข้าไปที่ Start -> Run -> พิมพ์ Gpedit.msc คลิ๊ก OK
ไปเลือกที่ Computer Configuration จะมีรายการด้านขวา เลือกที่ Administrative Templates
แล้วไปเลือกที่ Turn off Autoplay เลือก Properties แล้วเลือกเป็น Enable เลือก All Drives ถ้าต้องการปิดทั้งหมด
พิมพ์ gpupdate /force เพื่อให้ GPO มีผลทันที

การ deploy ซอฟต์แวร์ผ่าน Group Policy

เอา policy ใส่ตรงComputer Configuration หรือ User Configuration ครับ
ถ้าคุณใส่ใน Computer Configuration นั้นต้อง เอา OU ของคอมมาใส้ใน policy OU นี้ด้วยนะครับ
คือ สร้างOU ชื่อ Install software แล้ว สร้าง policy ไว้ใน OU นี้ ใน Computer configuration จากนั้นก็เอา
Computer มาอยู่ใน OU นี้ด้วยแล้ว run คำสั่ง gpupdate /force ที่ PC จากนั้นลอง restart ดูสัก 2 รอบ
แล้วมันจะได้ผล แต่ว่า software ต้อง support การ deploy ด้วยนะครับ

Wednesday, 5 August 2009

การสั่งให้ Smoothwall 3.0 อัพเดทเวลาตาม Nectec

อันดับแรกสร้างไฟล์ โดยใช้โปรแกรม WinSCP เพื่อเข้าไปที่เซฟเวอร์ โดยสร้างไว้ที่ /etc/cron.daily/timesync
เราจะวางไว้ที่ cron.daily ถ้าต้องการให้เรียกทุกวัน / ถ้าสร้างไว้ที่ cron.hourly จะเป็นการเรียกทุกชั่วโมง
จากนั้นใส่โค้ดนี่เข้าไป
---------------------------------------------------------

#!/usr/bin/perl

# check if red interface is connected
if (-e "/var/smoothwall/red/active")
{
# sync clock
$ntp = `/usr/sbin/ntpdate -u -t 5 clock.nectec.or.th`;

$ntp = substr $ntp, (index $ntp, "offset");
if ($ntp eq '')
{
$ntp = "failed";
}

# update hardware clock
`/sbin/clock --systohc`;

# write to smoothwall log
`logger -t smoothwall "clock sync: $ntp"`;
}

---------------------------------------------------------
จากนั้น เปลี่ยนคุณสมบัติไฟล์เป็น 0755 เป็นอันเสร็จ
ทดสอบการเรียกการตั้งเวลา ใช้คำสั่ง /etc/cron.daily/timesync แล้วรอสักพัก จะแสดงวันที่ๆระบบตั้งใหม่
เราสามารถเข้าไปดูรายงานการตั้งเวลาได้ที่ เมนู Logs เลือกช่องรายการเป็น Smoothwall
ถ้าสำเร็จ จะมีข้อความแบบนี้
17:47:52 smoothwall clock sync: offset 66.663427 sec