Download presentation
Presentation is loading. Please wait.
11
$usercredential= get-credential
12
$lyncsession = new-pssession -connectionuri https:// /ocspowershell -credential $usercredential
13
Import-PSSession $lyncsession
45
Write-EventLog -LogName "Lync Server" -Source "LS Protocol Stack" -EntryType Information - EventId 65020 -Message “Your Message Text Here”
50
Edge server certificate stores are filling up on Lync 2010 Edges (Server 2008 R2) When this happens service availability is impacted Need a method to monitor this with SCOM Note – this can be done from within Lync in 2013
51
$regkeycount = get-childitem -Path 'HKLM:\software\Microsoft\Cryptography\Services\ RtcSrv\SystemCertificates\Accepted Certificates' | Where-Object -FilterScript {($_.Name -eq "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ Cryptography\Services\RtcSrv\SystemCertificates\ Accepted Certificates\Certificates")}
52
$EventMessage = "There are " +$regkeycount.SubKeyCount+ " certificates in the Accepted Store.” Blue font represents text, red represents variables
53
if ($regkeycount.SubKeyCount -lt 299) { Write Informational Message } Else if ($regkeycount.SubKeyCount -lt 399) { Write Warning Message } Else { Write Error Message } Replace blue text with script blocks containing actual Write-EventLog syntax from next 3 slides
54
if ($regkeycount.SubKeyCount -lt 299) { Write-EventLog -LogName "Lync Server" -Source "LS Protocol Stack" -EntryType Information - EventId 65020 -Message $EventMessage } Assumes $EventMessage is error or information captured from command output
55
elseif ($regkeycount.SubKeyCount -lt 399) { Write-EventLog -LogName "Lync Server" -Source "LS Protocol Stack" -EntryType Warning -EventId 65021 -Message $EventMessage } Assumes $EventMessage is error or information captured from command output
56
Write-EventLog -LogName "Lync Server" -Source "LS Protocol Stack" -EntryType Error -EventId 65022 -Message $EventMessage Assumes $EventMessage is error or information captured from command output
57
#Counts certificates in Accepted Certificates store and writes to event log $regkeycount = get-childitem -Path 'HKLM:\software\Microsoft\Cryptography\Services\RtcSrv\SystemCertificates\Accepted Certificates' | Where-Object - FilterScript {($_.Name -eq "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\Services\RtcSrv\SystemCertificates\Accepted Certificates\Certificates")} if ($regkeycount.SubKeyCount -lt 299) { $EventMessage = "There are " +$regkeycount.SubKeyCount+ " certificates in the Accepted Store. No action is needed." Write-EventLog -LogName "Lync Server" -Source "LS Protocol Stack" -EntryType Information -EventId 65020 -Message $EventMessage } elseif ($regkeycount.SubKeyCount -lt 399) { $EventMessage = "There are " +$regkeycount.SubKeyCount+ " certificates in the Accepted Store. This number is high." Write-EventLog -LogName "Lync Server" -Source "LS Protocol Stack" -EntryType Warning -EventId 65021 -Message $EventMessage } else { $EventMessage = "There are " +$regkeycount.SubKeyCount+ " certificates in the Accepted Store. Please clear the store." Write-EventLog -LogName "Lync Server" -Source "LS Protocol Stack" -EntryType Error -EventId 65022 -Message $EventMessage }
59
Organization is moving to closed federation model Large number of requests are expected to add partner domains Need automated method based on output from SharePoint (coming in CSV)
61
#Get Path and FileName [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") $ofd = New-Object System.Windows.Forms.OpenFileDialog # $ofd.InitialDirectory = $(pwd).path $ofd.InitialDirectory = (Split-Path -Path $MyInvocation.MyCommand.Definition - Parent) #Replace the text in quotes with instructions for the user on what file to select $ofd.title = "Select the CSV containing the list of federated peers" $ofd.ShowHelp=$true if($ofd.ShowDialog() -eq "OK") { $ofd.FileName } $FileName = $ofd.FileName
62
$Feds = import-csv $FileName $transcriptname = "AddNewFederationPartners_" + (Get-Date -Format s).Replace(":","-") +".txt" Start-Transcript $transcriptname
63
foreach ($F in $Feds) { new-csalloweddomain -domain $F.Domain - ProxyFQDN $F.Gateway -comment $F.Comment - verbose } stop-transcript
64
#Import-Module Lync #Get Path and FileName [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") $ofd = New-Object System.Windows.Forms.OpenFileDialog # $ofd.InitialDirectory = $(pwd).path $ofd.InitialDirectory = (Split-Path -Path $MyInvocation.MyCommand.Definition -Parent) #Replace the text in quotes with instructions for the user on what file to select $ofd.title = "Select the CSV containing the list of federated peers" $ofd.ShowHelp=$true if($ofd.ShowDialog() -eq "OK") { $ofd.FileName } $FileName = $ofd.FileName $Feds = import-csv $ofd.FileName $transcriptname = "AddNewFederationPartners_" + (Get-Date -Format s).Replace(":","-") +".txt" Start-Transcript $transcriptname foreach ($F in $Feds) { new-csalloweddomain -domain $F.Domain -ProxyFQDN $F.Gateway -comment $F.Comment -verbose } stop-transcript
66
http://microsoft.com/msdn www.microsoft.com/learning http://channel9.msdn.com/Events/TechEd http://microsoft.com/technet
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.