Thursday 17 March 2011

New Category for Microsoft Application Virtualization 4.6

A new product category will be added to your WSUS server under the Microsoft Application Virtualization family, entitled Microsoft Application Virtualization 4.6. The Microsoft Application Virtualization 4.6 category will allow all classifications of updates to be offered to the Microsoft Application Virtualization 4.6 product. You will see this new category when new updates are available for this product.

You should sync the Microsoft Application Virtualization family if you have these products in your managed environment. For additional information about Microsoft Application Virtualization see: http://www.microsoft.com/systemcenter/appv/default.mspx.

Source : WSUS Team

Tuesday 15 March 2011

WSUS'a yeni kategori eklendi : MS Application Virtualization 4.6

WSUS'a Microsoft Application Virtualization ailesinden  Microsoft Application Virtualization 4.6. urunu icin yeni bir kategori eklendigi duyurusu yapildi.

Saturday 5 March 2011

Create list of all WDS devices with a vbscript

I was trying to write a script/web based console to manage WDS (Windows Deployment Server) Approved, Pending and Rejected devices more user friendly. And I'd like to share first part of it, actually it is just preparation phase, but I thought it may give ideas.
The script exports all devices to text files by using wdsutil then parse the text files to create more usable semi column seperated files. PS: It is my draft version.

Screen_05 21-Jan-09 16.19

Example
When we run wdsutil /get-AutoAddDevices /DeviceType:RejectedDevices command and export the result to a text file it produces the format below.

Screen_06 21-Jan-09 16.20

The script parses and re-writes the text file and make it more usable like below.
Screen_07 21-Jan-09 16.20

Script : ListWDSAll Devices.vbs
Author : Osman Shener
'ListWDSAllDevices.vbs Written by : Osman Shener
'Feel free to use! (Kill the hero, but don't eat his right :) (Don't try to undertand it is a funny translation of a Turkish proverb))

Const ForReading = 1
Const ForWriting = 2
Const TristateUseDefault=-2

Dim objFSO, arrStr, wshell, objRegEx

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set wshell = CreateObject("WScript.Shell")
Set objRegEx = CreateObject("VBScript.RegExp")
objRegEx.Pattern = ":"

wshell.run "%COMSPEC% /C wdsutil /get-AutoAddDevices /DeviceType:PendingDevices > C:PendingDevices.txt", 0, TRUE
wshell.run "%COMSPEC% /C wdsutil /get-AutoAddDevices /DeviceType:RejectedDevices > C:RejectedDevices.txt", 0, TRUE
wshell.run "%COMSPEC% /C wdsutil /get-AutoAddDevices /DeviceType:ApprovedDevices > C:ApprovedDevices.txt", 0, TRUE
set wshell = nothing

'Create Pending Devices Semicolon seperated list!
Set objFile = objFSO.OpenTextFile("C:PendingDevices.txt", ForReading, True, TristateUseDefault)

Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
Set colMatches = objRegEx.Execute(strLine)
If colMatches.Count > 0 Then
For Each strMatch in colMatches
strPenText = strPenText + strLine + ";"
If Left(strLine, 11) = "Join domain" Then
strPenText = strPenText & vbCrLf
End If

' Wscript.Echo strPenText
Next
End If
Loop
objFile.Close

Set objFile = objFSO.OpenTextFile ("C:PendingDevicesList.txt", ForWriting, True, TristateUseDefault)
objFile.Write(strPenText)
objFile.Close

'Create Approved Devices Semicolon seperated list!
Set objFile = objFSO.OpenTextFile("C:ApprovedDevices.txt", ForReading, True, TristateUseDefault)

Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
Set colMatches = objRegEx.Execute(strLine)
If colMatches.Count > 0 Then
For Each strMatch in colMatches
strAppText = strAppText + strLine + ";"
If Left(strLine, 13) = "Approval time" Then
strAppText = strAppText & vbCrLf
End If

' Wscript.Echo strAppText
Next
End If
Loop
objFile.Close

Set objFile = objFSO.OpenTextFile ("C:ApprovedDevicesList.txt", ForWriting, True, TristateUseDefault)
objFile.Write(strAppText)
objFile.Close

'Create Rejected Devices Semicolon seperated list!
Set objFile = objFSO.OpenTextFile("C:RejectedDevices.txt", ForReading, True, TristateUseDefault)

Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
Set colMatches = objRegEx.Execute(strLine)
If colMatches.Count > 0 Then
For Each strMatch in colMatches
strRejText = strRejText + strLine + ";"
If Left(strLine, 14) = "Rejection time" Then
strRejText = strRejText & vbCrLf
End If
Next
End If
Loop
objFile.Close

Set objFile = objFSO.OpenTextFile ("C:RejectedDevicesList.txt", ForWriting, True, TristateUseDefault)
objFile.Write(strRejText)
objFile.Close

Friday 4 March 2011

Script ile Event Log'u boyutuna gore yedeklemek ve temizlemek

Asagidaki ornek script araciligi ile Event Log'unuzu sizin belirleyeceginiz boyutu gecmesi durumunda yedeklemek ve temizlemek icin kullanabilirsiniz, ornekteki boyut kriteri 20MB icin verilmistir. Script Security log disindaki loglar icin calisacak sekilde yazilmistir, ayrinti icin bu linki incelemenizi tavsiye ederim.


strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate, (Backup, Security)}!\\" _
& strComputer & "\root\cimv2")
Set colLogFiles = objWMIService.ExecQuery _
("SELECT * FROM Win32_NTEventLogFile")
For Each objLogfile in colLogFiles
If objLogFile.FileSize > 20000000 Then
strBackupLog = objLogFile.BackupEventLog _
("c:\scripts\" & objLogFile.LogFileName & ".evt")
objLogFile.ClearEventLog()
End If
Next

Thursday 3 March 2011

WDS de tüm aygıtları listelemek.

WDS (Windows Deployment Server)de Approved, Pending ve Rejected device lari yonetim icin bir script hazirlamaya basladim, ilk asamada bu devicelari listelemek icin yazmis oldugum script i konuyla ilgilenen arkadaslara esin kaynagi olmasi icin paylasmak istedim. Script basitce wdsutil komutunu kullanarak devicelari text dosyasina aldiktan sonra, dosyalari parse edip daha kullanilabilir bir hale getirmek icin noktali virgul ile ayrilmis sekilde duzenliyor.
Screen_05 21-Jan-09 16.19

Ornegin,
wdsutil /get-AutoAddDevices /DeviceType:RejectedDevices sonucunu export ettigimizde asagidaki sekilde kullanimi daha zor olan bir formattaki ciktiyi

Screen_06 21-Jan-09 16.20

Bu sekle donusturerek kolaylik sagliyor.
Screen_07 21-Jan-09 16.20
 'ListWDSAllDevices.vbs Written by : Osman Shener
'Feel free to use! (Kill the hero, but don't eat his right :) (Don't try to undertand it is a funny translation of a Turkish proverb))

Const ForReading = 1
Const ForWriting = 2
Const TristateUseDefault=-2

Dim objFSO, arrStr, wshell, objRegEx

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set wshell = CreateObject("WScript.Shell")
Set objRegEx = CreateObject("VBScript.RegExp")
objRegEx.Pattern = ":"

wshell.run "%COMSPEC% /C wdsutil /get-AutoAddDevices /DeviceType:PendingDevices > C:PendingDevices.txt", 0, TRUE
wshell.run "%COMSPEC% /C wdsutil /get-AutoAddDevices /DeviceType:RejectedDevices > C:RejectedDevices.txt", 0, TRUE
wshell.run "%COMSPEC% /C wdsutil /get-AutoAddDevices /DeviceType:ApprovedDevices > C:ApprovedDevices.txt", 0, TRUE
set wshell = nothing

'Create Pending Devices Semicolon seperated list!
Set objFile = objFSO.OpenTextFile("C:PendingDevices.txt", ForReading, True, TristateUseDefault)

Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
Set colMatches = objRegEx.Execute(strLine)
If colMatches.Count > 0 Then
For Each strMatch in colMatches
strPenText = strPenText + strLine + ";"
If Left(strLine, 11) = "Join domain" Then
strPenText = strPenText & vbCrLf
End If

' Wscript.Echo strPenText
Next
End If
Loop
objFile.Close

Set objFile = objFSO.OpenTextFile ("C:PendingDevicesList.txt", ForWriting, True, TristateUseDefault)
objFile.Write(strPenText)
objFile.Close

'Create Approved Devices Semicolon seperated list!
Set objFile = objFSO.OpenTextFile("C:ApprovedDevices.txt", ForReading, True, TristateUseDefault)

Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
Set colMatches = objRegEx.Execute(strLine)
If colMatches.Count > 0 Then
For Each strMatch in colMatches
strAppText = strAppText + strLine + ";"
If Left(strLine, 13) = "Approval time" Then
strAppText = strAppText & vbCrLf
End If

' Wscript.Echo strAppText
Next
End If
Loop
objFile.Close

Set objFile = objFSO.OpenTextFile ("C:ApprovedDevicesList.txt", ForWriting, True, TristateUseDefault)
objFile.Write(strAppText)
objFile.Close

'Create Rejected Devices Semicolon seperated list!
Set objFile = objFSO.OpenTextFile("C:RejectedDevices.txt", ForReading, True, TristateUseDefault)

Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
Set colMatches = objRegEx.Execute(strLine)
If colMatches.Count > 0 Then
For Each strMatch in colMatches
strRejText = strRejText + strLine + ";"
If Left(strLine, 14) = "Rejection time" Then
strRejText = strRejText & vbCrLf
End If
Next
End If
Loop
objFile.Close

Set objFile = objFSO.OpenTextFile ("C:RejectedDevicesList.txt", ForWriting, True, TristateUseDefault)
objFile.Write(strRejText)
objFile.Close

Wednesday 2 March 2011

Bir den fazla dosyayi Unblock etmek

Bir den fazla dosyayi kolayca unblock etmek icin yani ZoneIdentifier larini silmek icin Sysinternal's in streams aracini kullanabilirsiniz.

http://technet.microsoft.com/en-gb/sysinternals/bb897440

Kullanimi
streams.exe -s *.* streamleri listelemek icin (recursive)
streams.exe -s -d *.* streamleri silmek icin (recursive)