Showing posts with label Packaging amp; Deployment. Show all posts
Showing posts with label Packaging amp; Deployment. Show all posts

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

Tuesday, 7 December 2010

HP Quick Launch Button Uygulama ve Surucusunu MDT ile sessizce kurmak

1. Suruce ve uygulama paketini HP'den indirin, benim kullandigim versiyon SP44777.exe
2. Paketi bir klasore acin WinRar ile : C:HPQLBD
3. CMD acip C:HPQLBD klasorune girin
3. setup.exe -r -f1"c:setup.iss" komutunu calistirip uygulamayi kurun
4. Eger uygulama calistiginiz bilgisayar uzerinde lazim degil ise kaldirin.
5. Yarattiginiz C:setup.iss dosyasini to C:HPQLBD klasorune kopyalayin, uzerine yazma islemini onaylayin.
6. Dosyayi WinRAR ile RAR layin.
7. RAR dosyanizi acip ToolsConvert Archive to SFX i secin.
8. Advanced SFX Options i secin.
9. Run after extraction kismina setup.exe -s yazin.
2009-10-07 16.00-01
10.Modes TAB : Unpack to temporary folder box'unu ve Hide all button'i secin.
11. OK'e basin ve Winrar'i kapatin.
2009-10-07 16.04-02
12.Hazir, simdi uygulamayi MDT de Application olarak yaratabilirsiniz, Silent Installation Command kismina yarattiginiz sfx rar uygulama adini yazmaniz yeterli olacaktir.
2009-10-07 16.05-03

Thursday, 7 October 2010

How to install HP Quick Launch Button Application and Driver silently via MDT

1. Download the driver pack from HP, the version I used is SP44777.exe
2. Extract the package to a folder, e.g : C:HPQLBD
3. Run CMD and CD to C:HPQLBD
3. Run setup.exe -r -f1"c:setup.iss" and install the application as you wish
4. Uninstall the application if you don't need on your work computer.
5. Copy the newly generated C:setup.iss file to C:HPQLBD folder, confirm to overwrite the old one.
6. Compress the folder with WinRAR
7. Open the .RAR file with WinRAR and select ToolsConvert Archive to SFX
8. Select Advanced SFX Options
9. Write setup.exe -s to Run after extraction section
2009-10-07 16.00-01
10.Modes TAB : Select Unpack to temporary folder box, and Hide all button.
11.Select OK, and close Winrar.
2009-10-07 16.04-02
12.Ready, create the application on MDT , use just your sfx rar package name as silent installation command.
2009-10-07 16.00-01