Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $Email = Read-Host -Prompt 'Enter your E-mail Address'
- $User = Get-ADUser -Filter {EmailAddress -eq $Email} -Properties sAMAccountName | select sAMAccountName | select -ExpandProperty sAMAccountName
- $password = read-host "Enter your E-mail Password:" -assecurestring
- $cred = New-Object System.Management.Automation.PSCredential($User,$password)
- New-PSDrive -Name P -PSProvider FileSystem -Root \\Fileserver -Credential $cred -Persist
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement