Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- If (!(Test-Path P:))
- {
- $shareadress = "\\happydaysnurseries.sharepoint.com@SSL\DavWWWRoot\Shared Documents"
- $username = ""
- $pwd = ""
- $password = ConvertTo-SecureString -AsPlainText -Force -String $pwd
- $credentials = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $username,$password
- try
- {
- New-PSDrive –Name "P" –PSProvider FileSystem –Root $shareadress -Credential $credentials –Persist -ErrorAction Stop
- }
- catch
- {
- $_ | Out-File c:\sharepoint\mount.log
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement