I'm Just An Engineer

This is the blog of DJ (@gkrew) and Brad, two guys who are just engineers on a messaging team supporting Microsoft Exchange Server. DJ is an IT Pro with experience as an Enterprise System Administrator in Microsoft Windows and Unix. Brad is a self-taught coder who develops code to assist with Exchange Administration using C# and PowerShell. There will be posts about Exchange, PowerShell, Active Directory, C# and scripts that you can use in your job as well as anything IT related.

Tuesday, May 31, 2022

Handling errors in Powershell (terminating and non-terminating) and capturing errors into a variable without a red letter message being output

›
  If you've ever written a script for someone else and wanted to hide (but still capture) the normal red letter output that happens from...
Friday, February 11, 2022

How to keep your server from locking the screen or turning off the display, evading a timeout period

›
Sometimes you don't have access to group policy or powercfg.exe and have a virtualized server that makes no sense to have screen lock on...
Thursday, January 6, 2022

So you're trying to use Powershell Out-File or Add-Content to create a csv with data/a variable that has (contains) commas inside of it?

›
Below is the code example of why this is such a PITA. It uses Exchange Powershell to grab distribution groups from an OU and then to read th...
Thursday, June 17, 2021

How to convert a CanonicalName (cn) to a DistinguishedName (dn) in Powershell

›
This was surprisingly not easily found on the internet, so when a coworker asked me how to convert a CanonicalName (cn) to a DistinguishedNa...
Thursday, March 19, 2020

Why won't try/catch work and catch my powershell error

›
So this drove me nuts for a long time and I couldn't find anything on the net to figure out why Powershell didn't function like the ...
Thursday, December 12, 2019

Reading registry values in powershell without an error red lettering

›
Surprisingly there wasn't a complete answer for this when searching the web after a coworker asked me for help with this. I found some ...
Monday, October 28, 2019

Getting or setting values in O365 with a Powershell function

›
Pay special attention to the values $ConnectionUri, $AzureADAuthorizationEndpointUri and $ModulePath as you may need to change them. My c:...
Thursday, September 26, 2019

Split a string based on a delimiter character, only if the character is not inside of a set of quotes in Powershell

›
Below is the function and example. You can also strip the code out of the function and run it inline if you assign values to the 2 variable...
Wednesday, August 14, 2019

How to read an XLSX file in .net code natively, without any 3rd party tools

›
Much to my surprise, there is no native way to read xlsx files in C# or PowerShell. Recently I had to write code that grabbed values from a...
Thursday, August 1, 2019

How to replace all commas outside of quotation marks programmatically in Powershell

›
From time to time I have to parse a csv file that also has names in it, usually lastname, firstname inside of quotes. This is obnoxious i...
Thursday, April 25, 2019

How to get environment variables of the current logged on user, when running scheduled tasks or powershell as the System Account (NtAuthority\System)

›
While running a scheduled task that I needed to run as the local System account, I noticed that any environment variables were not accessib...
Monday, April 22, 2019

Getting and setting IPMI settings through powershell

›
We had an issue where some servers had IMPI enabled and some did not, in order to get uniformity on > 200 servers, a quick script was de...
Monday, September 10, 2018

(Powershell) Faster: RedistributeActiveDatabases.ps1 –ShowDatabaseCurrentActives or dag distribution script

›
The output of  RedistributeActiveDatabases.ps1 –ShowDatabaseCurrentActives leaves much to be desired, when you are verifying the dag distrib...
›
Home
View web version

Contributors

  • Brad
  • DJ
Powered by Blogger.