r/PowerShell • u/BaDumDumTish • 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."
47
u/Tymanthius Apr 21 '21
We definetly need an edit to clarify if (XXX site 1) = porn.