Here I am again with another Script. This time I have tried to simplify the log collection with via PowerShell. It allows you to leverage the power of CLS logging without having to install the Debugging Tools for either Lync or Skype for Business. Also, it simplifies the complex Cmdlet by only requiring 3 switches. Scenario, Pools, OutputFolderPath.
The nice thing about this is that you don’t have to remember what time you started and stopped the logging and how to get the output. Sometimes the Search-CsClsLogging cmdlet is confusing. What LogLevel, do I MatchAll or MatchAny, etc. The script uses the basic settings to get the data you need. Now, I will say that this script doesn’t handle all of the possibilities of gathering CLS Logging, but it will allow you to get logging against a pool or multiple pools for a scenario easier than running the cmdlets manually.
Well, Lets get to it.
Let us say that you need to get some SIP logging to find out why a federated partner cannot get your IMs. For this I would use the ImAndPresence scenario. (If you need to find the correct scenario, see my blog on Listing CLS Scenarios in HTML. If you need a custom scenario, see my blog on Creating Custom CLS Scenarios.) This scenario gets the SipStack and UserServices component. Then we need to think about the environment. I will presume you know which pool the user homed on that is having the issue. For this example, I will use KI-Sfb-FE’s FQDN and the KI-Edge FQDN since my test user is homed on this FE and will go through this Edge for federation.
The syntax that I would use is:
.\Collect-CsClsLogging.ps1 -Scenario ImAndPresence -Pools ki-sfb-fe.kaosupport.info,ki-edge.kaosupport.info -OutputFolderPath c:\temp
If the OutputFolderPath doesn’t exist, it will ask you if you wish to create the path or not.
If you choose “No” then the script will stop, so I am going presume that you selected “Yes”
Next, it will contact the agents to start the logging and notify you when you you can start to Repro your issue. (Note: The screenshots I am showing you are from Skype for Business PowerShell. Lync 2013 PowerShell will be slightly Different.)
So LyncTest1@kaosupport.info tries to send an IM to the federated contact…wait for the failure to show in the client (or what ever error you are trying to repro). When the Repro is complete, hit the enter key in the PowerShell window to stop the logging and create the output file.
Note the path and filename. When you browse out to that folder, if you have Snooper installed, you simply have to double click on the file to start your analysis. Or, you can upload the files to your support engineer for them to analyze the data, but as far as gathering the logs, that is it.
The nice part about this is if you have to repro this several times because something went wrong, you can just hit the up arrow in PowerShell and re-run the script and it will adjust the start and stop times automatically. This way, you know you captured the data for the correct time frame without going over or under.
- Windows PowerShell 3.0
- Must be run from a Front End server
- This is needed because the CLS .Net assemblies have to be available and are only available on front end servers (From what I have found)
- Lync/Skype on premises administrator with RTCUniversalServerAdmins, CsServerAdministrator, or CsAdministrator rights.
- This is required by the Lync/Skype Cmdlets to collect CLS Scenarios without throwing access errors.
- PowerShell opened in “Run as Administrator” mode
- This is required by the script Cmdlets to gather the correct information without throwing access errors.