Hi there! I have a script for work that runs an lookup in AD for computer names. We have a lot of computers and servers, and so I put a lot of conditions as to which naming conventions to ignore. For some reason, a certain naming convention keeps getting past my original (first) If statement, and passes it onto the next ElseIf’s. Here’s a the part of the code in question.
(#####Comments explain context#####)
The naming convention that is somehow defying the original if statement (which looks for “-” or “_”) is
Non-COE_X999999 (Which contains both of the conditions I’m looking for)
Instead, it goes ahead and tries to query for it in the ElseIf part, and I don’t get why.
If anyone can shed some light on this, that would be great. I don’t know if its the If statement that’s ignoring it, or the ElseIf which is somehow overwriting it, but either its not working right.