Presentation is loading. Please wait.

Presentation is loading. Please wait.

$usercredential= get-credential.

Similar presentations


Presentation on theme: "$usercredential= get-credential."— Presentation transcript:

1

2

3

4

5

6

7

8

9

10

11 $usercredential= get-credential

12 $lyncsession = new-pssession -connectionuri https:// /ocspowershell -credential $usercredential

13 Import-PSSession $lyncsession

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45 Write-EventLog -LogName "Lync Server" -Source "LS Protocol Stack" -EntryType Information - EventId 65020 -Message “Your Message Text Here”

46

47

48

49

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 }

58

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)

60

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

65

66 http://microsoft.com/msdn www.microsoft.com/learning http://channel9.msdn.com/Events/TechEd http://microsoft.com/technet

67

68

69


Download ppt "$usercredential= get-credential."

Similar presentations


Ads by Google