Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Add logging to Powershell Script

$
0
0

Hello Everyone

I am working on the following script and I need to add some kind of logging for what has been deleted. I am not very strong in this part of powershell and hoping for some tips.

I would like the text file to state the name of the mailbox that has been deleted as well as the name of the aduser account that has been deleted. While this script is not finished yet it does produce the results I need

Here is the script

Powershell
#Opens Session on Server$mail=New-PSSession-ConfigurationNameMicrosoft.Exchange-ConnectionUrihttp://server/powershell-nameserver-AuthenticationKerberos-Credential$credImport-PSSession$mail-WarningActionSilentlyContinue|Out-Null# Defines Exchange Database$database="Mailbox Database"# Finds all Disabled Mailboxes Where user has not logged in over 60 Days and Deletes Them$(...

Viewing all articles
Browse latest Browse all 15370

Latest Images

Trending Articles



Latest Images

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