Last active
March 16, 2022 20:05
-
-
Save AlexanderHolmeset/f288cb9d72bba682b1e1aa5c41f9904f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$PSTfiles = dir 'c:\temp\pstfiles\PST Export_Export\03.16.2022-1208PM\Exchange' | Select-Object name | |
$filepath = "C:\temp\ImportPSTMapping.csv" | |
# Header for CSV file | |
"Workload,FilePath,Name,Mailbox,IsArchive,TargetRootFolder,ContentCodePage,SPFileContainer,SPManifestContainer,SPSiteUrl" | Out-File -Encoding utf8 -FilePath $filepath | |
foreach($PSTfile in $PSTfiles){ | |
$mailbox = @() | |
#First domain is the source domain+.pst | |
#Seccond domain is the destination domain | |
$mailbox = (($PSTfile.name).split("-"))[0].Replace("alexholmeset.onmicrosoft.com.pst","M365x04924969.OnMicrosoft.com") | |
"Exchange,/Exchange,[email protected],[email protected],FALSE,/,,,," | Out-File -Encoding utf8 -FilePath $filepath -Append | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment