How to passthru credentials on o365?

I have the following script that maps my OneDrive for Biz and an online Sharepoint library to my Quick Access links in Windows Explorer. The problem is that to get it to work I first have to access those sites using my browser.

We are setup with on-prem AD using AD Connect with passthru credentials. With this setup I just need to open the URL for OneDrive for Biz and the online Sharepoint library w/o having to provide credentials. How can I get the below script to work by passing the user’s credentials?

$site = "\\\DavWWWRoot\sites\oursite\IT"

$site2 = ‘\\DavWWWRoot\personal’ + $env:username + ‘_OURDOMAIN_org\Documents’

$QuickAccess = New-Object -ComObject shell.application




Here is what I did to get credentials to pass through.

$ie = Start-Process -file iexplore -arg '' -PassThru -WindowStyle Minimized
sleep 15
$ie = Start-Process -file iexplore -arg "${env:username}_OURDOMAIN_org\Documents" -Passthru -WindowStyle Minimized
sleep 15
$folder = '\\\DavWWWRoot\sites\TEST'
$folder2 = '\\\DavWWWRoot\personal\' + $env:username + '_OURDOMAIN_org\Documents'
$QuickAccess = New-Object -ComObject shell.application