$usercredential= get-credential.

Slides:



Advertisements
Similar presentations
Chapter 6 Server-side Programming: Java Servlets
Advertisements

Page 1 of 7 Welcome To the Switching Statistics Overview Online Training Course The switching statistic rate measures the net movement of customers from.
Stata and logit recap. Topics Introduction to Stata – Files / directories – Stata syntax – Useful commands / functions Logistic regression analysis with.
Microsoft PowerShell Tom Roeder CS fa. Motivation.NET as a platform shell web server database access Native access to resources eaiser to manage.
James Boother Blog: INTRODUCTION TO POWERSHELL.
IST 221 Internet Concepts and Applications Introduction to PHP.
File Transfer: FTP and TFTP
$UserCredential = Get-Credential $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri " /PowerShell/"
 Support Team Leader with Webteksolutions  Our Primary focus : Office 365 Support Migrations.
1 Action Automated Security Breach Reporting and Corrections.
File Transfer Protocol (FTP)
To the Cloud, from the Trenches: Best Practices for Migrating to Microsoft Office 365 Jorge R. Diaz Microsoft MVP | Exchange Server Architect Planet Technologies.
Shell Programming, or Scripting Shirley Moore CPS 5401 Fall August 29,
WaveMaker Visual AJAX Studio 4.0 Training Troubleshooting.
Orchestrator Use Cases Appalachian State Illinois Andrew Sanders Erik Coleman 1.
1 Operating Systems Lecture 3 Shell Scripts. 2 Shell Programming 1.Shell scripts must be marked as executable: chmod a+x myScript 2. Use # to start a.
8 Shell Programming Mauro Jaskelioff. Introduction Environment variables –How to use and assign them –Your PATH variable Introduction to shell programming.
Chapter 5 Bourne Shells Scripts By C. Shing ITEC Dept Radford University.
BIF703 stdin, stdout, stderr Redirection. stdin, stdout, stderr Recall the Unix philosophy “do one thing well”. Unix has over one thousand commands (utilities)
FTP File Transfer Protocol. Computer Center, CS, NCTU 2 FTP  FTP File Transfer Protocol Used to transfer data from one computer to another over the internet.
Lecture 4  C Shell Scripts(Chapter 10). Shell script/program  Shell script: a series of shell commands placed in an ASCII text file  Commands include.
Shell Programming Any command or a sequence of UNIX commands stored in a text file is called a shell program. It is common to call this file a command.
1 CSE 303 Lecture 5 bash continued: users/groups; permissions; intro to scripting read Linux Pocket Guide pp slides created by Marty Stepp
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
Shell Advanced Features. Module 8 Shell Advanced Features ♦ Introduction In Linux systems, the shells are often referred to as command line interfaces.
PowerShell For SharePoint Developers Neil Iversen Inetium
XP Tutorial 8 Adding Interactivity with ActionScript.
TCP/IP Protocol Suite 1 Chapter 19 Upon completion you will be able to: File Transfer: FTP and TFTP Understand the connections needed for FTP file transfer.
Shell Scripting – Putting it All Together. Agenda Escaping Characters Wildcards Redirecting Output Chaining and Conditional Chaining Unnamed and Named.
IS-907 Java EE World Wide Web - Overview. World Wide Web - History Tim Berners-Lee, CERN, 1990 Enable researchers to share information: Remote Access.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
 An alias is an alternative name assigned to a Cmdlet.  Aliases allow users to quickly interact with the shell.  The Cmdlet get-alias is.
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
Shell Control Statements and More
Agenda Positional Parameters / Continued... Command Substitution Bourne Shell / Bash Shell / Korn Shell Mathematical Expressions Bourne Shell / Bash Shell.
GEO375 Final Project: From Txt to Geocoded Data. Goal My Final project is to automate the process of separating, geocoding and processing 911 data for.
 It is Microsoft's new task-based command- line shell and scripting language designed especially for system administration.  It helps Information Technology.
Sed. Class Issues vSphere Issues – root only until lab 3.
Lab 8 Overview Apache Web Server. SCRIPTS Linux Tricks.
Extending MATLAB Write your own scripts and/or functions Scripts and functions are plain text files with extension.m (m-files) To execute commands contained.
Configuration your environment Many user-configurable Unix programs (such as your shell) read configuration files when they start up. These configuration.
CS241 Systems Programming Discussion Section Week 2 Original slides by: Stephen Kloder.
Top Issues! Top Troubleshooting Voice Issues.
CS241 Systems Programming Discussion Section Week 2 Original slides by: Stephen Kloder.
Unity Application Generator How Can I… Export variables of a Control module with all parameters, modify the some of the parameters like Initial values.
1 Lecture 8 Shell Programming – Control Constructs COP 3353 Introduction to UNIX.
International Electrotechnical Commission Speaker name Title Title Event Date Location.
Bulk Loading Documents* into Windchill
To the Switching Statistics Overview Online Training Course
To the Switching Statistics Overview Online Training Course
CS 330 Class 7 Comments on Exam Programming plan for today:
org.lcsim Recon XML Framework
Overview of SAMT Batch Upload
Introduction to PowerShell
How to Federate with Lync Online
How to add the packages for printing decision trees
3 | Analyzing Server, Network, and Client Health
stdin, stdout, stderr Redirection
Lecture Note Set 1 Thursday 12-May-05
Install DoD CA Certificate Instructions for Chrome
File Transfer: FTP Objectives Chapter 19
Python Lessons 13 & 14 Mr. Kalmes.
More advanced BASH usage
The National Reference Metadata Editor (NRME)
Stata Basic Course Lab 2.
Chapter 5 Bourne Shells Scripts
CSCE 206 Lab Structured Programming in C
4.4 – List vs Array Exercise 4.1: Array Variables
The National Reference Metadata Editor (NRME)
Presentation transcript:

$usercredential= get-credential

$lyncsession = new-pssession -connectionuri /ocspowershell -credential $usercredential

Import-PSSession $lyncsession

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

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

$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")}

$EventMessage = "There are " +$regkeycount.SubKeyCount+ " certificates in the Accepted Store.” Blue font represents text, red represents variables

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

if ($regkeycount.SubKeyCount -lt 299) { Write-EventLog -LogName "Lync Server" -Source "LS Protocol Stack" -EntryType Information - EventId Message $EventMessage } Assumes $EventMessage is error or information captured from command output

elseif ($regkeycount.SubKeyCount -lt 399) { Write-EventLog -LogName "Lync Server" -Source "LS Protocol Stack" -EntryType Warning -EventId Message $EventMessage } Assumes $EventMessage is error or information captured from command output

Write-EventLog -LogName "Lync Server" -Source "LS Protocol Stack" -EntryType Error -EventId Message $EventMessage Assumes $EventMessage is error or information captured from command output

#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 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 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 Message $EventMessage }

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)

#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 $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

#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