Thursday 28 July 2011

Update Status Report Terminology for WSUS 3.0 SP2

WSUS provides update status reports for computers and computer groups in the WSUS network. You can filter the default views by update status and in some cases by combinations of status (Failed or Needed, Installed/Not Applicable, No Status, and so on). The following table defines the status conditions that can be reported for an update.

Update Status Definitions


Installed : The update is installed on the computer.

Needed : When it refers to the status of one computer, Needed means that the update is compatible with (and should be installed on) the computer. When it refers to the status for a computer group, the Needed column displays the number of computers in the group to which the update is applicable. A positive Needed result means that the update is applicable, but it was not installed the last time that client computers contacted the WSUS server. Any of the following can be true when the status for an update is Needed:
  •  You have approved the update for installation but the client computers have not contacted the WSUS server since you approved it.
  • The update has already been downloaded and installed, but the client computer has not contacted the WSUS server since the update was installed.
  • The update has already been downloaded and installed, but the client computer must be restarted before changes go into effect. The client computer has not been restarted.
  • The update has been downloaded to the computer but has not been installed.
  • The update has not been downloaded or installed on the computer.

Installed/Not Applicable : When it refers to the status of one computer, Installed/Not Applicable means that the update is not applicable to or required by that computer. When it refers to the status for a computer group, the Installed/Not Applicable column displays the number of computers in the group for which the update is not applicable or not required.

No status :  No status usually means that the computer has not contacted the WSUS server since the update was synchronized.

Failed : An error occurred when a detection or an installation was attempted on the computer.

Last contacted : The date that the computer last contacted the WSUS server.

Source: http://technet.microsoft.com/en-us/library/dd939917(WS.10).aspx

Saturday 23 July 2011

WSUS 3.0 SP2 Unattended Kurulum

WSUS u unattended modda kurmak icin komut satiri parametrelerini kullanabilirsiniz. Bu sekilde yaptiginiz kurulumlarda WSUS kurulumu kullanici arayuzunde grafiksel calismayacaktir. Eger kurulumda sorun yasar iseniz kurulum log dosyalarini asagidaki lokasyonda bulabilirsiniz.

Kurulum dosyasini buradan indirebilirsiniz.

WSUSKurulumSurucusu:\Program Files\Microsoft Windows Server Update Services\LogFiles\

Komut satiri parametreleri ile kurulum yapmak icin komut satiri penceresini kullanmaya dikkat ediniz.

Genel kullanimi su sekildedir.

WSUS30-KB972455-x86.exe /komut-satiri parametresi property=value


64 bit icin

WSUS30-KB972455-x64.exe /parameter property=value


komut satiri ve property kisimlarinda neleri kullanabilieceginizi asagidaki tablolardan belirleyebilirsiniz.

WSUS kurulum uygulamasina bir parametre aktarmak istiyorsaniz, property adinin arkasina esittir isareti koymaniz ve degerini belirmeniz gerekir. Ornegin sessiz bir kurulum gerceklestirmek ve content klasoru olarak E:\WSUSContents klasorunu kullanmak istiyorsaniz asagidaki gibi bir komut calistirmaniz gerekecektir.
WSUS30-KB972455-x86.exe /q CONTENT_DIR=E:\WSUSContents

Yardima ihtiyac duydugunuzda WSUSSetup.exe /help veya /? komutlarinida calistirabilirsiniz.


64 bit WSUS u bir veritabani altinda yeni arkli bir instance'a kurmak istiyorsaniz

WSUS30-KB972455-x64.exe SQLINSTANCE_NAME=dbservername\instancename


WSUS komut satiri parametreleri ve aciklamalari

• /q : sessiz kurulum yapar
• /u : urunu kaldirir, eger WSUS kurarken SQL yerine Windows yerlesik veritabani kullandiysaniz onu da kaldirir.
• /p : urunu kurmaz ancak sisteminiz urunu kurmaya hazirmi onu kontrol eder ve eksikler var ise rapor eder.
• /?, /h : komut satiri parametreleri ve aciklamalarini verir.
• /g : WSUS onceki versiyounundan yukseltim icin kullanilir, bu parametre ile beraber kullanilabilecek tek parametre sessiz kurulum parametresidir (/q) bu parametre kurulumu sadece Default Website altina yapar.

WSUS kurulumu icin property ler ve aciklamalari.


• CONTENT_LOCAL : 0=icerik indirilecek, 1=Microsoft Update sitesinde tutulacak
• CONTENT_DIR : icerik klasorunun hedefi (guncelleme, servis paketi, yama vs bu klasorde tutulur.)
• WYUKON_DATA_DIR : Eger Windows Internal Database kullanacaksaniz bu veritabaninin tutulacagi klasoru belirler.
• SQLINSTANCE_NAME : Kullanacaksaniz harici SQL veritabanini belirler. SunucuAdi\SQLInstanceName seklinde deger verilmelidir. Eger lokalde ise sadece bilgisayar adi vermeniz yeterlidir. Varsayilan degeri %COMPUTERNAME%\WSUS dir.
• DEFAULT_WEBSITE : 0=port 8530, 1=port 80 (IIS te hangi portun kullanilacagini belirler)
• PREREQ_CHECK_LOG : Log dosyasi icin kaynak ve ad belirler.
• CONSOLE_INSTALL : 0=WSUS sunucusunu kurar, 1=sadece yonetim konsolunu kurar
• ENABLE_INVENTORY : 0=inventory ozelliklerini kurmaz, 1=kurar
• DELETE_DATABASE : 0=mevcut veritabanini tutar, 1=siler
• DELETE_CONTENT : 0=mevcut icerigi tutar, 1=siler
• DELETE_LOGS : 0=mevcut loglari tutar, 1=siler (/u parametresi ile kullanilir)
• CREATE_DATABASE : 0=mevcut veritabanini kullanir , 1=yeni veritabani yaratir.
• MU_ROLLUP :1=Microsoft Guncelleme gelistirme programina katilimi onaylar, 0=onaylamaz.
PROGRESS_WINDOW_HANDLE : Islem mesajlarini gostermek icin window handle
• FRONTEND_SETUP : 1=icerik lokasyonunu veritabanina yazmaz, 0=icerik lokasyonunu veritabanina yazar (Yuk dengelemesi icin gerekir.)

Friday 22 July 2011

MDT Paylaşım Lokasyonunu Otomatik Belirleme

MDT ile imaj olusturmaya baslayali uzun zaman oldu, simdi farkli lokasyonlardan da tek imaj , tek veritabani, tek paylasim kullanabilmek icin uzerinde calismaktayim, her lokasyonun kendi lokalinden kaynaklara ulasabilmesi icin SQL Replikasyonu, DFS-R gibi teknolojilerden faydalanmaktayim. Ancak dun DFS performansindan veya olasi DFS problemlerine karsin bu is baska nasil yapilir diye dokumanlari okurken BootStrap.ini de Gateway tanimlamalari ile lokasyon tanimlanabildigini buldum, bu ozellik cok hos , istemci gatewayinden nerede oldugunu ayirt edebilip ayarlari buna gore ozellestirebiliyorsunuz. Ankara'da isen Ankara paylasimina eris, su kullanici ile diyebiliyorsunuz.

Veya DeployRoot u tamamen bos birakabiliyorsunuz bu durumda sistem sizin yarattiginiz LocationServer.xml dosyasini okuyor ve kullaniciniza sizin tanimlamis oldugunu lokasyonlari listeliyor, bu yontemle ayni lokasyonda bir den fazla paylasiminiz var ise bunlara agirlik vererek yuku de dagitabiliyorsunuz.

Ben hem bootstrap.ini de gateway ve lokasyon degiskenlerini kullandim hem de eger lokasyonlardan birine eslesmedigi durumda LocationServer.xml i kullanmasi icin konfigure ettim.

BootStrap.ini de yapmaniz gereken

[Settings] altinda Priority i degistirmeniz olacak, boylelikle islem once Gateway eslesmelerine oncelik verecek ornegin :

[Settings]
Priority=DefaultGateway,Default

Daha sonra gatewayleri ve lokasyonlari tanimlayacaksiniz, ornegin

[Default Gateway]
192.168.1.1=Istanbul
192.168.3.1=Ankara

Daha sonra lokasyona ait ozellikleri asagidaki sekilde tanimlayabilirsiniz.

[Istanbul]
DeployRoot=\IstanbulSunucunuzDeploymentShare$ (MDT2010 oncesinde Distribution$)

[Ankara]
DeployRoot=\AnkaraSunucunuzDeploymentShare$ (MDT2010 oncesinde Distribution$)

Ikinci oncelik ise varsayilan yani Default, bu eslesme olmamasinda kullanicak ana yontem

[Default]

Buraya eslesme olmazsa kullansin diye bir sunucu tanimlabilirsiniz veya bos birakip sistemin LocationServer.xml okumasini isteyebilirsiniz.

Yukaridaki bolge degiskenlerine elbette normalde kullanabildiginiz UserID, UserDomain, SkipBDDWelcome vs gibi degerleri kullanabilirsiniz.

LocationServer.xml i yaratmak icin MDT dokumanini incelemeniz gerekiyor cunku kurulum klasorlerinde bulamayacaksiniz. Ben burada bir ornegi sizinle paylasacagim

2009-10-01 15.00-01
Ornegin yukaridaki gibi bir XML i yaratip Disk:DeploymentShareExtra FilesDeployControl altina kopyalayip imaji tekrar olusturursaniz boot sirasinda eger herhangi bir deployroot tanimi bulunamaz ise sistem size xml de tanimlamis oldugunuz sunuculari listeleyecektir. Extra Files klasorunu MDT de Share ozelliklerine Extra Files kismindan tanimlamalisiniz ki dosyayi imaj icina alsin, bunu atlamayiniz.

Ayni XML de bolgeye has ozellikleri de tanimlayabilirsiniz , ornegin alan kodu icin

2009-10-01 15.03-02

Fakat da bootstrap.ini de oldugu gibi paylasima erisecek kullanici tanimlanamamakta, bunun olmamasi benim planlarimi aksatmisti cunku yarattigim imajlar kurulumcuya sadece makine adi sormaya ayarli, geri kalan tum bilgileri klavye, alan kodu, domain, ou, uygulamalar vb seyleri zaten otomatize etmistim. Bunun uzerine MDT scriptleri nasil calisir diye arastirmaya basladim ve benim isimi gorecek bir cozum buldum, ayni seye ihtiyaci olacaklar icin umarim faydali olur.

ScriptsDeployWiz_Validation.vbs dosyasinda asagidaki kismi bulun
ValidateDeployRoot = FALSE

Do
On Error Resume Next
Err.Clear
If oFSO.FileExists(DeployRoot.value & "ControlOperatingSystems.xml" ) then

ve su sekilde eklemeyi yapin, normalde asagidaki ek daha alt satirlarda zaten degiskenleri okumak icin var ancak bu kod kullanici haklari size sorulduktan sonra calistigi icin, kullanici bilgileri icin kullanilamamakta, biz kullanici haklari kismindan once okuyacagiz parametrelerimizi,

ValidateDeployRoot = FALSE
For each oItem in oXMLSiteData.selectNodes("//servers/server")
If SiteList.value = oUtility.SelectSingleNodeString(oItem,"serverid") then
For each oVariable in oItem.selectNodes("otherparameters/parameter")
Set oName = oVariable.Attributes.getQualifiedItem("name","")
If not oName is Nothing then
oProperties(oName.Value) = oVariable.Text
End if
Next

End if
Next
Do
On Error Resume Next
Err.Clear
If oFSO.FileExists(DeployRoot.value & "ControlOperatingSystems.xml" ) then

Daha sonra asagidaki bolumu

oEnvironment.Item("UserID") = ""
oEnvironment.Item("UserDomain") = ""
oEnvironment.Item("UserPassword") = ""

su sekilde degistirin ki , XML den okudugumuz bilgileri eslestirelim,

oEnvironment.Item("UserID") = oProperties("UserID")
oEnvironment.Item("UserDomain") = oProperties("UserDomain")
oEnvironment.Item("UserPassword") = oProperties("UserPassword")

Asagidakileri de yukarida verilen ornekteki gibi parametrelere ekleyiniz.

2009-10-01 15.13-03

Imajinizi olusturup , boot ettiginiz de eger GW eslesmesi olmazsa veya bootstrap.ini de DeployRoot tanimli degilse sistem size bolge-sunucu listesini gosterecektir, ve siz secim yapip Next'e bastiginizda kullanici bilgileri ekrani doldurulmus gelecektir.

Iyi gunler.

Not:XML leri imaj seklinde koydum cunku blogger xml leri algilayip sadece atanmis degerleri gosteriyordu.

(MDT Paylaşım Lokasyonunu Otomatik Belirleme)

Sunday 17 July 2011

Script ile Windows Registry de bir kayidin varligini dogrulamak

Asagidaki script ile Windows Registry sinde bir kayidin varligini kontrol edebilirsiniz, bir uygulama paketlerken ihtiyacim olmustu belki sizlerinde ihtiyaci olur.

Set WshNetwork = WScript.CreateObject("WScript.Network")

strComputer = WshNetwork.ComputerName
Const HKEY_CURRENT_USER = &H80000001
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
strKeyPath = "Software\Ornek\"
strValueName = "OrnekObje"
oReg.GetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue
Wscript.Echo "Ornek deger: " & strValue

Ornegin degerin istediginiz degere esit olup olmadigini asagidaki gibi cok basit bir ekleme ile kontrol edebilirsiniz.

if strValue = 1 then
Wscript.echo "Aktif"
else
wscript.echo "Pasif"
end if

Friday 15 July 2011

Permissions on WSUS Directories and Registry Keys

Permissions on WSUS Directories and Registry Keys

Troubleshooting Web services often involves checking permissions on related directories and registry keys. The following sections will explain in detail how to check permissions on WSUS Web services directories and registry keys.

The cacls system command


The cacls system command displays or modifies file or directory access control lists (ACLs). The output of this command specifies the level of access (f=full control, w=write, r=read, n=none) and whether or not the access is inherited by subdirectories (OI=this folder and files, CI=this folder and subfolders, IO=does not apply). See the cacls command reference (http://go.microsoft.com/fwlink/?LinkId=81084) for more information.
The WSUS installation creates several Web service directories.

  • WSUSInstallDir\WebServices\apiremoting30 (where WSUSInstallDir is the directory where WSUS has been installed)

  • WSUSInstallDir\WebServices\clientwebservice

  • WSUSInstallDir\WebServices\dssauthwebservice

  • WSUSInstallDir\WebServices\reportingwebservice

  • WSUSInstallDir\WebServices\serversyncwebservice

  • WSUSInstallDir\WebServices\simpleauthwebservice

  • WSUSInstallDir\Inventory

  • WSUSInstallDir\Selfupdate


All of the directories above (except for the self-update directory) should have the following ACLs:

  • NT AUTHORITY\NETWORK SERVICE:(OI)(CI)R

  • BUILTIN\Users:(OI)(CI)R

  • NT AUTHORITY\Authenticated Users:(OI)(CI)R

  • BUILTIN\Administrators:(OI)(CI)F

  • NT AUTHORITY\SYSTEM:(OI)(CI)F

  • The self-update directory should have the following ACLs:

  • BUILTIN\Users:(OI)(CI)R

  • BUILTIN\Administrators:(OI)(CI)F

  • NT AUTHORITY\SYSTEM:(OI)(CI)F


Permissions on WSUS registry keys


The following permissions are set for the registry during WSUS setup.



  • The Users and WSUS Reporters group must have Read access to the \HKLM\Software\Microsoft\Update Services\Server registry key.

  • The following accounts must have Full Control permissions to the \HKLM\Software\Microsoft\Update Services\Server\Setup registry key:

    • Network Service

    • WSUS Administrators

    • Administrators

    • System





Source : http://technet.microsoft.com/en-us/library/cc708487(WS.10).aspx


Wednesday 13 July 2011

Yuklu Windows Installer versiyonunu bulmak

Bilgisayarinizda yuklu Windows Installer versiyonunu bulmak icin normalde Windows\System32 klasoru altindaki MSI.DLL dosyasinin ozelliklerine girmek yeterlidir. Ayni zamanda MSIEXEC komutunu calistirarak ta versiyonu gorebilirsiniz, ancak bazi versiyonlarda MSIEXEC guncellenmediginden bazen farkli versiyonlara rastlamaniz mumkundur, bu sebebple MSI.DLL i kontrol etmek size daha kesin sonuc verecektir.

Bu kontrolu script ile yapmak isterseniz asagidaki kucuk vbs kodunu kullanabilirsiniz, kodu bir text dosyasina yapistirip takisini .vbs yapmaniz yeterli olacaktir.

set WI = createobject("windowsinstaller.installer")
msgbox WI.version

Friday 1 July 2011

VBScript : OpenTextFile Weird/Bad Characters

I have just experienced a problem while trying to read a text file by vbscript. When I echo lines to screen I saw an empty line shows ÿþ, and other weird/bad characters.
Screen_04 21-Jan-09 14.47

Than I realized the problem is about the file's encoding. The text file I was trying to read is created by printing characters to a file. (dir c:test.txt).

So don't forget to define encoding type while opening a file, check the three parameters below that you will use as a paramater for OpenTextFile

Open Using System Default > TristateUseDefault =-2
Open File As Unicode icin > TristateTrue=-1
Open File As ASCII icin > TristateFalse=0

Example:

Const ForReading = 1
Const TristateUseDefault=-2
Dim objFSO
Set objFile = objFSO.OpenTextFile("C:WDSPendingDevices.txt", ForReading, True, TristateUseDefault)

( VBScript : OpenTextFile Weird/Bad Characters )

VBScript : Dosya okuma bozuk karakterler

Az once bir VB script yazarken, okuyup isleyip tekrar olusturdugum bir text dosyasinin ciktisinin hatali olmasi uzerine, okunan satirlari ekrana verince asil kaynakla alakasi olmayan bozuk karakterler ile karsilastim. Ornegin : ÿþ
Screen_04 21-Jan-09 14.47

Bunun uzerine sorunun acmaya calistigim dosyayi ASCII modunda acamaya calistigimdan kaynaklandigini buldum. Dosyayi dir >test.txt gibi bir sekilde olusturmustum. Bu tip bir sorunla karsi karsiya iseniz okuyacaginiz dosyayi acar iken hangi kodlama ile acacaginiza dikkat etmeniz gerekiyor.

Bunun icin asagida gozuken acilis sekilleri icin gerekli degerleri dosyanizi acar iken kullanmaniz gerekmekte.

Open Using System Default icin > TristateUseDefault =-2
Open File As Unicode icin > TristateTrue=-1
Open File As ASCII icin > TristateFalse=0

Ornegin:

Const ForReading = 1
Const TristateUseDefault=-2
Dim objFSO
Set objFile = objFSO.OpenTextFile("C:WDSPendingDevices.txt", ForReading, True, TristateUseDefault)

( VBScript : Dosya okuma bozuk karakterler )