|I would like to modify an old script (keep in mind half of s--- is in Exchange Management Shell and the other half regular commands)|
Essentially I am looking to pull from active directory the display name and export the mailbox to a share while naming the file with "displayname" and "lanID"
The lan id will be manually supplied. I am open to suggestions on better ways to do this. I am looking for the .pst files to be easily identified without looking up the user. Thus grabbing the display name from AD.
for /f "tokens=2*" %%a in ('net user "%LanID%" /domain ^| find /i "Full Name"') do set DisplayName=%%b"
New-MailboxExportRequest -Mailbox LANID -FilePath "\\share\d$\export\"%displayname%-%LanID%.pst"
It took me forever to piece together what I have so far. I am a noob.