Books
Translate This Blog
-
Recent Posts
Top Posts
- Querying UDP Ports with PowerShell
- Changing Ownership of File or Folder Using PowerShell
- Starting,Stopping and Restarting Remote Services with PowerShell
- Avoiding System.Object[] (or Similar Output) when using Export-Csv
- Quick Hits: Finding Exception Types with PowerShell
- Locating Mount Points Using PowerShell
- Building a Chart Using PowerShell and Chart Controls
- Using PowerShell Parameter Validation to Make Your Day Easier
- PowerShell and Excel: Adding Some Formatting To Your Report
- Quick Hits: List All Available WMI Namespaces Using PowerShell
Archives
Categories
- .net
- api
- array
- background jobs
- binary
- book
- c#
- clock
- codeplex
- com object
- convert
- CTP
- database
- deep dive
- excel
- Favorites
- function
- groups
- guest blog
- hash table
- Internet Explorer
- ise
- mcpmag
- module
- MVP
- network
- news
- parameter
- patches
- performance
- pinvoke
- podcast
- port
- PoshChat
- poshpaig
- PoshRSJob
- poshwsus
- powercli
- powerscripting
- Powershell
- printers
- quickhits
- reflection
- regex
- registry
- Regular Expressions
- report
- resolution
- runspace
- runspaces
- scripting games 2012
- scripting games 2013
- scripting guy
- scripts
- SMO
- Speaker
- speaking
- SQL
- tcp
- tips
- tsql
- updates
- user group
- V3
- V4
- v5
- weather
- widget
- win32API
- winter scriting games 2014
- wmi
- word
- WPF
- wsus
- xaml
-
Join 481 other subscribers
Latest Technet Activity
- Contributed a helpful post to the Using start-job -scriptblock to run script; need help using parameters thread in the The Official Scripting Guys Forum! Forum.
- Contributed a helpful post to the Script to set the Primary DNS Suffix thread in the The Official Scripting Guys Forum! Forum.
- Contributed a helpful post to the Error Handling during Import from CSV (Using Set-QADUser) thread in the Windows PowerShell Forum.
- The Demo Script to View USN Change Journal Entries contribution has been downloaded 1,000 times from the Technet Gallery. That's quite the achievement!
- The Set-ClientWSUSSetting contribution has been downloaded 10,000 times from the ScriptCenter Gallery. Wow, you've certainly raised your profile!
- The Constrained Remote Endpoint - Services Demo contribution has been downloaded 1,000 times from the ScriptCenter Gallery. That's quite the achievement!
- Contributed a helpful post to the try/catch doesn't work thread in the Windows PowerShell Forum.
- Contributed a helpful post to the Telnet using powershell thread in the Windows PowerShell Forum.
- Contributed a helpful post to the Telnet using powershell thread in the Windows PowerShell Forum.
- Received a 5 star rating on the Set the position and size of a Window contribution on the ScriptCenter Gallery.
Blog Stats
- 5,326,703 Visitors Since August 5, 2010
Meta
Hi!
I’m working on a powershell script to convert a docx to html, but with a different encoding than W-1252 because I’m tryling letter to send an email with the body on html and, as I am Spanish, I need accents and tildes to show up (those are appearing as ? right now). I tryied the method of saveas with all the parameters (ref: https://msdn.microsoft.com/en-us/library/office/aa220734(v=office.11).aspx) but i didn’t make it work. This is my script:
Open word to add input into the signature file
$MSWord = New-Object -ComObject word.application
$MSWord.Documents.Open(“C:\Users\USER\Videos\CAMBIO_TURNO.docx”)
$MSWord.Visible = $False
# Save HTML
$saveFormat = [Enum]::Parse([Microsoft.Office.Interop.Word.WdSaveFormat], “wdFormatHTML”);
$path = “C:\Users\USER\Videos\CAMBIO_TURNO.html”
$MSWord.ActiveDocument.saveas([ref]$path, [ref]$saveFormat)
Close File
$MSWord.ActiveDocument.Close()
$MSWord.Quit()
AND TO SEND IT TO ME
C:\Users\GDOC-PatriciaFdez\Videos\convert-excel-to-html.ps1
PARTE DEL SCRIPT DE EMAIL
$OutputEncoding = [System.Text.Encoding]::UTF8
$body = [IO.File]::ReadAllText(“C:\Users\USER\Videos\CAMBIO_TURNO.html”)
send-mailmessage -to “EMAIL@EMAIL” -from “EMAIL@EMAIL” -subject “CAMBIO” -Body $body -Encoding $OutputEncoding -BodyAsHtml -Attachments “C:\Users\USER\Videos\CAMBIO_TURNO.xlsx” -dno onSuccess, onFailure -smtpServer smtp.gmail.com -Credential EMAIL@EMAIL
Need help with a script wasn’t sure if anyone can help
I need a script to pull all users within AD which have an extensionattribute5 set to “2” from these users I need to pull the account with a password age greater the 180 days. Then the accounts that the script pulls need to subtract the 194 minus the password age in days . and send separate email for each account to a specified email address saying something like
“Manager, The account for “User” password is currently “password age” old the password will expire in “194-password age” Days
Can anyone help?
I would like to code a simple powershell script to have a computer do the following:
1. login to a webserver that requires the client to have a PKI soft cert
2. Upload a file to the webserver
3. logout or exit the webserver
I don’t know very much about powershell yet.
Pingback: Powershell Learn Online | Easy Business Online Expert
Hi Boa,
I am using your Get-Certificate.ps1 script to list certificates on windows servers.
.EXAMPLE
Get-Certificate -Computername ‘boe-pc’ -StoreName My -StoreLocation LocalMachine
Is there any way to list the field in the certificate called signature hash algorithm? I need to find out the certificate is a SHA1 or above.
Hi Boe,
I ran across your scripts while doing some research for WSUS. I’m inheriting a system that is already configured, and I’m trying to tell what updates were assigned to the various computer groups. I had a question, “Is there a way to tell what update is assigned to a Computer group?” It doesn’t matter if it’s using the WSUS client, or a PowerShell script. Thanks in advance.
Hello
Do you have any way that PowerShell (as admin) can read \.\physicaldrive0
Get-Content and System.IO.File wont accept that
Probabl;y need to p/invoke the win32 api ReadFile
Thanks
typo \.\physicaldrive0
\.\physicaldrive0
backslash, backslash, dot, backslash, physicaldrive0
backslash, backslash, dot, backslash, physicaldrive, zero
this reply form keeps removing and/or changing stuff !
Boe – Great powershell scripts! I was wondering if your script for auto discovery and agent push for SCOM (SCOMAgentAudit.ps1) runs on SCOM 2012 R@. Been running into some errors, not sure if user or compatability. Thanks!
Let me know what those errors are. I can’t promise that I will have a fix for it because I do not have access SCOM 2012 R2, but can at least see what I can do.