Learn about Windows PowerShell
Summary: Store your Windows PowerShell credentials in a variable for later use.
How can I store alternate credentials for repeated use in my Windows PowerShell session?
Use the Get-Credential cmdlet to prompt for a credential, and store the results in a variable:
$credential = Get-Credential
Using this now to aleviate the multiple logon's with our functions-
$c = get-credential MyDomain\MyUserId
# Load Lync
$newlyncsession = New-PSSession -ConnectionUri
mydomain-lyncpool.domain/ocspowershell -credential $c
import-pssession -session $newlyncsession
@Tim Bolton Thank you for sharing this. Awesome idea.