Wenn du ein Script haben möchtest was dich remote auf deine Lync Server mit der Powershell verbindet dann ist dies eins für dich!
hier kannst Du alle Lync Server eintragen, mit den Du Dich verbinden möchtest.
#So kannst du mit Credentials in einem PS-Script arbeiten. Achtung das PW wird mit dem ausführenden Benutzer verschlüsselt und kann nur von diesem gelesen werden.
#Einmalig muss das PW in ein File gespeichert werden
#read-host -AsSecureString | ConvertFrom-SecureString | Out-File "c:Scriptpass.txt"
[string] $MenuOption = "None"
[bool] $HasInternetAccess = ([Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]'{DCB00C01-570F-4A9B-8D69-199FDBA5723B}‘)).IsConnectedToInternet)
[string] $Menu = @‘
**********************************
Lync Server 2013 – Remote Powershell Load script
**********************************
Please select an option from the choices below.
Preinstallation steps
========================
1) Fronent Server –> LyncPool01
2) EdgeServer –> Lyncedge01
3) SBA –> SBA01
99)
‚@
$Menu += @‘
99) Exit
Select an option.. [1-99]?
‚@
# Bitte Variablen anpassen
$DomainAccount = <DomainLyncAdminAccount>
$lyncPool = "<FQDN für LyncPool oder lync Frontend>"
$Lyncedge01 = "<FQDN für LyncEdgeServer oder LyncEdgePool>"
$SBA01 = "<FQDN für SBA>"
# Programm
Do {
if ($MenuOption -ne "None") {Write-Host "`nLast command: "$MenuOption -BackgroundColor Yellow -ForegroundColor black}
$MenuOption = Read-Host $Menu
switch ($MenuOption) {
1 { # Fronent Server –> LyncPool01
$username="$DomainAccount"
$pass= cat c:Scriptpass.txt | ConvertTo-SecureString
$credentials = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $username, $pass
$session = New-PSSession -ConnectionURI “https://$lyncPool/OcsPowershell” -Credential $credentials
Import-PsSession $session
}
2 { # EdgeServer –> Lyncedge01
$username="$DomainAccount"
$pass= cat C:UserssplanerDocumentsPowershellpass.txt | ConvertTo-SecureString
$credentials = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $username, $pass
$session = New-PSSession -ConnectionURI “https://$Lyncedge01/OcsPowershell” -Credential $credentials
Import-PsSession $session
}
3 { # SBA –> SBA01
$username="$DomainAccount"
$pass= cat C:UserssplanerDocumentsPowershellpass.txt | ConvertTo-SecureString
$credentials = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $username, $pass
$session = New-PSSession -ConnectionURI “https://$SBA01/OcsPowershell” -Credential $credentials
Import-PsSession $session
}
default {
Write-Host "You haven’t selected any of the available options."
}
}
} while ($MenuOption -ne 99)
Greetings from Ohio! I’m bored at work so I decided to check out your blog on my iphone during lunch break.
I really like the knowledge you provide here and can’t wait
to take a look when I get home. I’m shocked
at how fast your blog loaded on my mobile .. I’m not even
using WIFI, just 3G .. Anyhow, fantastic site!