Knowledgebase

Writing Safe Administration Scripts Print

  • microsofttechnology, microsoft, guide, howto, solution, zillionkinghost, hosting, support
  • 0

Avoiding damage at scale.

WHY IT MATTERS MORE HERE

Administration scripts change many objects at once, and mistakes affect everyone.

WHAT TO ALWAYS IMPLEMENT

A mode showing what would happen without doing it.

WHAT THE PLATFORM PROVIDES

Built-in support for that, when the script declares it.

WHAT TO ALWAYS DO BEFORE A BULK CHANGE

Run against one object Then a small group Then everything

WHAT TO OUTPUT

What was changed, with identifiers, to a log.

WHY

So the change can be reviewed and, if necessary, reversed.

WHAT TO CAPTURE BEFORE CHANGING

The current state of what you are about to modify.

WHY

It is what makes reversal possible.

WHAT TO VALIDATE

Every input, before acting.

WHAT TO CHECK SPECIFICALLY

That a variable used in a filter is not empty.

WHY

An empty filter selects everything.

WHAT TO NEVER DO

Run an unfamiliar script against production Run with more privilege than required Suppress errors to make a script complete

WHAT TO TEST

Against a non-production environment, where one exists.

WHAT TO REVIEW

Scripts that run unattended, particularly.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot