Showing posts with label Windows Deployment (WDS). Show all posts
Showing posts with label Windows Deployment (WDS). Show all posts

Tuesday, 16 July 2013

WDS Service Crashes after Boot Image Update and can't start again.

I updated a boot image with new controller and network card drivers and found all WDS services has stopped on PXE points.

One of the events were popular Event ID 258 — Image Server Configuration

The description for Event ID 258 from source WDSIMGSRV cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event:

0xC1030104

Another event was 512 with same error information
An error occurred while trying to initialize provider WdsImgSrv from C:\Windows\system32\WdsImgSrv.dll. Since this provider is not marked as critical, Windows Deployment Services server will continue.

Error Information: 0xC1030104

and 1000
Faulting application name: svchost.exe_WDSServer, version: 6.1.7600.16385, time stamp: 0x4a5bc3c1

Faulting module name: wimgapi.dll, version: 6.1.7600.16385, time stamp: 0x4a5be09a

Exception code: 0xc0000005

Fault offset: 0x0000000000032a8e

Faulting process id: 0x9f0

Faulting application start time: 0x01ce820a679bb189

Faulting application path: C:\Windows\system32\svchost.exe

Faulting module path: C:\Windows\system32\wimgapi.dll

Report Id: aa4171a9-edfd-11e2-bd63-0050569b0082

and some other APPCRASH events about WDS.

So most of the resources recommends checking permissions, re-initialize the WDS or reinstall.

Your case might not be same as me but I recommend you to try something else before step in to recommended time consuming tasks.

Refresh!. Yes try to refresh your image first, Although SCCM says the boot image has updated successfully on PXE points try to refresh once. It worked for me, you can also copy image from refreshed source to test it. So I refreshed my PXE points and voila ! All WDS service problems have disappeared.

Currently I am not sure about the source of the problem but my feelings says it could be the binary difference replication.

Thursday, 19 January 2012

WDS Auto-Add ve AD'de Prestaging verilerini temizlemek

WDS Auto-Add veritabanini temizlemek
WDS Auto-Add veritabanindaki onaylanmis bilgisayarlari her 30 gunde bir temizler. Isterseniz bu sureyi WDSUTIL /Set-Server /AutoAddPolicy /RetentionPeriod /Approved:Days komutu ile degistirebilirsiniz.  (http://technet.microsoft.com/en-us/library/cc754289(WS.10).aspx)

Ornegin 7 gune ayarlamak icin :
WDSUTIL /Set-Server /AutoAddPolicy /RetentionPeriod /Approved:7

Eger isterseniz  wdsutil /delete-AutoAddDevices /DeviceType:ApprovedDevices komutu ule tum onaylanmis bilgisayarlari Auto-Add veritabanindan temizleyebilirsiniz.  (http://technet.microsoft.com/en-us/library/cc770832(WS.10).aspx).

Ancak WDS Auto-Add veritabaninda yapilan temizlik Active Directory'deki bilgisayar hesabinda bulunan RemoteInstall/NetBootGUID degerini temizlemez, degeri elle silebilirsiniz.

AD'deki prestaging verilerini temizlemek
Eger prestaged bilgisayarlara ait RemoteInstall/GUID degerlerini Active Directory'den temizlemek isterseniz asagidaki powershell komutlarindan yararlanabilirsiniz. Kendim bu ihtiyacimi giderirken uzerinden gectigim adimlari oldugu gibi paylasiyorum, kavranmasini kolaylastiracagini umuyorum.

Bir bilgisayarin NetbootGUID degerini gormek icin
Get-ADComputer -Identity ComputerName -Properties NetbootGuid

Bir bilgisayarin NetbootGUID degerini temizlemek icin
Set-ADComputer -Identity ComputerName -clear NetbootGUID

Tum bilgisayarlarin NetboodGUID degerlerini gormek icin
Get-ADComputer -Filter {NetbootGUID -like "*"} -Properties NetbootGUID

Tum bilgisayarlarin NetboodGUID degerlerini ek degerlerle listelemek icin
Get-ADComputer -Filter {NetbootGUID -like "*"} -Properties NetbootGUID,created | Format-List -Property name,distinguishedName,created,NetbootGUID

Yaratilma degeri bir haftadan eski ve NetbootGUID degerine sahip tum bilgisayarlari listelemek icin
Get-ADComputer -Filter {NetbootGUID -like "*"} -Properties NetbootGUID,Created | ? {$_.Created -le ((get-date).addDays(-7))} | Format-List -Property name,distinguishedName,created,NetbootGUID

Yaratilma degeri bir haftadan eski ve NetbootGUID degerine sahip tum bilgisayarlara ait NetbootGUID degerini temizlemek
Get-ADComputer -Filter {NetbootGUID -like "*"} -Properties name,NetbootGUID,Created | ? {$_.Created -le ((get-date).addDays(-7))} | Set-ADComputer -clear NetbootGUID

Yaratilma degeri bir haftadan eski ve NetbootGUID degerine sahip tum bilgisayarlara ait NetbootGUID degerini temizlemek (Daha kisa  : Created degerini almamiz yeterli tarih denklemi icin.)
Get-ADComputer -Filter {NetbootGUID -like "*"} -Properties Created | ? {$_.Created -le ((get-date).addDays(-7))} | Set-ADComputer -clear NetbootGUID

Komutlar hakkinda daha fazla bilgi icin
Set-ADComputer : http://technet.microsoft.com/en-us/library/ee617263.aspx
Get-ADComputer : http://technet.microsoft.com/en-us/library/ee617192.aspx

Purging WDS database and clearing prestaging values from AD computers

Purging Auto-Add Database in WDS WDS purges approved computers from Auto-Add database every 30 days by default.
You can also change the retention period for approved computers record by running WDSUTIL /Set-Server /AutoAddPolicy /RetentionPeriod /Approved:Days command. (http://technet.microsoft.com/en-us/library/cc754289(WS.10).aspx)

To change the length of time approved computers are held in the Auto-Add database to 7 days.
WDSUTIL /Set-Server /AutoAddPolicy /RetentionPeriod /Approved:7

If you wan't to manually purge approved computers in Auto-Add database you can run wdsutil /delete-AutoAddDevices /DeviceType:ApprovedDevices command, or to delete all (approved, pending, rejected) you can visit this URL (http://technet.microsoft.com/en-us/library/cc770832(WS.10).aspx).

But this process doesn't clear computer's RemoteInstall/NetBootGUID property from Active Directory, so you might need to clear this value in AD.
Clear prestaging data in AD
If you also need to clear RemoteInstall GUID property from all prestaged machines in AD as WDSUtil only clears it's own Auto-Add database, you can use powershell commands below to do that.

  • To see a computer's NetbootGUID
    Get-ADComputer -Identity ComputerName -Properties NetbootGuid


  • To clear a computer's NetbootGUID
    Set-ADComputer -Identity ComputerName -clear NetbootGUID


  • To list all computers have NetboodGUID value
    Get-ADComputer -Filter {NetbootGUID -like "*"} -Properties NetbootGUID


  • To list all computers have NetboodGUID value by formatted output
    Get-ADComputer -Filter {NetbootGUID -like "*"} -Properties NetbootGUID,created | Format-List -Property name,distinguishedName,created,NetbootGUID


  • To list all computers older than a week and have NetboodGUID value by formatted output
    Get-ADComputer -Filter {NetbootGUID -like "*"} -Properties NetbootGUID,Created | ? {$_.Created -le ((get-date).addDays(-7))} | Format-List -Property name,distinguishedName,created,NetbootGUID


  • To clear NetbootGUID from all computers older than a week and have NetbootGUID value
    Get-ADComputer -Filter {NetbootGUID -like "*"} -Properties name,NetbootGUID,Created | ? {$_.Created -le ((get-date).addDays(-7))} | Set-ADComputer -clear NetbootGUID


  • To clear NetbootGUID from all computers older than a week and have NetbootGUID value (Shorter : we only need Created property for date equation)
    Get-ADComputer -Filter {NetbootGUID -like "*"} -Properties Created | ? {$_.Created -le ((get-date).addDays(-7))} | Set-ADComputer -clear NetbootGUID



To get more detail about
Set-ADComputer : http://technet.microsoft.com/en-us/library/ee617263.aspx
Get-ADComputer : http://technet.microsoft.com/en-us/library/ee617192.aspx

Tuesday, 9 August 2011

WDS BINLSVC 0x5 525 - Pending Device Approve ederken Access Denied hatasi almak

Merhaba WDS (Windows Deployment Service) kullanarak isletim sistemi kurmaya calistiginiz da istek onaylama asamasina geldiginizde karsilasabileceginiz bir sorunun cozumune deginmek istedim. Aslinda asagidaki bilgiler sorun cozumunden ziyade WDS i yapilandirirken dikkat etmeniz gereken bir ayar olarak da kategorize edilebilir. PXEBoot araciligi ile istemciyi baslattiginizda DHCP den IP almasi, DHCP serverdan PXEBoot sunucusunu ve bootfile adini almasi ardindan WDS ile ile irtibata gectiginde WDS ayarlamis oldugunuz PXE Response settings e gore istemciye yanit verir , kurulabilecek veya calistirilabilecek imajlari listelemeden once, otomatik yanitlamaya ayarladi iseniz bekleme den yani pending devices listesine dusmeden bir sonraki ekrana gecer veya onay gerektirdiyseniz pending device listesine duser ancak her iki sekildede Directory Services tab inda da ayarlayabildiginiz OU altina Computer Object sini yaratmaya calistiginda gerekli ayari yapmadiysaniz Access Denied hatasi alirsiniz device i onaylarken. Ve Event Viewer da asagida gordugunuz hata ile karsilasirsiniz.

WDSApprove (9)

Hatanin sebebi aslinda oldukca acik sekilde hata kaydinda da yer alir, eger bilgisayar isimlendirme policylerine takilmiyorsaniz , icinde computer objesi yaratmaya calistiginiz OU altinda WDS inizin calistigi sunucunun nesne yaratma hakki yoktur, bu hakki sunucunuza atamak icin. Active Directory Users and Computers aracini calistirip hak tanimlamasi yapmaniz gerekecek bu sebeble Domain Admins grubuna dahil kullaniciniz ile araci acip WDS de Directory Services da belirttiginiz veya sectiginiz OU nun uzerine sag tusla basarak Delegate Control u seciniz.

WDSApprove

Gelen ekranda Add tusuna basiniz

WDSApprove (2)

Object Types i secerek Computers i filtrenize ekleyiniz , cunku Computer Accountu ekleyecegiz.

WDSApprove (3)

WDS sunucunuzun ismini yazip arattirdiktan sonra islemi onaylayiniz.

WDSApprove (4)

Tasks to delegate ekraninda Create a custom task to delegate secenegini seciniz ve sonraki ekrana geciniz.

WDSApprove (5)

AD Object Type ekraninda Only the following objects in folder secenegini secerek verecegimiz hakkin sinirlarini daraltalim ve listeden Computer Objects i secelim ve create selected objects in this folder ile bu haklari yaratacagimizi belirtelim ve sonraki adima gecelim.

WDSApprove (6)

Gelecek olan Permissions ekraninda ise Write All Properties secenegini secerek verecegimiz hakkin sadece yazma ile ilgili olmasini belirleyelim ve sonraki adima gecip islemimizi tamamlayalim.

WDSApprove (7)

Vermek uzere oldugumuz haklarla ilgili ozet bilgileri gozden gecirip islemin tamamlanmasini onaylayalim.

WDSApprove (8)

Saturday, 6 August 2011

WDS'te boot menüyü configure etme

Windows Deployment Services boot menusu bir den falza boot image e sahipseniz konfigure edilir , menuyu konfigure etmek iste asagidakilerden birini yapabilirsiniz.

  1. Farkli mimaride bir den fazla Window PE imajini yukleyebilirsiniz,

  2. Ayni mimaride iki veya daha fazla Windows PE imajini yukleyebilirsiniz,

  3. WDSUtil i kullanabilirsiniz, WDSUtil i nasil kullanacaginiz ve parametretlerini gormek icin /? seklinde calistirmaniz yeterli olacaktir.


Biz simdi grafik arayuzden boot imaji eklemeye degil de komut satirindan nasil ekleyebiliyoruz ona bakacagiz.

Komut satirinda imajiniza ait tam yolu imajinizin ismi dahil yazmaya dikkat ediniz, ornegin;

WDSUTIL /add-image /imagefile:\\sunucu\paylasim\imajlarim\imajdosyasi /imagetype:boot

yukarida da gordugunuz gibi add-image parametresi ile imaji eklemek istedigimizi, imagefile ile imajimizin adresiniz , imagetype ile ise imajimizin tipini yani boot imaji oldugunu belirtiyoruz.

Simdi istemcinizi yeniden baslattiginizda boot menusunde yeni eklediginiz imaji da gorebileceksiniz, normalde sadece standart bir imajiniz vardi ise artik menuyu gorebiliyor olmaniz gerekir.

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

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

Monday, 17 January 2011

WDS Detayli Komut Satiri Parametreleri

/Get-AllDevices         Displays information on all pre-staged devices.
/Get-AllImageGroups     Displays information on all image groups.
/Get-AllImages          Displays information on all images.
/Get-AllServers         Displays information on all WDS servers.
/New-CaptureImage       Creates a WinPE image used for capturing OS images.
/New-DiscoverImage      Creates a WinPE image used for WDS server discovery.
/Add-Device             Adds a pre-staged device.
/Get-Device             Displays attributes of an existing device.
/Set-Device             Changes attributes of an existing device.
/Add-Image              Adds boot or install images.
/Copy-Image             Copies an image within the image store.
/Export-Image           Exports an image from the image store to a WIM file.
/Get-Image              Displays the attributes of an existing image.
/Remove-Image           Removes a boot or install image.
/Replace-Image          Replaces a boot or install image with a new version.
/Set-Image              Changes the attributes of an existing image.
/Get-ImageFile          Displays information on images in a WIM file.
/Add-ImageGroup         Adds an image group.
/Get-ImageGroup         Displays information on an image group.
/Remove-ImageGroup      Removes an image group.
/Set-ImageGroup         Changes the attributes of an existing image group.
/Approve-AutoAddDevices Approves pending auto-add devices of server.
/Reject-AutoAddDevices  Rejects pending auto-add devices of server.
/Get-AutoAddDevices     Displays auto-add devices on server.
/Delete-AutoAddDevices  Deletes devices in the auto-add device database.
/Convert-RiPrepImage    Converts an existing RIS RIPrep image to a WIM file.
/Disable-Server         Disables all WDS services on a server.
/Enable-Server          Enables all WDS services on a server.
/Get-Server             Displays information on a WDS Server.
/Initialize-Server      Configures a WDS server for initial use.
/Set-Server             Configures settings of a WDS server.
/Start-Server           Starts all WDS services on a server.
/Stop-Server            Stops all WDS services on a server.
/Uninitialize-Server    Reverts changes made during server initialization.
/Update-ServerFiles     Updates server files on the REMINST share.

To get help for specific command use:
     WdsUtil command /?