Wasn’t There an Option for Html?
I might have said there was at some time, but it was a white lie. What you can do is to convert the XML file into a Html document. It’s quite easy and it’s used in this way:
cscript.exe sydi-transform.vbs -xServer.xml -sServerhtml.xsl -oServer.html
Running this script will require that Server.xml and Serverhtml.xsl and sydi-html-stylex.xsl are located in the same directory. If you have created private xsl files you can use the sydi-transform to convert it.
Hey, Wasn’t This about Documentation?
It sure was, most of what we’ve looked at up until now has been more geared against Inventory instead of Network Documentation. I saved the best for last, a new tool in sydi-server 2.0 is the ss-xml2word.vbs script (or SYDI-Server XML to Word).
What the script does is that it takes an XML file and converts it to a Word document. You might be thinking that SYDI already wrote to Word, which is true, however there are situations where that isn’t possible. For example in environments where you don’t have Word installed, may it be in a DMZ or as a scheduled task on a server.
The good part though is the options you specify when creating the Word document. To view these options run:
cscript.exe ss-xml2word.vbs -h
Here you can see that there are two arguments that are required -x and -l.
cscript.exe ss-xml2word.vbs -xServer1.xml -llang_english.xml
This line will create a Word document based on the information in the Server1.xml file, it will then use the English language file which describes what it writes to the Word document. This means that you can have the documentation in your native language. When I released SYDI-Server 2.0 there was support for English and Swedish. Later people have contributed with there own language files which you can download; Italian, Norwegian, Portuguese and Dutch.
One issue that causes the ss-xml2word.vbs script to fail for many people is a path problem. If you run the script and it just writes out a few pages without any information from the xml file and the script crashes, this is happening to you. Either put all the files in the same directory or specify the path after -x -l or -s. I will fix this in future versions so the error message is a bit more user-friendly.
The most exciting feature as I see it is the optional -s argument. This is the reason I created SYDI in the first place. The -s option specifies an XML file which contains the written documentation about the server. That is the documentation you have created, this differs from the data that SYDI-Server has gathered from the machine.
Let’s take it for a spin.
Writing Your Documentation
To get you started I’ve included three files in the Examples directory (of sydi-server), copy the howto.xml and rename it to Server1_docs.xml. This will be where you will write the documentation. Open the Server1_docs.xml file in Notepad. Scrolling up and down you will see different XML tags. You’ll recognize the sections and subsections from the Word documents previously created.
Inside the sections and subsections you will se prenotes and postnotes, inside these there are a few tags. The only thing you have to do in this file is to create and edit tags. Scroll down to the section called toc (Tables of Contents), here you will se the difference between prenotes and postnotes. It has to do where they appear in the final document. Just run a few tests and you’ll se what I mean. So let’s start to document.
In the system info section change this:
In this version you are only able to use text tags, more could be availible in later versions of SYDI.To:
Physical Location: Server Room in Stockholm
System Owner: BOFH
Support Agreement: 3Y Next Business Day (Expires 2007-10-16)
Save the file and create the final document.
cscript.exe ss-xml2word.vbs -xServer1.xml -llang_english.xml -sServer1_docs.xml
The above was just an example, you are of course free to write and include whatever you want in the documentation. If you fail to create the documents it’s good to know that XML parsers are very unforgiving if there’s an error in any of the files. Make sure all tags are closed correctly by opening them in a browser. If you fail to open Server1_docs.xml in a browser the problem is there. Fix it and try again.
I’ve also created a batch file, writedoc.cmd which looks like this:
cscript tools\ss-xml2word.vbs -x\\serverr\net$\sydi\output\%1.xml -llanguage\lang_english.xml -s\\server\itsupport$\documentation-source\%1-written.xml -o\\server\itsupport$\documentation-binder\Server-%1.doc -d -b”Table Contemporary”
I use it by running
Writedoc.cmd Servername
So there you have it, that’s how I use SYDI-Server. If you have any questions just post a comment or contact me.
[tags]network documentation, server documentation, sydi, how to, tutorial[/tags]
JB says
Dude.
the ss-XML2word.vbs seems to have an issue with Work 2007. works fine in 2003 but returns a “SS-XML2Word.vbs(1249, 3) Microsoft runtime error: Type Mismatch: ‘oWord.Selection.TypeText’. I’ll have a quick look into it but it does work with other versions of word.
-JB.
PA says
This is great, however I have issue with C:\Users\Perrpetual\Downloads\sydi-server-2.3>cscript.exe ss-xml2word.vbs-xServer1.xml -llang_english.xml
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
Input Error: There is no script engine for file extension “.xml”.
Could you please tell me what I am doing wrong? Everything works well upto this point. I need to get it work before I try it on multiple computers.
Thanks and great job done.
Patrick says
PA You have to have a space between ss-xml2word.vbs and -xServer1.xml.
Chee Lam says
Hi Patrick,
Thanks for the application.
I am blogging it and soon will link back to you.
Q: Instead of do it one at a time, how can I automate writedoc.cmd to process all the xml files within the output folder?
Thanks.
Chee
Patrick says
Chee Currently I haven’t written a script which lets you do that. But I might include one in future versions of SYDI-Server.
Timo says
PA create a batch file copy and paste the following:
————————————————————————————-
@ECHO off
@set Pfad=%~d0\PortableApps\sydi-server-2.3\
@For /F %%i in (‘dir /S /B %Pfad%Rechner\*.xml’) do (
cscript.exe “%Pfad%\tools\ss-xml2word.vbs” -l”%Pfad%\language\lang_german.xml” -o”%%~di%%~pi%%~ni.doc” -x”%%~fi” -d
)
—————————————————————————————
edit the Pfad , my output xml file are in the subdirectoy Rechner so change it too.
Durai says
Thanks for your script and it is working perfectly in our environment..
I need a small help form you,How can i add further inputs to excel file which getting input from XML file
For example :
Your script show system processor speed and i need processor name too added in the output what should i do?
Hope this clears
Chris Buck says
Note for people using Timo’s script – it works perfectly but when I copied and pasted it, I had to replace all the single and double quote marks before it would work for me – replace “ with ” and ‘ with ‘ – hope this helps – Chris
cheryl says
I am running this on 2 servers and it hangs at start subroutine: gatherWMIinformation (server name)
any ideas?
Patrick Ogenstad says
Cheryl: Can you run the script locally on the servers? What happens if you use the -D option?
Rogue73k says
Thanks, Patrick.These scripts have been a very powerful tool in my quiver for some time. I predominatly support small business’ and my client cant afford the luxurey of (nor do they need…) sophiticated documentation and change management. With these scripts, I can gather what I need or have one of my techs work the site, and have the knowledge to get it done right and effectivily.
Any good suggestions for further learning articles related to techniques to manipulate the plethora of output? I usually copy and paste in Excel using VLOOKUPs and concatenation, but that has proved difficult with server counts over 4,000, and the need to report on various parts of the data in different ways.
Thanks,
Rogue73k
Pieter says
Hi Patrick,
Just to say: many thanks!!
Works perfect, looks great, easy to use,…
Thanks.
Pieter
Kong Jin Jie says
I don’t normally comment in any blogs but I think your script is worth commenting.
I want to thank you for taking the effort to write such a wonderful script to assist many network administrators in documentation (which is last thing we want to do).
Keep it up and never let this project die off!
Cheers!
Marius says
Great tool. How do I add a picture to the footer? Tx!
MrV says
What a great tool! About the HTML conversion: is it possible to convert bunch of xml files by one command or batch file? That would be really helpful.
Jon says
MrV – I was just trying to figure out the same thing and ended up with the following batch script – it’s not clean, but it works… see below:
for /f “usebackq delims=|” %%f in (`dir /b “z:\output”`) do cscript.exe sydi-transform.vbs -x”..\output\%%f” -s”..\output\serverhtml.xsl” -o”..\HTML\%%f.html”
Notes:
All XML Files are in Z:\Output
The required Serverhtml.xsl and sydi-html-stylex.xsl are in Z:\Output
I created a directory “HTML” in the root of my sydi-server installation
Jon says
For those interested – I incorporated the above post into a batch file that can be run as a scheduled task to gather up to date information via a scheduled task, and generate HTML files as part of the process.
All you need to do is ensure that sydi-wrapper OUTPUTDIRECTORY is pointing to a directory called “output” in the root of your sydi installation, and that you’ve created a directory called HTML in the root of your sydi installation.
Put this batch file in the root of your sydi installation, and modify the AD container configuration on line 3.
Patrick – Thank you for putting your time and effort into making this script!
Download it here (Dropbox via goo.gl url shortner): http://goo.gl/M35F9
Gabriel says
Patrick, thanks for this awesome tool. Keep up the good work.
Mark E says
I don’t often post praise, but these scripts are an absolute god send!
Thanks Patrick for all your time and effort on these. Really can’t give enough thanks….several companies think I worked my little heart out to document their estate….haha!!
Keep up the astounding work.
Manos PETRIDIS says
First of all, many heartfelt thanks for providing the scripts!
Secondly, I’ve tried sending you a Greek translation template for sydi-server xml files, but failed (report follows). Is there some other way to submit such files?
kind regards,
Manos PETRIDIS
mail failure report highlights:
support@pulsion.co.uk: Your message couldn’t be delivered to the mailbox because you don’t have permission to send to it. Ask the mailbox’s email admin to remove you from the reject list, then try again.
For more information, see DSN 5.7.130 Errors in Exchange Online and Office 365.
‘550 5.7.130 RESOLVER.RST.NotAuthorizedRejectMessageFromForMailbox; not authorized to send to this mailbox because the mailbox is set up to reject mail from certain senders’
protection.outlook.com: volo.com does not designate permitted sender hosts
Walter van Wijk says
I’m getting this error when I want to generate an Excel file.
—–
Opening Excel File
Writing Basic Computer Information
d:\sydi\tools\sydi-overview.vbs(596, 2) Microsoft VBScript runtime error: Subscript out of range
—–
It looks like that the problem is with opening a new tab in Excel
Walter van Wijk says
Problem Solved. I needed to add the followings lines :
Line 596 :
objExcel.Sheets.Add ,objExcel.Sheets(1) ‘ Add a new sheet after the last one
Line 598 :
objExcel.Sheets.Add ,objExcel.Sheets(2) ‘ Add a new sheet after the last one
Jörg Wiesemann says
There is a problem in the script sydi-audit-localgroups.vbs when you use it with Excel 2013
You got following error:
Opening Excel File
G:\IT\Sydi\server\tools\sydi-audit-localgroups.vbs(270, 4) Microsoft VBScript runtime error: Subscript out of range
And this is because Excel now only open one sheet instead of three
So you have to change row 269 that look like this
If (intSheet < 4) Then
To following
If (intSheet < 2) Then
When you have done this it works
Karim says
Hi
can anyone help with this error, thanks in advance.
I’ve copied the whole folder to D:\ and my xml output file is also in D:\
Input Error: Can not find script file “D:\sydi-server-2.4\ss-xml2word.vbs”.
Karim says
please ignore my first message. now I’m getting this message;
2) Microsoft Word: The requested member of the collection does not exist.
Word open empty and my xml file is working fine
Judy says
Similar to JON – I have used a FOR loop to product WORD documents:
for /F %i in (c:\pathtoServersTextFile) do cscript.exe sydi-server.vbs -wabefghipPqrsSu -rc -f10 -t%i -uUSERID -pPASSWORD -oc:\SYDI\%i.doc
Brian Black says
Anyone know if when you capture data using the AD connection using SYDI-Wrapper.vbs. Is there an easy way to convert all of the xml files into html using a single command or script?
Marty Gomez says
$1 = gci C:\scripts\VB\sydi-server-2.4\Out\*.xml
Clear-host
$ErrorActionPreference = ‘SilentlyContinue’
foreach ($file in $1){
$3 = $file.Name
$split = $3.split(‘.’)[0].split(‘ ‘)
cscript “C:\scripts\VB\sydi-server-2.4\tools\sydi-transform.vbs” -x”$file” -sC:\scripts\VB\sydi-server-2.4\xml\serverhtml.xsl -oC:\scripts\VB\sydi-server-2.4\Out\htm\$split.html
}
Mr AP says
Hi Guys
Anyone have this issue when running Sydi-overview
sydi-overview.vbs(593, 5) Microsoft Excel: Unable to set the FreezePanes property of the Window class
Cam Bart says
Hey Mr AP – I overcame this issue if you ensure that your excel is not launching minimized. Open and expand your excel after it is launched from SYDI. Maximise / full screen your excel window, save & close the file. On next launch of sydi-overview.vbs that creates excel file it will launch full window and capable of using the FreezePanes. Just make sure lines 590 to 603 in sydi-overview now look like:
objExcel.Cells.Select
objExcel.Cells.EntireColumn.AutoFit
objExcel.ActiveWindow.SplitRow = 0.8
objExcel.ActiveWindow.FreezePanes = True
objExcel.Range(“A1”).Select
objExcel.Sheets(1).Name = “Computers”
objExcel.Sheets.Add ,objExcel.Sheets(1) ‘ Add a new sheet after the last one
objExcel.Sheets(2).Name = “WMI Programs”
objExcel.Sheets.Add ,objExcel.Sheets(2) ‘ Add a new sheet after the last one
objExcel.Sheets(3).Name = “Registry Programs”
objExcel.Sheets.Add ,objExcel.Sheets(3) ‘ Add a new sheet after the last one
objExcel.Sheets(4).Name = “Processes”
objExcel.Sheets.Add ,objExcel.Sheets(4) ‘ Add a new sheet after the last one
objExcel.Sheets(5).Name = “OS Distribution Data”
ETT says
Hello, I run the script and get XML file, when I tried to open in Browser I could not read it is in XML tag,
how I can read this file and converted to DOC
Doug says
Good work, thanks for putting this stuff up.