Active Directory Offline Defragmentation
Directory Servisi (DS) Active Directory (AD) veritabanı (Ntds.dit) için online defragmentation işlemini garbage-collection işleminin bir parçası olarak her 12 saatte bir yapar. Garbage-collection işlemi sırasında öncelikle tombstone süresi dolmuş objeler veritabanından tamamıyla kaldırılır, gereksiz log dosyaları temizlenir ve son olarak da online defragmentation (birleştirme) işlemi yapılır. Fakat bu online defragmentation sırasında veritabanını küçültemez. Yeni nesnelerin ve attribute’ların eklenmesiyle de Active Directory veritabanı (Ntds.dit) zamanla çok büyük boyutlara ulaşabilir. Bu boyutu küçültmenin yolu ise offline defragmentation yapmaktır.
Makalemin devamını okumak için aşağıdaki linke tıklayınız.
http://mshowto.org/index.php?option=com_content&task=view&id=156&Itemid=33
Karşılaştığım küçük problemleri not almak için açtım bu siteyi. Amacım problemleri hatırlamak ve başkaları ile paylaşmak. Makale türündeki yazılarımı www.mshowto.org adresine yazıyorum. I publish here technical problems and articles that have already been published at www.mshowto.org. I'm currently working as a system engineer at Havelsan.
Saturday, August 26, 2006
Monday, August 21, 2006
Mshowto.org adresinde yayımlanan makalelerim
Repadmin ile Active Directory Replikasyonlarınızı Gözlemleyin
http://mshowto.org/index.php?option=com_content&task=view&id=154&Itemid=33
Klasör ve Dosya İzinlerinin Otomatik Düzenlenmesi (ACL)
http://mshowto.org/index.php?option=com_content&task=view&id=144&Itemid=33
Policy ile İstenmeyen Programların Çalışmasını Engelleyin
http://mshowto.org/index.php?option=com_content&task=view&id=136&Itemid=33
Repadmin ile Active Directory Replikasyonlarınızı Gözlemleyin
http://mshowto.org/index.php?option=com_content&task=view&id=154&Itemid=33
Klasör ve Dosya İzinlerinin Otomatik Düzenlenmesi (ACL)
http://mshowto.org/index.php?option=com_content&task=view&id=144&Itemid=33
Policy ile İstenmeyen Programların Çalışmasını Engelleyin
http://mshowto.org/index.php?option=com_content&task=view&id=136&Itemid=33
Thursday, July 27, 2006
Agimizdaki sunucu veya istemcilerin ne zaman acildigini (reboot) ettigini ogrenmek icin asagidaki scripti olusturdum. Patch dagitimi sonrasinda veya tum sunucular icin belirli araliklar ile ne zaman reboot ettiklerini ogrenmek istiyorsaniz isinize yarabilir.
Tum sunucu isimlerini "sunucu" dizisine ekleyip, diziyi sunucu sayisi kadar genisletin. Daha sonra bu sayiyi kadar for dongusu kullanın. Sonuclar d:\boot_zamanlari.txt dosyasına yazilacaktir.
'///////////////////////////////////////////////
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oWshNet = CreateObject("WScript.Network")
Const OpenAsASCII = 0
Const OverwriteIfExist = -1
sOutFile = "d:\boot_zamanlari.txt"
On Error Resume Next
dim sunucu(10)
sunucu(1) = "DCMSHOWTO1"
sunucu(2) = "DCMSHOWTO2"
sunucu(3) = "DCMSHOWTO3"
sunucu(4) = "DCMSHOWTO4
sunucu(5) = "FSMSHOWTO1"
sunucu(6) = "FSMSHOWTO2"
sunucu(7) = "EXCMSHOWTO1"
sunucu(8) = "EXCMSHOWTO2"
sunucu(9) = "SQLMSHOWTO1"
sunucu(10) = "ISAMSHOWTO1"
i=1
for i=1 TO 10 step 1
strComputer = sunucu(i)
' Connect to specified computer
Set objWMIService = GetObject( "winmgmts://" & strComputer & "/root/cimv2" )
' Display error number and description if applicable
If Err Then ShowError
Set colItems = objWMIService.ExecQuery( "Select * from Win32_OperatingSystem", , 48 )
For Each objItem in colItems
strTimeShift = Right( objItem.LastBootUpTime, 4 ) / 60
strBootYear = Left( objItem.LastBootUpTime, 4 )
strBootMonth = Mid( objItem.LastBootUpTime, 5, 2 )
strBootDay = Mid( objItem.LastBootUpTime, 7, 2 )
strBootDate = DateValue( strBootDay & "-" & strBootMonth & "-" & strBootYear )
strBootHour = Mid( objItem.LastBootUpTime, 9, 2 ) - strTimeShift
strBootMins = Mid( objItem.LastBootUpTime, 11, 2 )
If strBootHour < 0 Then
strBootHour = strBootHour + 24
strBootDate = DateAdd( "d", -1, DateValue( strBootDate ) )
End If
If strBootHour > 23 Then
strBootHour = strBootHour - 24
strBootDate = DateAdd( "d", 1, DateValue( strBootDate ) )
End If
strBootTime = strBootHour & ":" & strBootMins
strBoot = strBootDate & ", " & strBootTime
strMsg = "Last boot time of " & strComputer & ": " & strBoot
Next
' Display results
'WScript.Echo strMsg
Set fOutFile = oFSO.CreateTextFile _
(sOutFile, OverwriteIfExist, OpenAsASCII)
fOutFile.WriteLine strMsg
Next
fOutFile.Close
'Done
WScript.Quit(0)
'///////////////////////////////////////////////////////////////////
Tum sunucu isimlerini "sunucu" dizisine ekleyip, diziyi sunucu sayisi kadar genisletin. Daha sonra bu sayiyi kadar for dongusu kullanın. Sonuclar d:\boot_zamanlari.txt dosyasına yazilacaktir.
'///////////////////////////////////////////////
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oWshNet = CreateObject("WScript.Network")
Const OpenAsASCII = 0
Const OverwriteIfExist = -1
sOutFile = "d:\boot_zamanlari.txt"
On Error Resume Next
dim sunucu(10)
sunucu(1) = "DCMSHOWTO1"
sunucu(2) = "DCMSHOWTO2"
sunucu(3) = "DCMSHOWTO3"
sunucu(4) = "DCMSHOWTO4
sunucu(5) = "FSMSHOWTO1"
sunucu(6) = "FSMSHOWTO2"
sunucu(7) = "EXCMSHOWTO1"
sunucu(8) = "EXCMSHOWTO2"
sunucu(9) = "SQLMSHOWTO1"
sunucu(10) = "ISAMSHOWTO1"
i=1
for i=1 TO 10 step 1
strComputer = sunucu(i)
' Connect to specified computer
Set objWMIService = GetObject( "winmgmts://" & strComputer & "/root/cimv2" )
' Display error number and description if applicable
If Err Then ShowError
Set colItems = objWMIService.ExecQuery( "Select * from Win32_OperatingSystem", , 48 )
For Each objItem in colItems
strTimeShift = Right( objItem.LastBootUpTime, 4 ) / 60
strBootYear = Left( objItem.LastBootUpTime, 4 )
strBootMonth = Mid( objItem.LastBootUpTime, 5, 2 )
strBootDay = Mid( objItem.LastBootUpTime, 7, 2 )
strBootDate = DateValue( strBootDay & "-" & strBootMonth & "-" & strBootYear )
strBootHour = Mid( objItem.LastBootUpTime, 9, 2 ) - strTimeShift
strBootMins = Mid( objItem.LastBootUpTime, 11, 2 )
If strBootHour < 0 Then
strBootHour = strBootHour + 24
strBootDate = DateAdd( "d", -1, DateValue( strBootDate ) )
End If
If strBootHour > 23 Then
strBootHour = strBootHour - 24
strBootDate = DateAdd( "d", 1, DateValue( strBootDate ) )
End If
strBootTime = strBootHour & ":" & strBootMins
strBoot = strBootDate & ", " & strBootTime
strMsg = "Last boot time of " & strComputer & ": " & strBoot
Next
' Display results
'WScript.Echo strMsg
Set fOutFile = oFSO.CreateTextFile _
(sOutFile, OverwriteIfExist, OpenAsASCII)
fOutFile.WriteLine strMsg
Next
fOutFile.Close
'Done
WScript.Quit(0)
'///////////////////////////////////////////////////////////////////
Wednesday, July 12, 2006
Kullanıcı home folder yetkilerinin düzenlenmesi
AD'de kullanıcılar için set edilmiş home folder yetkileri, kullanıcıların home folder üzerinde full kontrol hakkı olmasından dolayı, alt klasörlerde kullanıcı tarafından değiştirilebiliyor. Administrators ve System kullanıcılarının nesne üzerinde yetkisinin kaldırılması bazı yönetimsel sorunları doğuruyor.
Aşağıdaki script, homefolders klasöründeki her klasör için Administrators ve System kullancılarına Full kontrol hakkı verip, kullanıcının Full Control hakkını modify olarak değiştirmektedir.
Script'in çalışması için home folder'ın \\sunucu\share1\%username% olarak set edildigini varsayıyorum. Yani alt klasör isimleri ile domain kullanıcı adı aynı.
Linkten script'in zip halini indirebilirsiniz. Buraya koydugumda sayfa bozuldu. Link veriyorum. http://estetikplastikcerrahi.com/herkesekonut/yetkiduzenle.zip
Script için Subinacl'ye ihtiyacınız olacaktır. Resource kit içinde bulabilirsiniz.
AD'de kullanıcılar için set edilmiş home folder yetkileri, kullanıcıların home folder üzerinde full kontrol hakkı olmasından dolayı, alt klasörlerde kullanıcı tarafından değiştirilebiliyor. Administrators ve System kullanıcılarının nesne üzerinde yetkisinin kaldırılması bazı yönetimsel sorunları doğuruyor.
Aşağıdaki script, homefolders klasöründeki her klasör için Administrators ve System kullancılarına Full kontrol hakkı verip, kullanıcının Full Control hakkını modify olarak değiştirmektedir.
Script'in çalışması için home folder'ın \\sunucu\share1\%username% olarak set edildigini varsayıyorum. Yani alt klasör isimleri ile domain kullanıcı adı aynı.
Linkten script'in zip halini indirebilirsiniz. Buraya koydugumda sayfa bozuldu. Link veriyorum. http://estetikplastikcerrahi.com/herkesekonut/yetkiduzenle.zip
Script için Subinacl'ye ihtiyacınız olacaktır. Resource kit içinde bulabilirsiniz.
Tuesday, June 06, 2006
How to force AD replication,
For AD partition;
repadmin /replicate dcfrom dcto dc=domainname,dc=com
example for domaindnszones partition;
repadmin /replicate dcfrom dcto dc=domaindnszones,dc=domainname,dc=com
You can also force replication for enterprise level with;
repadmin /syncall dcfrom /e /P
-e:enterprise level
-P:Push changes
For single object replication use "replsingleobj" parametre.
To force sysvol replication use ntfrs util;
ntfrsutil forcerepl dcto /r "DOMAIN SYSTEM VOLUME (SYSVOL SHARE)" /p dcfrom
*forcerepl parametre is not supported by old ntfrsutil versions..
For AD partition;
repadmin /replicate dcfrom dcto dc=domainname,dc=com
example for domaindnszones partition;
repadmin /replicate dcfrom dcto dc=domaindnszones,dc=domainname,dc=com
You can also force replication for enterprise level with;
repadmin /syncall dcfrom /e /P
-e:enterprise level
-P:Push changes
For single object replication use "replsingleobj" parametre.
To force sysvol replication use ntfrs util;
ntfrsutil forcerepl dcto /r "DOMAIN SYSTEM VOLUME (SYSVOL SHARE)" /p dcfrom
*forcerepl parametre is not supported by old ntfrsutil versions..
Tuesday, May 23, 2006
Unable to open awservices.exe
Sometimes, you may give full permission for users (server operators etc.) to a service to manage server. The User may have problem with this service's executable file when user need to run this file at command prompt.
This problem occured when server operators run awservices.exe at command prompt to interpret functioning of Unicenter TND agent Tecnology.
To resolve this case, you must give full control permission on service dacl (discretionary access control lists). To do this beforo read dacl of service with;
"Sc sdshow awservices" command. The command genaretes results that like;
(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;AU)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;PU)(A;;CCDCLCSWLOCRRC;;;LS)
Copy this results and add server operators group or the group which you want to add with neccesary permission.
To set new dacl to service, use following comand;
sc sdset awservices D:
SC
Communicates with the Service Controller and installed services. SC.exe retrieves and sets control information about services. You can use SC.exe for testing and debugging service programs. Service properties stored in the registry can be set to control how service applications are started at boot time and run as background processes. More information about SC click here
Sometimes, you may give full permission for users (server operators etc.) to a service to manage server. The User may have problem with this service's executable file when user need to run this file at command prompt.
This problem occured when server operators run awservices.exe at command prompt to interpret functioning of Unicenter TND agent Tecnology.
To resolve this case, you must give full control permission on service dacl (discretionary access control lists). To do this beforo read dacl of service with;
"Sc sdshow awservices" command. The command genaretes results that like;
(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;AU)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;PU)(A;;CCDCLCSWLOCRRC;;;LS)
Copy this results and add server operators group or the group which you want to add with neccesary permission.
To set new dacl to service, use following comand;
sc sdset awservices D:
SC
Communicates with the Service Controller and installed services. SC.exe retrieves and sets control information about services. You can use SC.exe for testing and debugging service programs. Service properties stored in the registry can be set to control how service applications are started at boot time and run as background processes. More information about SC click here
A problem that can't reach to machine on network.
PROBLEM: Couldn't reach to machine on network either rdp or ping even safe mode with networking. But the machine was up and no errors at eventviewer. Not resolved by resetting tcp/ip and winsock stack. No problem with nic or server services..
To determine the problem was very hard. I restarted machine without to run some services like IPSEC. Nema problema.. :) The problem was gone..
When I opened IPSEC Monitor with MMC, got error that 0x80070002. The problem occured after starting IPSEC .
CAUSE: corrupted polstore.dll
RESULOTION: regsvr32 polstore.dll
Rebuild a new local policy store. To do this, Click Start, click Run, type regsvr32 polstore.dll in the Open box, and then click OK
Related MS article http://support.microsoft.com/?kbid=912023
To reset TCP/IP http://support.microsoft.com/kb/299357
To reset and repair winsock http://support.microsoft.com/kb/811259
PROBLEM: Couldn't reach to machine on network either rdp or ping even safe mode with networking. But the machine was up and no errors at eventviewer. Not resolved by resetting tcp/ip and winsock stack. No problem with nic or server services..
To determine the problem was very hard. I restarted machine without to run some services like IPSEC. Nema problema.. :) The problem was gone..
When I opened IPSEC Monitor with MMC, got error that 0x80070002. The problem occured after starting IPSEC .
CAUSE: corrupted polstore.dll
RESULOTION: regsvr32 polstore.dll
Rebuild a new local policy store. To do this, Click Start, click Run, type regsvr32 polstore.dll in the Open box, and then click OK
Related MS article http://support.microsoft.com/?kbid=912023
To reset TCP/IP http://support.microsoft.com/kb/299357
To reset and repair winsock http://support.microsoft.com/kb/811259
Monday, May 08, 2006
SYSVOL share permission sets default "everyone:read" and "authenticated users:full" when you promote server to domain controller. Windows Server 2003 domain controller unnecessarily provides too many permissions to the SYSVOL share for the Authenticated Users group. This situation is described in KB812538.
The ACLs (NTFS permissions) of items in the SYSVOL share do not allow Full Control access to members of the Authenticated Users group. However, if these permissions are inadvertently changed, members of the Authenticated Users group might have Full Control permissions in the default installation of Windows Server 2003.
I am managing 46 dc at different sites. I used RMTShare.exe to decrease share permissions. The command is;
RMTShare.exe \\DC1\SYSVOL /GRANT "Authenticated Users":R /REMOVE Everyone
You can use this command with bacth file or wbscritp.
Microsoft has placed the RMTShare.exe program on their FTP site at ftp://ftp.microsoft.com/bussys/winnt/winnt-public/reskit/nt40/i386/RMTSHAR.EXE.
The ACLs (NTFS permissions) of items in the SYSVOL share do not allow Full Control access to members of the Authenticated Users group. However, if these permissions are inadvertently changed, members of the Authenticated Users group might have Full Control permissions in the default installation of Windows Server 2003.
I am managing 46 dc at different sites. I used RMTShare.exe to decrease share permissions. The command is;
RMTShare.exe \\DC1\SYSVOL /GRANT "Authenticated Users":R /REMOVE Everyone
You can use this command with bacth file or wbscritp.
Microsoft has placed the RMTShare.exe program on their FTP site at ftp://ftp.microsoft.com/bussys/winnt/winnt-public/reskit/nt40/i386/RMTSHAR.EXE.
Saturday, January 28, 2006
Setting Audit entries via batch file.
Setting Audit entries via batch file.
You can use this batch file to set auditing entry to a folder. This batch adds “delete subfolders and files” and “delete” auditing entries for “authenticated users” to TEST folder’s SACL. Send this batch to servers with psexec @file parametre to run.
------------
net use Z: \\Domain.com\sysvol\Domain.com\SCRIPTSZ:\SetACL.exe -on "F:\TEST" -ot file -actn ace -ace "n:s-1-5-11;p:delete;m:aud_succ;w:sacl;s:y" -ace "n:s-1-5-11;p:del_child;m:aud_succ;w:sacl;s:y"
net use Z: /delete
-------------
* SetACL is assumed in the \\Domain.com\sysvol\Domain.com\SCRIPTS* SetACL.exe is free for everyone. The current version of SetACL and more examples can be found on sourceforce.net
Setting Audit entries via batch file.
You can use this batch file to set auditing entry to a folder. This batch adds “delete subfolders and files” and “delete” auditing entries for “authenticated users” to TEST folder’s SACL. Send this batch to servers with psexec @file parametre to run.
------------
net use Z: \\Domain.com\sysvol\Domain.com\SCRIPTSZ:\SetACL.exe -on "F:\TEST" -ot file -actn ace -ace "n:s-1-5-11;p:delete;m:aud_succ;w:sacl;s:y" -ace "n:s-1-5-11;p:del_child;m:aud_succ;w:sacl;s:y"
net use Z: /delete
-------------
* SetACL is assumed in the \\Domain.com\sysvol\Domain.com\SCRIPTS* SetACL.exe is free for everyone. The current version of SetACL and more examples can be found on sourceforce.net
Monday, December 12, 2005
IBM x235 Server'larda Memory Leak problemi.
Server Raid Manager 7.10 kurulu IBM serverlerde snmp servisi gittikce artan bir memory kullanimina neden oluyor. Nonepaged pool ve paged pool'un tamamını kullandıktan sonra da bilgisayar çakılıp kaliyor.
Soruna snmp.exe'nin server raid manager ile gelen aus-snmp.dll'i kullanmasi neden oluyor. Sorunlu aus-snmp.dll (versiyon yok, boyut 198 kb olarak gozukuyor.) server raid manager update ile degisiyor. Sonrasinda sorun olusmuyor. Server Raid manager 8.20'ye update ettik.
PROBLEM: SNMP.EXE CAUSES MEMORY LEAK PROBLEM on IBM servers.
SYMPTOMS: The server hangs in 2 hours after restarts.
Event ID: 2019Source: SrvDescription: The server was unable to allocate from the system nonpaged pool because the pool was empty
Cause: aus-snmp.dll
Resulotion: updgrade Server Raid Manager.
Server Raid Manager 7.10 kurulu IBM serverlerde snmp servisi gittikce artan bir memory kullanimina neden oluyor. Nonepaged pool ve paged pool'un tamamını kullandıktan sonra da bilgisayar çakılıp kaliyor.
Soruna snmp.exe'nin server raid manager ile gelen aus-snmp.dll'i kullanmasi neden oluyor. Sorunlu aus-snmp.dll (versiyon yok, boyut 198 kb olarak gozukuyor.) server raid manager update ile degisiyor. Sonrasinda sorun olusmuyor. Server Raid manager 8.20'ye update ettik.
PROBLEM: SNMP.EXE CAUSES MEMORY LEAK PROBLEM on IBM servers.
SYMPTOMS: The server hangs in 2 hours after restarts.
Event ID: 2019Source: SrvDescription: The server was unable to allocate from the system nonpaged pool because the pool was empty
Cause: aus-snmp.dll
Resulotion: updgrade Server Raid Manager.
Thursday, November 10, 2005
Administrator Group üyelerinine ait dosyaların owner'ının Administrators olma problemi.
Dosya sunucusunda olmaması gereken bir dosyanın sahibinin Administrators (local) olmasıyla patlak verdi olay. Local Administrators grubu üyelerinden biri server 2003 üzerinde bir dosya yarattıklarında owner Administrators gozukuyor. Boyle olunca da bir auditing yok ise dosyayı yaratanı bulamıyoruz.
Policy değişikliği ile sorunu çözdük.
Default Domain Policy /Computer conf. / Windows Settings / local policies
Security Settings \ Local Policies \ Security Options. The policy name is “System objects: Default owner for objects created by members of the Administrators group”
Geçmiş olsun..
Dosya sunucusunda olmaması gereken bir dosyanın sahibinin Administrators (local) olmasıyla patlak verdi olay. Local Administrators grubu üyelerinden biri server 2003 üzerinde bir dosya yarattıklarında owner Administrators gozukuyor. Boyle olunca da bir auditing yok ise dosyayı yaratanı bulamıyoruz.
Policy değişikliği ile sorunu çözdük.
Default Domain Policy /Computer conf. / Windows Settings / local policies
Security Settings \ Local Policies \ Security Options. The policy name is “System objects: Default owner for objects created by members of the Administrators group”
Geçmiş olsun..
Tuesday, October 25, 2005
Farkli bir site'daki print serverda tanımlı printerların AD'de listelenmeme problemi.
Print server farkli bir site da ise, sitenizdaki dc o print server uzerindeki printerlari oksuz kabul edip silebilir. Konu ile ilgili makale aşağıda.
Group policy'de "Directory Pruning Interval" ve "Directory Pruning Retry periods" daha buyuk degerler girmek ve, "Directory Pruning Interval" degerini "Never" yapmak yeterlidir. Tabi bunu dc'lerin etkilenecegi policy'de yapmak gerekiyor.
Printer Pruner May Prune All the Print Queue Objects on Its Site
http://support.microsoft.com/?kbid=246906
Print server farkli bir site da ise, sitenizdaki dc o print server uzerindeki printerlari oksuz kabul edip silebilir. Konu ile ilgili makale aşağıda.
Group policy'de "Directory Pruning Interval" ve "Directory Pruning Retry periods" daha buyuk degerler girmek ve, "Directory Pruning Interval" degerini "Never" yapmak yeterlidir. Tabi bunu dc'lerin etkilenecegi policy'de yapmak gerekiyor.
Printer Pruner May Prune All the Print Queue Objects on Its Site
http://support.microsoft.com/?kbid=246906
Monday, October 24, 2005
Subscribe to:
Posts (Atom)

