www.infralib.com

www.infralib.com
Please visit my new site http://www.infralib.com for my and other authors' newer posts, articles. We will also have forums, videos, webcasts and etc.
Showing posts with label WDS. Show all posts
Showing posts with label 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

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

Saturday, 5 March 2011

Create list of all WDS devices with a vbscript

I am 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.



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



The script parses and re-writes the text file and make it more usable like below.


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