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

28

u/MrWinks Apr 21 '21

Deserving is one thing, but the company won’t like seeing you with-holding restrait over a personal issue. Always always always deal with these confidentially. In the best case, the right people know and if asked you can vaguely and tactfully explain how it was an error in judgement. Avoid attacking others at work, as it’s unmistakable when done in just retaliation this way, even when deserved.

Though, if your boss ever gives you the approval to blast way, that’s always the best ;)

3

u/apathetic_lemur Apr 22 '21

i dont know. Every work place has a huge asshole or two that for some reason dont need to worry about tact and they do fine. Occasionally returning fire doesnt seem so bad.

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.

3

u/Jolape Apr 22 '21

Exactly. I don't think teaching people a lesson is unprofessional. If the manager had wrote the mail respectfully requesting assistance, then yes, it would be pretty unprofessional to reply-to-all with the details of what you found in the log. But if he's going to come out insulting you and putting your work/expertise in question in front of everyone, then it's on him when he gets called out.

2

u/stone500 Apr 22 '21

That's fair, though I would leave out the detail that it's adult websites. I'd keep that little bit iny pocket to use later.

The way I'd word it is "I can from the logs that you were trying to use this tool with certain websites. I can go over these logs with you and I can show you exactly what you're doing incorrectly."

1

u/Letmefixthatforyouyo Apr 22 '21

Judgement call, but id say it demonstrates poor judgement on their part, which is something you want to highlight in these situations.

Note that nowhere did I make a specific statement calling him out for querying porn on his work PC, as thats not ITs role. I just made sure that information, that was 100% part of the issue, was clearly visible to the 30+ people he decided to tag in this email. If they want to make a judgement on it, thats of course up to them.

1

u/stone500 Apr 22 '21

Note that nowhere did I make a specific statement calling him out for querying porn on his work PC

Based on the logs generated, it appears that you were trying to access various adult web sites with your work login, see attached.

2

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

Yes, exactly. Thats making it clear the sites were adult, but im not specifically stating right or wrong in a company context.

A call out would be:

"Please be aware that querying or otherwise visiting adult websites is agaisnt our computer use policy. The servicedesk will reach out to schedule a mandatory virus scan of your system shortly. To stay in complaince with company policy, refrain from interacting with adult sites in the future. Failing to do so may result in escalation to HR and possible termination."

The above is me forcing consequences and issuing ultimatums, which is directly advisarial and may be out of scope of my role. That is an option, but goes well beyond the "dont put me on blast or it will hurt" elbow I prefer.

-1

u/S-WorksVenge Apr 22 '21

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

4

u/Letmefixthatforyouyo Apr 22 '21

Yeah, this is a reddit comment, not a professional email. You can tell because its a comment on reddit.

An email would be formatted and proofread for grammitcal errors. This was not.

0

u/S-WorksVenge Apr 23 '21

You tried really hard to be professional and ended up using a lot of words to sound not only unprofessional but dumb. Hopefully you're not sending anything close to these out. You also missed an apostrophe in a word, a common mistake.

1

u/KimJongEeeeeew Apr 22 '21

Pro tip: this is not how you pop those elbows out.

1

u/S-WorksVenge Apr 23 '21

You going for a rebound or what?

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.