Posts

Showing posts with the label Powershell

Set folder dates to newest file inside (using PowerShell)

Someone (not me this time) screwed up and while transferring content from old server to new one ended up messing all folder timestamps. Folders now have date when copy was made instead of preserving original dates as intended.

Export all SMTP addresses from Exchange using PowerShell

Tested with Exchange 2010. You'll need Exchange Management shell but no need for exchange admin rights. Get-Recipient -ResultSize unlimited | Select Name -ExpandProperty EmailAddresses | Where-Object {$_.SmtpAddress -ne $null} | Select Name,SmtpAddress,IsPrimaryAddress | Export-csv -Encoding unicode -NoTypeInformation AllEmailAddress.csv

SID HISTORY: AD

Last steps with fixing SID history.

SID HISTORY: Fixing file servers

File servers are easy thanks to Microsoft tool.

SID HISTORY: Fixing Exchange

Dumping my notes about fixing SID history at work. Use at your own risk. These worked for me but won't work for you without some adjustments.

Export Bitlocker recovery keys from AD using PowerShell

This exports list of BitLocker recovery keys from AD. Found it somewhere from web.

Export out-of-office (OOF) autoreplies from Exchange 2010 with Powershell

Quick and very dirty export out-of-office (OOF) autoreplies from Exchange 2010 with Powershell.  get-mailbox -resultsize unlimited | get-mailboxautoreplyconfiguration | where {$_.autoreplystate -ne "disabled"} | select identity,autoreplystate,starttime,endtime,@{NAME='InternalMessage';Expression={$_.InternalMessage -replace ("`n") -replace("</p","/<") -replace("<.*?>") -replace("&nbsp;","") }},@{NAME='ExternalMessage';Expression={$_.InternalMessage -replace ("`n") -replace("</p","/<") -replace("<.*?>") -replace("&nbsp;","") }} | Export-Csv -Encoding unicode -NoTypeInformation outofoffice.csv