If you want to find a certain text (string) in a text file or multiple text files, the quickest way to do so, is by using the select-string option. First you'd need to get a list of the files you want to search trough: $FileList = Get-ChildItem -Path "D:\temp\" or you can use it on … Continue reading Find text (string) in text file(s)
Author: Powershell Administrator
Writing to a SQL database
Last week I needed to store information in a SQL database, so I can share certain user account information with a select group of users in the helpdesk department, but they shouldn't have access to the AD itself. So I decided that a SQL database was the way to go and I can create a … Continue reading Writing to a SQL database
Stop/Restart/Pause OneDrive for business
I had an issue with OneDrive for business, which I need to use to be able to sync a SharePoint folder to my local machine. On this machine I like to do some auto cleanup with my MoveOldFiles script (a script that moves all files in certain folders to sub folders in the format yyyy\MM, … Continue reading Stop/Restart/Pause OneDrive for business
Open Excel file and run macro
I needed a way to open an Excel file and run one of the macro's inside the file to do some calculations and import some data then save the file as a new file, with the name of the previous month and its year added to it, to differentiate it from the original file. Make … Continue reading Open Excel file and run macro
Create a sharepoint (document) library
Creating a sharepoint library (works in both sharepoint foundation and sharepoint server) with powershell is a nice way to ensure all libraries within sharepoint are configured the same way. What we'll be doing here, is creating a library, disable anonymous access on it and only allow certain user groups to have access rights to this … Continue reading Create a sharepoint (document) library
Backup to zip
I wanted to have a tool that creates a backup to a zip file, but I didn't want the zip file to be recreated every time (as it can take nearly a day for some backups I wanted to make), thus I need something to synchronize to zip and remove items from the zip archive … Continue reading Backup to zip
Exporting all scheduled tasks
I wanted to have an export of all scheduled tasks ready for all servers that I manage, thus I created a little powershell tool that does that exactly. It appeared to be pretty simple to reach this goal, as there is an Export-ScheduledTask function in Powershell. This is what I used, but I wanted to … Continue reading Exporting all scheduled tasks
It has been a while…
It's been a while since I posted anything on this site. At work I haven't been able to work much with Powershell as other activities needed my time. Next to that I've gotten a lower back hernia, which was/is very painful and made it not able for me to sit and use my computer. The … Continue reading It has been a while…
Use text to speech to read the hardest poem in the English language
Some years ago I came across one of the hardest poems in the English language, and since I've been playing with the text-to-speech engine I decided to let the text-to-speech deal with the poem. It seemed to do very well and tought me how to pronounce some words I had never heard of as well. … Continue reading Use text to speech to read the hardest poem in the English language
Text to speech alarm clock with powershell
Thanks to a blog by Jefferey Hicks about an alarm clock in powershell using the PC speaker, I thought it would be nice to tweak that script a little bit and use Microsoft's text to speech engine so you can use the alarm and let a voice wake you through your headphones or speakers. To … Continue reading Text to speech alarm clock with powershell