Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for login_connect_network_drives.ps

(view source code of login_connect_network_drives.ps as plain text)

  1. try {
  2. 	New-SmbMapping -LocalPath 'G:' -RemotePath '\\CompanyServer\Dept'
  3. }
  4. catch {
  5. 	Write-Host 'Error mapping drive G:'
  6. 	Write-Host $_
  7. }
  8.  
  9. try {
  10. 	New-SmbMapping -LocalPath 'H:' -RemotePath "\\CompanyServer\$Env:UserName"
  11. }
  12. catch {
  13. 	Write-Host 'Error mapping drive H:'
  14. 	Write-Host $_
  15. }

page last uploaded: 2021-01-27