r/PowerShell • • Apr 21 '21

"Your stupid PowerShell script is broken."

That was the title of an email I received this morning from a newly hired manager. Never dealt with them directly before, but I'd heard rumblings from others he was 'difficult' to deal with. The manager who wrote the email also CC'd the IT Group of some thirty people covering HQ and three other offices from the VP of IT down. This resulted in a high-pri ticket with my name on it.

This concerned a simple piece of PowerShell code, you type in your email address and the OU site you wanted queried and it sends you the group member list of the AD Groups in that site via email. There's no read me file. The people who need it know how to use it. It's used by the security auditors to make sure the right people in that site are in the right OU's. The scripts are in a group folder that are available to management at the company. When the script is run (It's called "SiteReview.ps1"), the prompts show in the PS Window as:

**** Site Review v1.02 ****
**** In case of issues contact (My name & my email) ****
Email: (Pause for input) 
Site: (Pause for input)

The email said that this manager could not get "any usable output" from my script then went on to berate me for "wasting their time" with "such unproductive software". This really surprised me as I had not touched that code in over three years and it was used quarterly by the security auditors. I had built in logging that dumped results into a separate file folder only available to IT so that was my first stop.

The first part of the SiteReview.log file was typical, my early tests and past security output ; so I slid down to the more recent time / date stamps.

This (edited for readability) is what I found:

Email: (Managers email)
Site: (XXX site 1)
Error message "Get-ADSite : Directory Object not found..."

Email: (Managers email)
Site: http://(XXX site 1)
Error message "Get-ADSite : Directory Object not found..."

Email: (Managers email)
Site: https://(XXX site 1)
Error message "Get-ADSite : Directory Object not found..."

Email: (Managers email)
Site: www.(XXX site 1)
Error message "Get-ADSite : Directory Object not found..."

(Twenty-two more entries involving four more XXX sites) 

My boss came up to my desk for an update just as I found the above and one glance raised eyebrows. They asked me to forward the log to their email.

Just before closing I was messaged to close the ticket and "not worry about it."

350 Upvotes

141 comments sorted by

View all comments

Show parent comments

10

u/stone500 Apr 22 '21

People definitely deserve it, but I don't think there's ever a scenario where your manager says "Hey it was really good how you gave that guy the business and embarrassed him in front of everyone so we wanted to give you a bag of money and a nice promotion"

Professionalism is always always preffered. Definitely notify your boss of the situation, but there's no benefit to calling him out publicly. If personal issues persist then you notify your manager, HR, and his manager if necessary.

7

u/Letmefixthatforyouyo Apr 22 '21 edited Apr 22 '21

I disagree. Occasionally, you have to throw an elbow to make it clear to people that if they come after you, you will hit them back. It means you will have to deal with way less elbows in the future.

The key is to be calm and professional in the response. A simple

"hello X,

This is a tool used to search an ADsite group based on a submitted user query. Based on the logs generated, it appears that you were trying to access various adult web sites with your work login, see attached. Please note that this tool will not return data for any website, adult or otherwise, as its specific to our internal active directory. If you have any further questions or concerns about this tool, please let me know. Id be glad to answer them."

Calm, direct, but also specifically showing he was trying to hit pornhub/etc. It demonstrates competency, clears your name, and shows IT can generate receipts when people make bold claims. Thats a win win win.

-1

u/S-WorksVenge Apr 22 '21

Missing an apostrophe in a professional email... not a good look.

1

u/stuart475898 Apr 22 '21 edited Apr 22 '21

Lol - my sarcasm-o-meter lit up when I read this reply. An expertly crafted comment indeed.