Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

writing meaningful errors to log &/or screen in PowerShell

$
0
0

Hi all,

I am improving my powershell skills all the time and I want to improve my scripts with some meaningful error trapping.

One of the projects I am working on is migration mail accounts to O365 and what I would like is when I process a batch of user to error trap non-existent accounts as the list I have is out of date. I would like to output to a log file something like xxx@xxx.com not in AD or xxx@xxx.com already has an O365 account.

Can anybody help or point me in the right direction please. I have read some articles on error trapping but can't get me head around it properly

TIA

Andy


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>