PowerShell + Registry + PSDrive: Removing a registry value
I had to remove a registry value this morning to reverse a change I made last year, and instead of firing up the GUI to do so, I decided I’d make myself a New Year’s resolution on my first day back at...
View ArticlePowerShell: Provide a listing and count of computers in an OU structure
Today I had to quickly figure out how many server computer accounts we had in AD. We have an OU structure like domain/servers/location1, domain/servers/location2, etc This is how I did it: # Assumes a...
View ArticleInstalling MYOB AccountRight 2014.x with Folder Redirection
It turns out that MYOB AccountRight 2014.x can’t handle folder redirection being enabled on the user’s documents folder. Here’s how I got around the issue when deploying the application with SCCM and...
View ArticleJuniper SA Device – CRL error “Failed, server error (400)”
Had an issue when trying to set up a Trusted Client CA for certificate authentication on a Juniper SA 2500 box. I’d add the HTTP CDP URL, and I’d get an error: It turned out that the Juniper didn’t...
View ArticleCopy the previous PowerShell command to the clipboard
I often have multiple PowerShell windows open; at least one for testing out commands, and then the ISE for writing scripts. Here’s a quick one-liner to copy the previous PowerShell command to...
View ArticleMigrating DHCP from Server 2003 to 2012 R2
There are plenty of articles covering this, but most of them walk you through installing features, etc. Here’s a quick braindump of one of my migrations of DHCP from a Windows Server 2003 DHCP server...
View ArticleCopy Active Directory Group Membership with PowerShell
If you need to copy AD group memberships from one user or computer account to another, you can do so with the following two lines of PowerShell. This depends on the ActiveDirectory module being loaded,...
View ArticleSimple IP Range Scan using PowerShell
I had to jump on a bunch of remote servers today that are largely unmanaged by my department. Since it was the first time I’d needed to deal with this job, and there was no prior documentation, I...
View ArticleEnable/Disable Wi-Fi Adapter based on Wired adapter status
There are plenty of articles around the Internet discussing how to enable or disable a Wi-Fi adapter based on the status of the wired connection. Whilst I’ve seen that some Dell laptops have this as a...
View ArticleDelete old log files with PowerShell
Today I came across a folder full of log files created by an import/integration application on one of our servers. The folder contained over 50,000 files. Rather than manually delete the old logs,...
View ArticlePowerShell: Finding folders that don’t match a pattern
This week I came across an issue where some folders didn’t match a naming convention that was required by another third-party system. Because of this, data wasn’t being extracted from all of the...
View ArticlePowerShell: Provide a listing and count of computers in an OU structure
Today I had to quickly figure out how many server computer accounts we had in AD. We have an OU structure like domain/servers/location1, domain/servers/location2, etc This is how I did it: # Assumes a...
View ArticleInstalling MYOB AccountRight 2014.x with Folder Redirection
It turns out that MYOB AccountRight 2014.x can’t handle folder redirection being enabled on the user’s documents folder. Here’s how I got around the issue when deploying the application with SCCM and...
View ArticleActive Directory + PowerShell: Get users created in the past 7 days
Just a quick one-liner that I had to use today. Gets all AD Users created in the past 7 days: Get-ADUser -Filter "created -gt '$((Get-Date).AddDays(-7).ToShortDateString())'" I had to tack on the...
View ArticleScript to create new local admin account for use with LAPS
I’ve got a bunch of older SOE machines that still had the local Administrator account enabled. As part of implementing Microsoft LAPS, I wanted to disable that account, and use a newly-created...
View ArticleADFS 3.0 Error: The Web request failed because the web.config file is malformed
Had a strange one today after an Azure outage. One of my Server 2012 R2 ADFS proxies wouldn’t start the ADFS service. When looking in the logs, it appeared like a case of simply having to re-establish...
View ArticleCorrect Horse Battery Staple for PowerShell, AKA Random Memorable Password...
I’m a fan of using correcthorsebatterystaple.net for generating temporary passwords for users, rather than always using a static password. The site itself is a reference to the XKCD webcomic, and yes,...
View ArticleTrigger a remote GPUpdate without PSRemoting or PSExec
I recently enabled Windows Firewall on an unused server via GPO, but forgot to include the inbound RDP exception. This, of course, kicked me off my RDP session. Rather than wait ~90 minutes for my...
View ArticleQuickly uninstall an MSI on multiple computers using WMI
Today I was working on reducing our vulnerability attack surface, and needed to remove Adobe Reader from our servers. It appears that it was installed as part of a VM image, but never maintained...
View ArticleRetrieving voicemail files from a Mitel 3300 controller, and converting them...
Today I had the displeasure of having to figure out how to retrieve and convert voicemail files from some old Mitel 3300 controllers. Thanks to this forum post which pointed me in the right direction....
View Article
More Pages to Explore .....