Showing posts with label Powershell. Show all posts
Showing posts with label Powershell. Show all posts

Thursday, November 26, 2015

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.

Monday, September 01, 2014

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

Saturday, July 19, 2014

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.

Wednesday, July 16, 2014

Export Bitlocker recovery keys from AD using PowerShell

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

Wednesday, July 09, 2014

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