Hi I am using the following script to disable OWA for a list of users, how can I generate a result log file for actions like error warning and success while running this script?
I would like to get the following in log with respect to the result of command.
For each Successful operation print - OWA disabled for user $username
For each Warning print - OWA disabled for user $username with warning
For each Error print - Not able to disable OWA for user $username
Thanks in advance.
$UserList = get-content userlist.txt
foreach ($Username in $UserList) `
set-casmailbox -identity $UserName `
-OWAEnabled $false `
-POPEnabled $false `
-ActiveSyncEnabled $false `