Solved

PowerShell Script to export to HTML to MS Word Format

Posted on 2016-08-23
10
302 Views
Last Modified: 2016-09-20
Hi, All.

I created a script to document AD information using consolidated PowerShell code for our environment to export to HTML.

Kindly see attached file.

I would like to seek support on how can I convert this to export from HTML to MS Word Format.

Regards,
0
Comment
Question by:BillyDy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 41766638
You haven't posted a file, but an html file can be opened in Word and then saved as a Word document.

Because of the difference between the objectives of a Word document and a Web page, the appearance is unlikely to be the same.
0
 
LVL 18

Assisted Solution

by:xtermie
xtermie earned 250 total points
ID: 41766648
As Graham says, Word can open HTML but it wont be as well formatted
appearance is unlikely to be the same

A good option is to use an API like Docverter. Docverter will allow you to convert HTML to PDF or DOCX using an API.

Also you can try following the steps here which have proved quite helpful to me in similar cases:
https://weblogs.asp.net/dixin/convert-html-to-well-formatted-microsoft-word-document
0
 
LVL 55

Accepted Solution

by:
Bill Prew earned 250 total points
ID: 41766753
One other thought, if you already have a script producing the right data, and just want it in DOC format instead of HTML, why not just adjust the script to format and write to a DOC file rather than HTML?  It will take a bit more work but you can use Automation with Word to create a Word document and then save it in Powershell.  Here is a sample of the technique.

https://www.petri.com/generate-microsoft-word-document-powershell

~bp
0
Comparison of Amazon Drive, Google Drive, OneDrive

What is Best for Backup: Amazon Drive, Google Drive or MS OneDrive? In this free whitepaper we look at their performance, pricing, and platform availability to help you decide which cloud drive is right for your situation. Download and read the results of our testing for free!

 

Author Comment

by:BillyDy
ID: 41767083
Thanks guy but I am not a programmer and I cannot seems to understand how to start to code the same  information and format/rendering as my HTML Exporting report script.
0
 
LVL 55

Expert Comment

by:Bill Prew
ID: 41767110
In the original question post, you said "see attached file", but there was no file attached.  Did you mean to share the script you created?

~bp
0
 

Author Comment

by:BillyDy
ID: 41767126
@Billy Prew,

Attached is my AD Script.

Having a hard time to build a scripts from ground up for Word Format.
Get-ADReportHTML.txt
0
 
LVL 55

Expert Comment

by:Bill Prew
ID: 41768837
This expert suggested creating a Gigs project.
Just curious, why do you need it in Word versus HTML?

Looking at your script, and the mechanics of building a Word doc from PowerShell, this feels more like a Gig than a Question at this point, it's a fair amount of work an you are asking someone here to do it for you, rather than just looking for guidance on how to do it yourself.  You might want to post it over there to see if someone wants to do it for you for a fee.

If you do, I would recommend you post the existing HTML file, and/or a sample Word document that you want to be produced instead.  Also, the approach I mentioned above depends on having Word installed on the computer running the script, is that a reasonable assumption?

~bp
0
 

Author Comment

by:BillyDy
ID: 41785527
Thank you Xtermie and Bill Prew. I have made a separate script for this work effort,
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the adminiā€¦

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question