PowerShell Transcripts for Auditable Administrative ScriptsPowerShell Transcripts for Auditable Administrative Scripts
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started
A PowerShell habit that has saved me more than once: start every admin script with Start-Transcript.
Start-Transcript -Path "C:\Logs\$(Get-Date -Format yyyyMMdd-HHmm)-mailbox-cleanup.txt"
It records every command and every line of output, errors included, until Stop-Transcript runs. When someone asks "what changed on Tuesday?", you have an answer instead of a guess.
A few tips: - Put Stop-Transcript in a finally block so the log closes even if the script fails. - Keep logs in one folder with the date in the file name. - Never write passwords or tokens to the screen, because the transcript captures them too.
Small habit, big payoff when you need to retrace your steps.
Back to feed
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started