First you will need to create a powershell script, next we will create a shortcut that runs the powershell script.
I use the following details in my script:-
******************************************************************************************************
Param (
[switch] $AuthenticationPrompt = $false,
[string] $AdminUsername = "domain\username"
)
$Error.Clear()
If ($AuthenticationPrompt) {
Write-Host -ForegroundColor Green "Requesting Credentials for Lync Server Administrative Session"
$CSSession = New-PSSession -ConnectionUri https://<FrontEnd Pool FQDN>/ocspowershell -Credential $AdminUsername -ErrorAction SilentlyContinue
}
else
{
$CSSession = New-PSSession -ConnectionUri https://<FrontEnd Pool FQDN>/ocspowershell -Authentication NegotiateWithImplicitCredential -ErrorAction SilentlyContinue
}
If ($Error.count -gt 0)
{
Write-Host -ForegroundColor Red "Unable to Connect to Lync Server Administrative Session`n Error:" $Error
}
else
{
$ImportResults = Import-PSSession -Session $CSSession
Write-Host -ForegroundColor Green "Connected to Lync Server Administrative Session`nImported" $ImportResults.ExportedFunctions.count "CS Functions"
}
cd $env:UserProfile
******************************************************************************************************
Save this as a .PS1 file. In my example below I saved it as c:\Utilities\StartCSRemotePowershell.ps1
Substitute the AdminUsername to that of your admin account that has the correct RBAC
Now for the shortcut. Create a shortcut to the PS.1 file and edit the target of the shortcut to something similar to the following:
******************************************************************************************************
powershell.exe -noexit -executionpolicy bypass -file c:\Utilities\StartCSRemotePowershell.ps1 -AuthenticationPrompt –CSPoolFQDN <FrontEnd Pool FQDN> -AdminUsername <lynclab\lync.admin>
******************************************************************************************************
No comments:
Post a Comment