Overview
In a somewhat recent shift from On-Prem Exchange to Office 365, one of our objectives included eliminating those troublesome PST files by either merging them into users' mailboxes or transforming them into shared mailboxes. My goal is to shed light on how we conducted a network discovery to identify these files. While we successfully utilized SCCM for local PST files, this post will focus on the method I used for network-wide discovery.
The Details
Prior to running the following PowerShell script, you will need to download the PSTCollectionTool.
Note: The account executing the discovery process needs appropriate permissions to access the file shares.
$Date = Get-Date -Format 'MMMdd_HHMMttss' $FileShares = @( "\\example_server1\path1\folder", "\\example_server2\path2\folder" ) ## Generate New Folder for Scans with Current Date and Time New-Item -Path "\\path\path\Network Scan Details\$Date" -ItemType Directory -Force ForEach ($Share in $FileShares) { ## Generate New Folder for Scans for Each File Share $ValidFolderName = $Share.Replace("\\", "").Replace("$", "").Replace("\", "_") New-Item -Path "\\path\path\$Date\$ValidFolderName" -ItemType Directory ## Perform Scan $LogPath = "\\path\path\Network Scan Details\$Date\$ValidFolderName\Log" $ConfigPath = "\\path\path\Network Scan Details\$Date\$ValidFolderName\Config" $cmdPath = "\\path\PSTCollectionTool\DataCollectorMaster\DataCollectorMaster.exe" $cmdArgList = @( "-DataSource", "PST", "-Mode", "Find" "-JobName", "$ValidFolderName" "-Locations", "$Share" "-LogLocation", "$LogPath" "-ConfigurationLocation", "$ConfigPath" ) & $cmdPath $cmdArgList }
0 Comments