Currently Browsing: Windows

Using A PowerShell Function To Search and Replace in a Text file

Introduction When I started working in PowerShell for scripting in Windows I longed for a way to do inline editing of a file like you could do with sed. I was able to do this with VBScript but it was long and ugly. After learning more about some of the cmdlets I was able to create a function to search and replace. In this post I would like to share the simple function with you. The Code The overall code... read more

Migrate Windows Server 2008 R2 DFSRoot to New Drives

Introduction During a recent storage refresh ran into an issue with moving storage used by a Windows Server 2008 R2 DFS server and if and how could the DFSRoot be migrated. In this post we will cover how we were able to successfully move resources. Preparation Before migrating there are several items to accomplish. Use dfsutil to export DFSRoot / namespaces Backup registry keys for DFS Mount and assign... read more

Many Ways To Log Out of Windows Server 2016

Introduction As with every new version of Windows Server there are always some changes. with logging out of Server 2016 there are a few new ones. One of those is logging out of the server itself. It is also very good to know many different ways to log out as in some instances one method may not work. In this post we will cover a few different ways to log out. We’ll cover some different methods of logging... read more

Fixing BOOTMGR not Found error Windows 7

Introduction Recently booted system up and received a Bootmgr not found error. Tried the noprmal boot from Windows 7 install CD and ran repairs to no avail. After a bit of digging this is how the issue was resolved. It maybe that part of the solution works for your issue or all like in my case. The Process Boot system using Windows 7 installation disk. After the intial screen starts for the installation... read more

How To Find A String in a File With PowerShell

Introduction So you have a need to have PowerShell to look for a string in a file and create and entry if it doesn’t find it and do nothing if it does.  For my example I am installing an application and I need to add three lines of content, but if it exists I do not want duplicate entries created. The Code There are probably other ways to achieve the goal, but my idea was to use Get-Content and read... read more

« Previous Entries