<# .Synopsis Documentation script for Lync 2013 / Skype for Business .DESCRIPTION A script to gather certain infromation from your Lync 2013 / Skype for Business installation. The script has only been run and testet on single site/pool installations, so use caution when trying to do otherwise. --------------------------------------------------- Created by Lasse Nordvik Wedø - All rights reserved --------------------------------------------------- .notes - This script is for both Enterprise and Standard Edition Server. - The script has only been run and testet on single site/pool installations, so use caution when trying to do otherwise. - The script should be able to run without any modification. - The script must be run on a server where Lync PS is available. - If the script must be run in a PS3 environment, and will load all nessecary modules automatically - I highly recommend you test the script in your Lab, before running in your production environment V 1.2 - September 2012 - Added details to the service configuration V 1.3 - February 2012 - Mainor changes to layout and information v 2.0 - September 2013 - Major update to colorthemes and output formats. Also added Persistent Chat objects and topology gathering. v 2.1 - December 2013 - Fixed NSLOOKUP section, to handle pools and not just single servers v 2.2 - December 2013 - Minor fixup, mainly cosmetic, changed default output location to the same as other documentationscripts I have created. It is now "C:\Lync Documentation". Change this by using -path parameter. v 2.3 - April 2015 - BUGFIX: NSLOOKUP now provides hostnames as well as pool names - New feature: List of users now sorts by assigned domain - New feature: List of domains shows usercount - New feature: List EXT as a seperate column - CHANGE: No longer leaving all files in the folder. Zipping to a target, then deleting clutter. - New feature: KEEPTemp switch to avoid deleting - BUGFIX: Added CsMeetingRoom - Tested on a Skype for Business Server (VIS server information NOT verified) - Change: New colors v 2.4 - May 2015 - Cleanup: Better code for HTML generation - Cleanup: Better IP address documentation - Cleanup: Better Service dump (ignoring blank services) - New feature: Adding software version on servers the script can connect to (Requires WinRM, firewall and rigths on target computer), can take some time - New feature: Send documentation in email on complete .Link Twitter: http://www.twitter.com/lawedo Website: http://uc.lawedo.net Facebook: http://www.facebook.com/Tech.at.work LinkedIn: http://www.linkedin.com/in/lawedo http://gallery.technet.microsoft.com/Document-you-Lync-2013-154f4050 http://uc.lawedo.net/search/label/Get-csdocumentation .EXAMPLE .\get-csdocumentation.ps1 .EXAMPLE .\get-csdocumentation.ps1 -path "c:\My location" Use the -path to alter the default location from "C:\Lync Documentation" .EXAMPLE .\get-csdocumentation.ps1 -KEEPTemp Use -KEEPTemp to keep files in -path. Files will still be zipped, but clutter is not removed. .parameter path Use this parameter to change the output location from the default of: "C:\Lync Documentation" .parameter KEEPTemp Use this to keep the clutter in the path directory .Parameter SendEmailOnComplete This is a switch Use this to send an email to get notified on completion .Parameter EmailFrom This is a mandatroy string when SendEmailOnComplete is invoked This will be the "from" email address .Parameter EmailTo This is a mandatroy string when SendEmailOnComplete is invoked This will be the "to" email address .Parameter SMTPServer This is a mandatroy string when SendEmailOnComplete is invoked This is the host (ip or fqdn) of the smtp server you want send through #> param ( [Parameter(ParameterSetName="set1", Mandatory=$false)][Parameter(ParameterSetName="set2", Mandatory=$false)][string]$Path = "C:\Lync Documentation", [Parameter(ParameterSetName="set1", Mandatory=$false)][Parameter(ParameterSetName="set2", Mandatory=$false)][switch]$KEEPTemp, [Parameter(ParameterSetName="set2", Mandatory=$False)][switch]$SendEmailOnComplete, [Parameter(ParameterSetName="set2", Mandatory=$True)][string]$EmailFrom, [Parameter(ParameterSetName="set2", Mandatory=$True)][string]$EmailTo, [Parameter(ParameterSetName="set2", Mandatory=$True)][string]$SMTPServer ) function HTML-Header{ [CmdletBinding(SupportsShouldProcess=$True)] param ( [Parameter(Mandatory=$True,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True)]$Title ) $HTMLheader = @" $Title "@ $HTMLheader } function HTML-End{ $HTMLend = @" "@ $HTMLend } function cleanup-run{ [CmdletBinding()] Param() if(!(Test-Path -Path $filepath)){ Write-Output "$filepath not found, nothing to delete" } Else{ Get-ChildItem $filepath -recurse | Remove-Item -force -Recurse | Out-Null } } function ZipFiles( $zipfilename, $sourcedir ){ if(!(Test-Path -Path $backupfile10)){ Write-Output "$backupfile10 not found, nothing to delete" } Else{ Remove-Item $backupfile10 -force -Recurse | Out-Null } [Reflection.Assembly]::LoadWithPartialName("System.IO.Compression.FileSystem") $compressionLevel = [System.IO.Compression.CompressionLevel]::Optimal [System.IO.Compression.ZipFile]::CreateFromDirectory($sourcedir,$zipfilename, $compressionLevel, $false) } function get-pools { [CmdletBinding(SupportsShouldProcess=$True)] param ( [Parameter(Mandatory=$True,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True)]$CollectionPool ) $LocalServer = Get-WmiObject -Class Win32_ComputerSystem $fqdnLocalServer = “{0}.{1}” -f $LocalServer.Name.ToLower(), $LocalServer.Domain.ToLower() $myCsServices = @(Get-CsService | Where-Object {$_.version -ge 5}) $myCsPools =@() foreach ($service in $myCsServices){ if ($CollectionPool -icontains $service.role) { $myCsPools += $service.PoolFqdn.ToLower() } } $myCsPools = $myCsPools | select -Unique $myCsPools } function get-machine { [CmdletBinding(SupportsShouldProcess=$True)] param ( [Parameter(Mandatory=$True,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True)]$CollectionPuter ) $myCsComputers = @() foreach ($pool in $CollectionPuter){ $poolComp = get-cspool -Identity $pool | Select-Object computers $poolComps = $poolComp.computers.split(",") $poolComps = $poolComps.ToLower() $myCsComputers +=$poolComps} $myCsComputers } function get-Version { [CmdletBinding(SupportsShouldProcess=$True)] param ( [Parameter(Mandatory=$True,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True)]$CollectfromServer ) foreach ($puter in $CollectfromServer){ if(!(Test-WSMan -ComputerName $puter -ErrorAction SilentlyContinue)){ "

$puter not reachable. PLS check WinRM, firewall or access rights on target

" | Out-File $file8 -append } Else { Write-Host "Trying to run query on remote station: $puter" -ForegroundColor Green if ($puter -eq $fqdnLocalServer){ "

Software versions found on $puter

" | Out-File $file8 -append Get-WmiObject –query ‘select * from win32_product’ | where {$_.name -like “Microsoft Lync Server*” -or $_.name -like "Skype for Business Server*"} |select-object Name,Version| sort-object Name| ConvertTo-HTML -fragment | Out-File $file8 -append } Else { "

Software versions found on $puter

" | Out-File $file8 -append $info = Invoke-Command -ComputerName $puter -ScriptBlock {Get-WmiObject –query ‘select * from win32_product’ | where {$_.name -like “Microsoft Lync Server*” -or $_.name -like "Skype for Business Server*"}} $info|select-object Name,Version| sort-object name| ConvertTo-HTML -fragment | Out-File $file8 -append} } } } function send_email { $server = Hostname $EmailSubject = (".\get-csdocumentation.ps1 was run and completed at " + (Get-Date -format yyyy-MM-dd-HH:mm:ss)) $mailmessage = New-Object system.net.mail.mailmessage $mailmessage.from = ($EmailFrom) $mailmessage.To.add($EmailTo) $mailmessage.Subject = $EmailSubject $attachment = New-Object System.Net.Mail.Attachment($attachFile, 'text/plain') $mailmessage.Attachments.Add($attachment) $mailmessage.Body = ("This is an automated email sent from $server The get-csdocumentation.ps1 has completed, and the documentation has been zipped to the following file: $attachFile on $server Please examine the attached copy. Thank you for using this script! @lawedo / http://uc.lawedo.net") $SMTPClient = New-Object Net.Mail.SmtpClient($SMTPServer, 25) $SMTPClient.Send($mailmessage) } Write-host "Running documentation script by Lasse Nordvik Wedø" -Foregroundcolor Green write-host "This script is not gathering everything, but rather information it's creator has found useful for documentation purposes" -Foregroundcolor Green <# Creating files and folders for output #> $date = Get-Date -DisplayHint Date $date2 = Get-Date -Format dd-MM-yyyy $filepath = $Path + "\" cleanup-run $startpath = (Get-Variable PWD).Value $startpath = $startpath.Path.ToLower() New-Item $filepath -type directory -force |Out-Null $file = $filepath + $date2 + "_Doc_01_Global_configuration.htm" $file1 = $filepath + $date2 + "_Doc_03_User_information.htm" $file2 = $filepath + $date2 + "_Doc_05_Service_information.htm" $file3 = $filepath + $date2 + "_Doc_04_Voice_information.htm" $file4 = $filepath + $date2 + "_Doc_02_Remote_information.htm" $file5 = $filepath + $date2 + "_Doc_06_Application_information.htm" $file6 = $filepath + $date2 + "_Doc_07_Network_information.htm" $file7 = $filepath + $date2 + "_Doc_08_Assigned_numbers.htm" $file8 = $filepath + $date2 + "_Doc_09_Additional_Server_Information.htm" $backupfile1 = $filepath + $date2 + "_File_CsConfiguration.zip" $backupfile11 = $filepath + $date2 + "_File_Documentation.zip" $backupfile12 = $filepath + $date2 + "_File_Topology.xml" $backupfile2 = $filepath + $date2 + "_File_CsLISconfiguration.bak" $backupfile4 = $filepath + $date2 + "_File_DialPlan.xml" $backupfile5 = $filepath + $date2 + "_File_VoicePolicy.xml" $backupfile6 = $filepath + $date2 + "_File_VoiceRoute.xml" $backupfile7 = $filepath + $date2 + "_File_PSTNUsage.xml" $backupfile8 = $filepath + $date2 + "_File_VoiceConfiguration.xml" $backupfile9 = $filepath + $date2 + "_File_TrunkConfiguration.xml" $backupfile10 = $env:temp + "\Documentation_set_" + $date2 +".zip" Write-host ("Script started at: " + $date) -Foregroundcolor Yellow <# Creating minibackup of systemconfiguration#> export-csconfiguration -filename $backupfile1 Get-CsDialPlan | Export-Clixml -path $backupfile4 Get-CsVoicePolicy | Export-Clixml -path $backupfile5 Get-CsVoiceRoute | Export-Clixml -path $backupfile6 Get-CsPstnUsage | Export-Clixml -path $backupfile7 Get-CsVoiceConfiguration | Export-Clixml -path $backupfile8 Get-CsTrunkConfiguration | Export-Clixml -path $backupfile9 (Get-CsTopology -AsXml).ToString() > $backupfile12 export-cslisconfiguration -filename $backupfile2 <# Building HTML Construct for HTM Files #> HTML-Header "Global Configuration File" | Out-File $file HTML-Header "User Information File" | Out-File $file1 HTML-Header "Service Configuration File" | Out-File $file2 HTML-Header "Voice Configuration File" | Out-File $file3 HTML-Header "Remote Configuration" | Out-File $file4 HTML-Header "RGS Configuration" | Out-File $file5 HTML-Header "Network Configuration" | Out-File $file6 HTML-Header "User information and Assigned Numbers" | Out-File $file7 HTML-Header "Additional server information" | Out-File $file8 <# Global Basic info #> "

Global Configuration as of $date

" | Out-File $file -append "

Some general information

" | Out-File $file -append "
Domain, Forest and Schema state
" | Out-File $file -append Get-CsAdDomain| Out-File $file -append "
" | Out-File $file -append Get-CsAdForest| Out-File $file -append "
" | Out-File $file -append Get-CsAdServerSchema | Out-File $file -append "
" | Out-File $file -append "
" | Out-File $file -append "
Server version
" | Out-File $file -append Get-CsServerVersion | Out-File $file -append "
" | Out-File $file -append "

Sip Domains

" | Out-File $file -append $domainlist = Get-CsSipDomain foreach ($dOmain in $domainlist) { $toSearch = "*@" + $dOmain.Name $userCount = (get-csuser -Filter {sipaddress -like $toSearch}).count $dOmain | Add-Member -MemberType NoteProperty -Name "NumberofUsers" -Value $userCount} $domainlist| Select-Object Identity,Name,IsDefault,NumberofUsers|Sort-Object Name | ConvertTo-HTML -fragment | Out-File $file -append "

Following Sites are configured

" | Out-File $file -append Get-CsSite | Select-Object Identity,Siteid,displayname,sitetype,parentsite | ConvertTo-HTML -fragment | Out-File $file -append "

Following Pools are configured

" | Out-File $file -append Get-CsPool| Select-Object fqdn,site | ConvertTo-HTML -fragment | Out-File $file -append "

Following ipaddresses were discovered using Nslookup

" | Out-File $file -append $ipCollection = ($coll = Get-CsService | select role) $ipCollection = $ipCollection.role $ipQueryPool = get-pools $ipCollection foreach ($ippool in $ipQueryPool){ "" | Out-File $file -append $ipQueryComputers = get-machine $ippool foreach ($x in $ipQueryComputers){ $finalIP = [System.Net.Dns]::GetHostByName("$x") $ipValue = $finalIP.AddressList.IPAddressToString "" | Out-File $file -append } "
PoolComputerAddress Table
" | Out-File $file -append $ippool | Out-File $file -append "" | Out-File $file -append $x | Out-File $file -append "" | Out-File $file -append $ipValue | Out-File $file -append "
" | Out-File $file -append "
" | Out-File $file -append } "

Address Book Configuration

" | Out-File $file -append Get-CsAddressBookConfiguration | select-object identity,RunTimeOfDay,KeepDuration,SynchronizePollingInterval,MaxDeltaFileSizePercentage,UseNormalizationRules,IgnoreGenericRules,EnableFileGeneration | ConvertTo-HTML -fragment | Out-File $file -append "

Media Configuration Information

" | Out-File $file -append Get-CsMediaConfiguration |Select-Object Identity,EnableQoS,EncryptionLevel,EnableSiren,MaxVideoRateAllowed,EnableG722StereoCodec,EnableH264Codec,EnableAdaptiveBandWidthEstimation |ConvertTo-HTML -fragment | Out-File $file -append "

Configured adminroles

" | Out-File $file -append Get-CsAdminRole | sort -property identity | Select-Object identity,isstandardrole,templatename | ConvertTo-HTML -fragment | Out-File $file -append "

Archiving configuration

" | Out-File $file -append "

Configuration

" | Out-File $file -append Get-CsArchivingConfiguration | select-object identity,enablearchiving,enablepurging,purgeexportedarchivesonly,blockonarchivefailure,keeparchivingdatafordays,purgehourofday,archiveduplicatemessages | ConvertTo-HTML -fragment | Out-File $file -append "

Policy

" | Out-File $file -append Get-CsArchivingPolicy |select-object identity,description,archiveinternal,archiveexternal,scopeclass| ConvertTo-HTML -fragment | Out-File $file -append "" | Out-File $file -append "" | Out-File $file -append <# Edge and MCX Configuration #> "

Remote Access / Edge / MCX as of $date

" | Out-File $file4 -append "

Access Edge Configuration

" | Out-File $file4 -append ""| Out-File $file4 -append $Aec = Get-CsAccessEdgeConfiguration foreach ($AecX in $Aec){ ""| Out-File $file4 -append} "
Access Edge Configuration
"| Out-File $file4 -append Get-CsAccessEdgeConfiguration -Identity $AecX.identity| ConvertTo-HTML -fragment -as list | Out-File $file4 -append "
"| Out-File $file4 -append "

AV Edge Configuration

" | Out-File $file4 -append ""| Out-File $file4 -append ""| Out-File $file4 -append "
AV Edge Configuration
"| Out-File $file4 -append Get-CsAVEdgeConfiguration | Select-Object Identity,MaxTokenLifetime,MaxBandwidthPerUserKb,MaxBandwidthPerPortKb,ScopeClass | ConvertTo-HTML -fragment -as list | Out-File $file4 -append "
"| Out-File $file4 -append "

Allowed Domain

" | Out-File $file4 -append get-CsAllowedDomain | Select-Object Identity, domain, comment | ConvertTo-HTML -fragment | Out-File $file4 -append "

Blocked Domain

" | Out-File $file4 -append Get-CsBlockedDomain | Select-Object Identity, domain, comment | ConvertTo-HTML -fragment | Out-File $file4 -append "

Public providers and Hosting providers

" | Out-File $file4 -append Get-CsPublicProvider | select-object identity, name, enabled, proxyfqdn | ConvertTo-HTML -fragment | Out-File $file4 -append "
" | Out-File $file4 -append Get-CsHostingProvider | select-object identity, name, enabled, proxyfqdn | ConvertTo-HTML -fragment | Out-File $file4 -append "

Public Push Notifications

" | Out-File $file4 -append Get-CsPushNotificationConfiguration| Select-Object Identity,EnableApplePushNotificationService,EnableMicrosoftPushNotificationService,ScopeClass | ConvertTo-HTML -fragment | Out-File $file4 -append "

External Access policies

" | Out-File $file4 -append Get-CsExternalAccessPolicy | sort -property identity | select-object identity,EnableFederationAccess,EnablePublicCloudAccess,EnablePublicCloudAudioVideoAccess,EnableOutsideAccess | ConvertTo-HTML -fragment | Out-File $file4 -append "

MCX Configuration

" | Out-File $file4 -append ""| Out-File $file4 -append ""| Out-File $file4 -append "
MCX Configuration
"| Out-File $file4 -append Get-CsMcxConfiguration| Select-Object Identity,SessionExpirationInterval,SessionShortExpirationInterval,ExposedWebURL,PushNotificationProxyUri,ScopeClass | ConvertTo-HTML -as list -fragment | Out-File $file4 -append "
"| Out-File $file4 -append "

Mobility policies

" | Out-File $file4 -append ""| Out-File $file4 -append $MobPol = Get-CsMobilityPolicy foreach ($MobPolX in $MobPol){ ""| Out-File $file4 -append} "
Mobility policies
"| Out-File $file4 -append Get-CsMobilityPolicy -Identity $MobPolX.identity| Select-Object Identity,Description,EnableOutsideVoice,EnableMobility,EnableIPAudioVideo,RequireWIFIForIPAudio,RequireWIFIForIPVideo,AllowCustomerExperienceImprovementProgram,RequireWiFiForSharing,AllowSaveCallLogs,AllowExchangeConnectivity,AllowSaveIMHistory,AllowSaveCredentials,ScopeClass| ConvertTo-HTML -fragment -as List | Out-File $file4 -append "
"| Out-File $file4 -append "

Im filter configuration

" | Out-File $file4 -append get-csimfilterconfiguration | sort -property identity | select-object identity,allowmessage,warnmessage,enabled,ignorelocal,blockfileextension | ConvertTo-HTML -fragment |Out-File $file4 -append "

File filter configuration

" | Out-File $file4 -append Get-CsFileTransferFilterConfiguration | select-object identity, enabled, action | ConvertTo-HTML -fragment | Out-File $file4 -append "" | Out-File $file4 -append "" | Out-File $file4 -append <#Service Dump#> "

Service information as of $date

" | Out-File $file2 -append Foreach ($servicePool in $ipCollection){ $servicePoolEntry = Get-CsService |Where-Object {$_.Role -ilike $servicePool } | Select-Object Serviceid,poolfqdn,siteid,version,role,*Database*,filestore,*instance* $servicePoolEntryRole = $servicePoolEntry.Role "

$servicePoolEntryRole

" | Out-File $file2 -append $servicePoolEntry|ConvertTo-HTML -fragment | Out-File $file2 -append} "

Web service Information

" | Out-File $file2 -append "" | Out-File $file2 -append "
WebService
" | Out-File $file2 -Append Get-CsWebServiceConfiguration | Select-Object Identity,TrustedCACerts,CrossDomainAuthorizationList,MaxGroupSizeToExpand,EnableGroupExpansion,UseWindowsAuth,UseCertificateAuth,UsePinAuth,AllowAnonymousAccessToLWAConference,EnableCertChainDownload,InferCertChainFromSSL,CASigningKeyLength,MaxCSRKeySize,MinCSRKeySize,MaxValidityPeriodHours,MinValidityPeriodHours,DefaultValidityPeriodHours,MACResolverUrl,SecondaryLocationSourceUrl,ShowJoinUsingLegacyClientLink,ShowDownloadCommunicatorAttendeeLink,AutoLaunchLyncWebAccess,ShowAlternateJoinOptionsExpanded,UseWsFedPassiveAuth,WsFedPassiveMetadataUri,AllowExternalAuthentication,ScopeClass | ConvertTo-HTML -as list -fragment | Out-File $file2 -append "
" | Out-File $file2 -Append "

User service Information

" | Out-File $file2 -append "" | Out-File $file2 -append "
UserService
" | Out-File $file2 -Append Get-CsUserServicesConfiguration| Select-Object identity,PresenceProviders,MaintenanceTimeOfDay,MinSubscriptionExpiration,MaxSubscriptionExpiration,DefaultSubscriptionExpiration,AnonymousUserGracePeriod,DeactivationGracePeriod,MaxScheduledMeetingsPerOrganizer,MaxSubscriptions,MaxContacts,MaxPersonalNotes,SubscribeToCollapsedDG,ScopeClass | ConvertTo-HTML -as list -fragment | Out-File $file2 -append "
" | Out-File $file2 -Append "" | Out-File $file2 -append "
WebService
" | Out-File $file2 -Append Get-CsService -webserver | ConvertTo-HTML -as list -fragment | Out-File $file2 -append "
" | Out-File $file2 -Append "

Edge service

" | Out-File $file2 -append "" | Out-File $file2 -append "
EdgeService
" | Out-File $file2 -Append Get-CsService -EdgeServer | ConvertTo-HTML -as list -fragment | Out-File $file2 -append "
" | Out-File $file2 -Append "

CDR information

" | Out-File $file2 -append "" | Out-File $file2 -append "
CDR
" | Out-File $file2 -Append Get-CsCdrConfiguration | Select-Object identity,EnableCDR,EnablePurging,KeepCallDetailForDays,KeepErrorReportForDays,PurgeHourOfDay,ScopeClass | ConvertTo-HTML -as list -fragment | Out-File $file2 -append "
" | Out-File $file2 -Append "

QOE information

" | Out-File $file2 -append "" | Out-File $file2 -append "
QOE
" | Out-File $file2 -Append Get-CsQoEConfiguration | Select-Object identity,ExternalConsumerIssuedCertId,EnablePurging,KeepQoEDataForDays,PurgeHourOfDay,EnableExternalConsumer,ExternalConsumerName,ExternalConsumerURL,EnableQoE,ScopeClass | ConvertTo-HTML -as list -fragment | Out-File $file2 -append "
" | Out-File $file2 -Append "

Server Application Overview

" | Out-File $file2 -append Get-CsServerApplication | Select-Object Name,priority,enabled,critical,scriptname| ConvertTo-HTML -fragment | Out-File $file2 -append "" | Out-File $file2 -append "" | Out-File $file2 -append <# User information #> "

User information as of $date

" | Out-File $file1 -append $Showcounter = 0 function countmy-users { $counting = 0 foreach ($sipaddress in (get-csuser -filter {enabled -eq $True})) { $counting++ } write-output $counting } $Showcounter += countmy-users "" | Out-File $file1 -append "" | Out-File $file1 -append "
Number of users
" | Out-File $file1 -append "There are $Showcounter users enabled for sip in the system" | Out-File $file1 -append "
" | Out-File $file1 -append $ShowcounterX = 0 function countmy-usersX { $counting = 0 foreach ($lineuri in (Get-CsUser -filter {EnterpriseVoiceEnabled -eq $true})) { $counting++ } write-output $counting } $ShowcounterX += countmy-usersX "Of the $Showcounter users, $ShowcounterX are enabled for Enterprise Voice" | Out-File $file1 -append "
" | Out-File $file1 -append "

Pin Policies

" | Out-File $file1 -append $pinPol = Get-CsPinPolicy | Select-Object identity,description,Minpasswordlength,pinhistorycount,allowcommonpatterns,pinlifetime,maximumlogonattempts,scopeclass foreach ($pinPolX in $pinPol) { "
Policy
" | Out-File $file1 -append $pinPolX | ConvertTo-HTML -fragment -as list| Out-File $file1 -append "
" | Out-File $file1 -append } "

Meeting configuration

" | Out-File $file1 -append $meetPol = Get-CsMeetingConfiguration | Select-Object identity,AdmitAnonymousUsersByDefault,AssignedConferenceTypeByDefault,CustomFooterText,DesignateAsPresenter,EnableAssignedConferenceType,HelpURL,LegalURL,LogoURL,PstnCallersBypassLobby,RequireRoomSystemsAuthorization foreach ($meetPolX in $meetPol) { "
Policy
" | Out-File $file1 -append $meetPolX | ConvertTo-HTML -fragment -as list| Out-File $file1 -append "
" | Out-File $file1 -append } "

Client version configuration

" | Out-File $file1 -append Get-CsClientVersionConfiguration | Select-Object DefaultAction,DefaultURL,Enabled,ScopeClass | ConvertTo-HTML -fragment | Out-File $file1 -append "

Client version policy

" | Out-File $file1 -append Get-CsClientVersionPolicy | select-object Identity,ScopeClass,description | ConvertTo-HTML -fragment | Out-File $file1 -append "

Client version policy rules

" | Out-File $file1 -append Get-CsClientVersionPolicyRule | select-object Priority,Description,Action,ActionUrl,MajorVersion,MinorVersion,BuildNumber,QfeNumber,UserAgent,UserAgentFullName,Enabled,CompareOp | ConvertTo-HTML -fragment | Out-File $file1 -append "

A list of client polices

" | Out-File $file1 -append "Run get-cspolicy -identity %identity% to see the full output of these policies" | Out-File $file1 -append $cliPol = Get-CsClientpolicy | Select-Object Identity,Description,AddressBookAvailability,AttendantSafeTransfer,AutoDiscoveryRetryInterval,BlockConversationFromFederatedContacts,CalendarStatePublicationInterval,ConferenceIMIdleTimeout,CustomizedHelpUrl,CustomLinkInErrorMessages,CustomStateUrl,DGRefreshInterval,DisableCalendarPresence,DisableContactCardOrganizationTab,DisableEmailComparisonCheck,DisableEmoticons,DisableFeedsTab,DisableFederatedPromptDisplayName,DisableFreeBusyInfo,DisableHandsetOnLockedMachine,DisableMeetingSubjectAndLocation,DisableHtmlIm,DisableInkIM,DisableOneNote12Integration,DisableOnlineContextualSearch,DisablePhonePresence,DisablePICPromptDisplayName,DisablePoorDeviceWarnings,DisablePoorNetworkWarnings,DisablePresenceNote,DisableRTFIM,DisableSavingIM,DisplayPhoto,EnableAppearOffline,EnableCallLogAutoArchiving,EnableClientMusicOnHold,EnableConversationWindowTabs,EnableEnterpriseCustomizedHelp,EnableEventLogging,EnableExchangeContactSync,EnableExchangeDelegateSync,EnableFullScreenVideo,EnableHotdesking,EnableIMAutoArchiving,EnableMediaRedirection,EnableNotificationForNewSubscribers,EnableSQMData,EnableTracing,EnableURL,EnableUnencryptedFileTransfer,EnableVOIPCallDefault,ExcludedContactFolders,HotdeskingTimeout,IMWarning,MAPIPollInterval,MaximumDGsAllowedInContactList,MaximumNumberOfContacts,MaxPhotoSizeKB,MusicOnHoldAudioFile,P2PAppSharingEncryption,EnableHighPerformanceP2PAppSharing,PlayAbbreviatedDialTone,SearchPrefixFlags,ShowRecentContacts,ShowManagePrivacyRelationships,ShowSharepointPhotoEditLink,SPSearchInternalURL,SPSearchExternalURL,SPSearchCenterInternalURL,SPSearchCenterExternalURL,TabURL,TracingLevel,WebServicePollInterval,HelpEnvironment,ScopeClass foreach ($cliPolX in $cliPol) { "
Policy
" | Out-File $file1 -append $cliPolX | ConvertTo-HTML -fragment -as list| Out-File $file1 -append "
" | Out-File $file1 -append } "" | Out-File $file1 -append "" | Out-File $file1 -append <# Voice information #> $Showcounter = 0 function countmy-users { $counting = 0 foreach ($lineuri in (Get-CsUser -filter {EnterpriseVoiceEnabled -eq $true})) { $counting++ } write-output $counting } $Showcounter += countmy-users "

Voice information as of $date

" | Out-File $file3 -append "

Showing the number of voice enabled objects in the system

" | Out-File $file3 -append "
User summary
" | Out-File $file3 -append "There are $Showcounter users with a primary LineURI" | Out-File $file3 -append $Showcounter = 0 function countmy-users { $counting = 0 foreach ($privateline in (get-csuser -Filter {privateline -ne $Null})) { $counting++ } write-output $counting } $Showcounter += countmy-users "
" | Out-File $file3 -append "There are $Showcounter users with a private line" | Out-File $file3 -append $Showcounter = 0 function countmy-users { $counting = 0 foreach ($LineURI in Get-CsAnalogDevice) { $counting++ } write-output $counting } $Showcounter += countmy-users "
" | Out-File $file3 -append "There are $Showcounter analog devices" | Out-File $file3 -append $Showcounter = 0 function countmy-users { $counting = 0 foreach ($LineURI in Get-CsCommonAreaPhone) { $counting++ } write-output $counting } $Showcounter += countmy-users "
" | Out-File $file3 -append "There are $Showcounter common area phones devices" | Out-File $file3 -append $Showcounter = 0 function countmy-users { $counting = 0 foreach ($LineURI in Get-CsRgsWorkflow) { $counting++ } write-output $counting } $Showcounter += countmy-users "
" | Out-File $file3 -append "There are $Showcounter RGS workflows with a LineURI" | Out-File $file3 -append $Showcounter = 0 function countmy-users { $counting = 0 foreach ($LineURI in Get-CsDialInConferencingAccessNumber) { $counting++ } write-output $counting } $Showcounter += countmy-users "
" | Out-File $file3 -append "There are $Showcounter dialin access numbers" | Out-File $file3 -append $Showcounter = 0 function countmy-users { $counting = 0 foreach ($LineURI in Get-CsExUmContact) { $counting++ } write-output $counting } $Showcounter += countmy-users "
" | Out-File $file3 -append "There are $Showcounter Exchange objects" | Out-File $file3 -append $Showcounter = 0 function countmy-users { $counting = 0 foreach ($LineURI in Get-CsTrustedApplicationEndpoint) { $counting++ } write-output $counting } $Showcounter += countmy-users "
" | Out-File $file3 -append "There are $Showcounter trusted apllication endpoints with a LineURI" | Out-File $file3 -append "
" | Out-File $file3 -append "

Routing information

" | Out-File $file3 -append Get-CsVoiceRoute | select-object Identity,Priority,Description,NumberPattern,Name,SuppressCallerId,AlternateCallerId| ConvertTo-HTML -fragment | Out-File $file3 -append "

Normalization rules

" | Out-File $file3 -append Get-CsVoiceNormalizationRule | Select-Object Identity,Priority,Description,Pattern,Translation,Name,IsInternalExtension | ConvertTo-HTML -fragment | Out-File $file3 -append "

Voice policies

" | Out-File $file3 -append Get-CsVoicePolicy| sort -Property Identity | select-object identity,Allowsimulring,allowcallforwarding,allowpstnrerouting,enabledelegation,enableteamcall,enablecalltransfer,enablecallpark | ConvertTo-HTML -fragment | Out-File $file3 -append "

PSTN Usages

" | Out-File $file3 -append $Showcounter = 0 function countmy-users { $counting = 0 foreach ($Identity in Get-CsPstnUsage) { $counting++ } write-output $counting } $Showcounter += countmy-users "" | Out-File $file3 -append $PsTn = Get-CsPstnUsage foreach ($PsTnX in $PsTn) { $PsTnXId = $PsTnX.identity $PsTnXUs = $PsTnX.usage ""| Out-File $file3 -Append } "
PSTN UsagesThere are $Showcounter PSTN usages configured
$PsTnXId$PsTnXUs
" | Out-File $file3 -Append "

PSTN Dialplans

" | Out-File $file3 -append Get-CsDialPlan | select-object Identity,Description,DialinConferencingRegion,CountryCode,State,City,ExternalAccessPrefix,SimpleName,OptimizeDeviceDialing,ScopeClass | ConvertTo-HTML -fragment | Out-File $file3 -append "

Translation rules

" | Out-File $file3 -append Get-CsOutboundTranslationRule | Select-Object Identity,Priority,Description,Pattern,Translation,Name | ConvertTo-HTML -fragment | Out-File $file3 -append "

Trunks

" | Out-File $file3 -append "" | Out-File $file3 -append "
Trunks
" | Out-File $file3 -Append $trunks = Get-CsTrunkConfiguration foreach ($TC in $trunks) { Get-CsTrunkConfiguration -Identity $TC.identity| select-object Identity,ConcentratedTopology,EnableBypass,EnableMobileTrunkSupport,EnableReferSupport,EnableSessionTimer,EnableSignalBoost,MaxEarlyDialogs,RemovePlusFromUri,RTCPActiveCalls,RTCPCallsOnHold,SRTPMode,EnablePIDFLOSupport,ScopeClass | ConvertTo-Html -Fragment -as list | Out-File $file3 -Append "
" | Out-File $file3 -Append} "
" | Out-File $file3 -Append "

Announcements

" | Out-File $file3 -append Get-CsAnnouncement | Select-Object name,language,targeturi,AudioFilePrompt,TextToSpeechPrompt | ConvertTo-HTML -fragment | Out-File $file3 -append "

Call park

" | Out-File $file3 -append Get-CsCallParkOrbit | Select-Object identity,numberrangestart,numberrangeend,Type,CallParkServiceId | ConvertTo-HTML -fragment | Out-File $file3 -append "

Unassigned Number ranges

" | Out-File $file3 -append Get-CsUnassignedNumber | Select-object identity,numberrangestart,numberrangeend,AnnouncementName,Priority| ConvertTo-HTML -fragment | Out-File $file3 -append "

Exchange contacts

" | Out-File $file3 -append Get-CsExUmContact | sort -Property lineuri | Select-object Lineuri,displayname,autoattendant,issubscriberaccess,displaynumber,registrarpool | ConvertTo-HTML -fragment| Out-File $file3 -append "

Conference information as of $date

" | Out-File $file3 -append "

Dial in information

" | Out-File $file3 -append Get-CsDialInConferencingAccessNumber | Select-object displayname,lineuri,DisplayNumber,primarylanguage,PrimaryUri,pool | ConvertTo-HTML -fragment | Out-File $file3 -append "

Conference configuration

" | Out-File $file3 -append "" | Out-File $file3 -append $confCon = Get-CsConferencingConfiguration foreach ($confConX in $confCon){ "" | Out-File $file3 -Append} "
Configurations
" | Out-File $file3 -Append Get-CsConferencingConfiguration -Identity $confConX.identity | Select-Object Identity,MaxContentStorageMb,MaxUploadFileSizeMb,MaxBandwidthPerAppSharingServiceMb,ContentGracePeriod,ClientMediaPortRangeEnabled,ClientMediaPort,ClientMediaPortRange,ClientAudioPort,ClientAudioPortRange,ClientVideoPort,ClientVideoPortRange,ClientAppSharingPort,ClientAppSharingPortRange,ClientFileTransferPort,ClientFileTransferPortRange,ClientSipDynamicPort,ClientSipDynamicPortRange,Organization,HelpdeskInternalUrl,HelpdeskExternalUrl,ConsoleDownloadInternalUrl,ConsoleDownloadExternalUrl | ConvertTo-HTML -as list -fragment | Out-File $file3 -append "
" | Out-File $file3 -Append "
" | Out-File $file3 -Append "" | Out-File $file3 -append $confPol = Get-CsConferencingPolicy foreach ($confPolX in $confPol){ "" | Out-File $file3 -Append} "
Policies
" | Out-File $file3 -Append Get-CsConferencingPolicy -Identity $confPolX.identity| Select-Object Identity,AllowIPAudio,AllowIPVideo,AllowMultiView,Description,AllowParticipantControl,AllowAnnotations,DisablePowerPointAnnotations,AllowUserToScheduleMeetingsWithAppSharing,AllowNonEnterpriseVoiceUsersToDialOut,AllowAnonymousUsersToDialOut,AllowAnonymousParticipantsInMeetings,AllowExternalUsersToSaveContent,AllowExternalUserControl,AllowExternalUsersToRecordMeeting,AllowPolls,AllowSharedNotes,AllowQandA,EnableDialInConferencing,EnableAppDesktopSharing,AllowConferenceRecording,EnableP2PRecording,EnableFileTransfer,EnableP2PFileTransfer,EnableP2PVideo,AllowLargeMeetings,EnableOnlineMeetingPromptForLyncResources,EnableDataCollaboration,MaxVideoConferenceResolution,MaxMeetingSize,AudioBitRateKb,VideoBitRateKb,AppSharingBitRateKb,FileTransferBitRateKb,TotalReceiveVideoBitRateKb,EnableMultiViewJoin,ScopeClass | ConvertTo-HTML -as List -fragment | Out-File $file3 -append "
" | Out-File $file3 -Append "" | Out-File $file3 -append "" | Out-File $file3 -append <# Application information #> $Showcounter = 0 function countmy-users { $counting = 0 foreach ($identity in Get-CsRgsHoursOfBusiness) { $counting++ } write-output $counting } $Showcounter += countmy-users "

Application information as of $date

" | Out-File $file5 -append "

Showing the number of workin hours configured

" | Out-File $file5 -append "" | Out-File $file5 -append $RGSoB = Get-CsRgsHoursOfBusiness foreach ($RGSoBX in $RGSoB){ "" | Out-File $file5 -append} "
Working hours
" | Out-File $file5 -append "There are $Showcounter sets of working hours configured
" | Out-File $file5 -append Get-CsRgsHoursOfBusiness -Identity $RGSoBX.identity| Select-Object Identity,OwnerPool,Name,Description,Custom,MondayHours1,MondayHours2,TuesdayHours1,TuesdayHours2,WednesdayHours1,WednesdayHours2,ThursdayHours1,ThursdayHours2,FridayHours1,FridayHours2,SaturdayHours1,SaturdayHours2,SundayHours1,SundayHours2| ConvertTo-HTML -fragment -as List | Out-File $file5 -append "
" | Out-File $file5 -append "

Configured holidays

" | Out-File $file5 -append Get-CsRgsHolidaySet | select-object name,holidaylist | ConvertTo-HTML -fragment | Out-File $file5 -append "

Agent groups

" | Out-File $file5 -append "

Type Get-CsRgsAgentGroup -identity %name% to see a groups members

" | Out-File $file5 -append Get-CsRgsAgentGroup | sort -property name | Select-object name,description,ParticipationPolicy,agentalerttime,routingmethod,DistributionGroupAddress | ConvertTo-HTML -fragment| Out-File $file5 -append "

Queues

" | Out-File $file5 -append get-CsRgsQueue | sort -Property name | Select-object Name,Description,TimeoutThreshold,OverflowThreshold,OverflowCandidate,TimeoutAction,OverflowAction | ConvertTo-HTML -fragment | Out-File $file5 -append "

Workflows

" | Out-File $file5 -append Get-CsRgsWorkflow | sort -Property lineuri | Select-object lineuri,displaynumber,name,primaryuri,language,enabledforfederation,active | ConvertTo-HTML -fragment | Out-File $file5 -append "

Application Configuration Information

" | Out-File $file5 -append "

Trusted Application Pool

" | Out-File $file5 -append Get-cstrustedapplicationpool | Select-Object poolfqdn,throttleasserver,treatasauthenticated,RequiresReplication,serviceid,siteid | ConvertTo-HTML -fragment | Out-File $file5 -append "

Trusted Application

" | Out-File $file5 -append Get-CstrustedApplication | Select-object trustedapplicationpoolfqdn,Applicationid,port | ConvertTo-HTML -fragment | Out-File $file5 -append "

Trusted Application Endpoint

" | Out-File $file5 -append Get-CstrustedApplicationEndpoint | sort -Property lineuri | Select-object -Property lineuri, displayname, displaynumber, ownerurn | ConvertTo-HTML -fragment | Out-File $file5 -append "

Application Endpoint

" | Out-File $file5 -append Get-CsApplicationEndpoint | sort -Property lineuri | Select-object -Property lineuri, displayname, displaynumber, ownerurn, enabled | ConvertTo-HTML -fragment | Out-File $file5 -append "" | Out-File $file5 -append "" | Out-File $file5 -append <# Network information #> "

Network information as of $date

" | Out-File $file6 -append # Get-CsLisCivicAddress "

LIS locations

" | Out-File $file6 -append Get-CsLisLocation | ConvertTo-HTML -fragment | Out-File $file6 -append # Get-CsLisPort # Get-CsLisServiceProvider "

LIS Subnets

" | Out-File $file6 -append Get-CsLisSubnet | ConvertTo-HTML -fragment | Out-File $file6 -append # Get-CsLisSwitch # Get-CsLisWirelessAccessPoint "

LIS Location policies

" | Out-File $file6 -append $Showcounter = 0 function countmy-users { $counting = 0 foreach ($identity in Get-CsLocationPolicy) { $counting++ } write-output $counting } $Showcounter += countmy-users "" | Out-File $file6 -append $LocPol = Get-CsLocationPolicy foreach ($LocPolX in $LocPol){ "" | Out-File $file6 -append} "
CS Location Policy
" | Out-File $file6 -append "There are $Showcounter sets of Location policies configured" | Out-File $file6 -append "
" | Out-File $file6 -append Get-CsLocationPolicy -Identity $LocPolX.identity | Select-Object Identity,Description,EnhancedEmergencyServicesEnabled,LocationRequired,UseLocationForE911Only,PstnUsage,EmergencyDialString,EmergencyDialMask,NotificationUri,ConferenceUri,ConferenceMode,LocationRefreshInterval,EnhancedEmergencyServiceDisclaimer,ScopeClass | ConvertTo-Html -Fragment -as List | Out-File $file6 -Append "
" | Out-File $file6 -append "

Bandwidth policy profiles

" | Out-File $file6 -append $Showcounter = 0 function countmy-users { $counting = 0 foreach ($identity in Get-CsNetworkBandwidthPolicyProfile) { $counting++ } write-output $counting } $Showcounter += countmy-users "" | Out-File $file6 -append $BwPol = Get-CsNetworkBandwidthPolicyProfile foreach ($BwPolX in $BwPol){ "" | Out-File $file6 -append} "
BandwidthPolicy
" | Out-File $file6 -append "There are $Showcounter sets of bandwidth policies configured" | Out-File $file6 -append "
" | Out-File $file6 -append $BwPolXX = Get-CsNetworkBandwidthPolicyProfile -Identity $BwPolX.identity| select-object Identity,BWPolicyProfileID,Description | ConvertTo-Html -Fragment -as list| Out-File $file6 -Append $BwPolXY = Get-CsNetworkBandwidthPolicyProfile -Identity $BwPolX.identity| select-object BWPolicy $BwPolXY = $BwPolXY.BWPolicy $BwPolXY = $BwPolXY -split " " $BwPolXY1 = ($BwPolXY[0]) $BwPolXY2 = ($BwPolXY[1]) "$BwPolXY1
$BwPolXY2" | Out-File $file6 -append "
" | Out-File $file6 -append "

Regions

" | Out-File $file6 -append Get-CsNetworkRegion | select-object Identity,Description,CentralSite,NetworkRegionID | ConvertTo-HTML -fragment | Out-File $file6 -append "

Region links

" | Out-File $file6 -append Get-CsNetworkRegionLink | select-object Identity,Description,CentralSite,NetworkRegionID | ConvertTo-HTML -fragment | Out-File $file6 -append "

Network sites

" | Out-File $file6 -append Get-CsNetworkSite | select-object Identity,NetworkSiteID,Description,NetworkregionID,bwpolicyprofileid,locationpolicy | ConvertTo-HTML -fragment | Out-File $file6 -append "

Network subnets

" | Out-File $file6 -append Get-CsNetworksubnet | Select-Object Identity,MaskBits,Description,NetworkSiteID,SubnetID | ConvertTo-HTML -fragment | Out-File $file6 -append "" | Out-File $file6 -append "" | Out-File $file6 -append <# Counting the number of users with a lineURI and listing them #> $Showcounter = 0 function countmy-users { $counting = 0 foreach ($lineuri in (get-csuser -filter {LineURI -ne $Null})) { $counting++ } write-output $counting } $Showcounter += countmy-users "

There are $Showcounter users with a primary LineURI

" | Out-File $file7 -append $Groupuser = Get-CsUser -Filter {LineURI -ne $Null} foreach ($gUser in $Groupuser) { $cDomain = $gUser.sipaddress -split "\@" $cDomain = $cDomain[1] $ext = $gUser.LineURI -isplit "\;ext=" $extX = $ext[0] $ext = $ext[1] $gUser | Add-Member -MemberType NoteProperty -Name "SipDomain" -Value $cDomain if ($ext -ne $null){ $gUser | Add-Member -MemberType NoteProperty -Name "Line" -Value $extX $gUser | Add-Member -MemberType NoteProperty -Name "Extension" -Value $ext} else{ $gUser | Add-Member -MemberType NoteProperty -Name "Line" -Value $extX $gUser | Add-Member -MemberType NoteProperty -Name "Extension" -Value $null} } $Groupuser | sort -Property SipDomain | Select-Object Line,Extension,Name,sipaddress,SipDomain | ConvertTo-HTML | Out-File $file7 -append $Showcounter = $NULL $counting = $NULL $Showcounter = $NULL <# Counting the number of users with a private line and listing them #> $Showcounter = 0 function countmy-users { $counting = 0 foreach ($privateline in (get-csuser -Filter {privateline -ne $Null})) { $counting++ } write-output $counting } $Showcounter += countmy-users "

There are $Showcounter users with a private line

" | Out-File $file7 -append $Groupuser = Get-CsUser -Filter {privateline -ne $Null} foreach ($gUser in $Groupuser) { $cDomain = $gUser.sipaddress -split "\@" $cDomain = $cDomain[1] $gUser | Add-Member -MemberType NoteProperty -Name "SipDomain" -Value $cDomain } $Groupuser | sort -Property SipDomain | Select-Object privateline,Name,sipaddress,SipDomain | ConvertTo-HTML | Out-File $file7 -append $Showcounter = $NULL $counting = $NULL $Showcounter = $NULL <# Counting the number of users enabled for Lync #> $Showcounter = 0 function countmy-users { $counting = 0 foreach ($sipaddress in (get-csuser -filter {LineURI -eq $Null})) { $counting++ } write-output $counting } $Showcounter += countmy-users "

There are $Showcounter users enabled for Lync without a lineURI

" | Out-File $file7 -append $Groupuser = Get-CsUser -Filter {LineURI -eq $Null} foreach ($gUser in $Groupuser) { $cDomain = $gUser.sipaddress -split "\@" $cDomain = $cDomain[1] $gUser | Add-Member -MemberType NoteProperty -Name "SipDomain" -Value $cDomain } $Groupuser | sort -Property SipDomain | Select-Object Name,sipaddress,SipDomain | ConvertTo-HTML | Out-File $file7 -append $Showcounter = $NULL $counting = $NULL $Showcounter = $NULL <# Counting the number of analog devices and listing them #> $Showcounter = 0 function countmy-users { $counting = 0 foreach ($LineURI in Get-CsAnalogDevice) { $counting++ } write-output $counting } $Showcounter += countmy-users "

There are $Showcounter analog devices

" | Out-File $file7 -append Get-CsAnalogDevice -Filter {LineURI -ne $Null} | Sort -property lineuri | Select-Object lineuri,displayname | ConvertTo-HTML -fragment | Out-File $file7 -append $Showcounter = $NULL $counting = $NULL $Showcounter = $NULL <# Counting the number of common area phones and listing them #> $Showcounter = 0 function countmy-users { $counting = 0 foreach ($LineURI in Get-CsCommonAreaPhone) { $counting++ } write-output $counting } $Showcounter += countmy-users "

There are $Showcounter common area phones devices

" | Out-File $file7 -append Get-CsCommonAreaPhone -Filter {LineURI -ne $Null} | sort -property lineuri | Select-object lineuri, displaynumber, displayname | ConvertTo-HTML -fragment | Out-File $file7 -append $Showcounter = $NULL $counting = $NULL $Showcounter = $NULL <# Counting the number of RGS workflows and listing them #> $Showcounter = 0 function countmy-users { $counting = 0 foreach ($LineURI in Get-CsRgsWorkflow) { $counting++ } write-output $counting } $Showcounter += countmy-users "

There are $Showcounter RGS workflows with a LineURI

" | Out-File $file7 -append Get-CsRgsWorkflow | sort -Property lineuri | Select-object lineuri,displaynumber,name,active | ConvertTo-HTML -fragment | Out-File $file7 -append $Showcounter = $NULL $counting = $NULL $Showcounter = $NULL <# Counting the number of voice conference numbers and listing them #> $Showcounter = 0 function countmy-users { $counting = 0 foreach ($LineURI in Get-CsDialInConferencingAccessNumber) { $counting++ } write-output $counting } $Showcounter += countmy-users "

There are $Showcounter dialin access numbers

" | Out-File $file7 -append Get-CsDialInConferencingAccessNumber -Filter {LineURI -ne $Null} | sort -Property lineuri | Select-object lineuri,displayname | ConvertTo-HTML -fragment | Out-File $file7 -append $Showcounter = $NULL $counting = $NULL $Showcounter = $NULL <# Counting the number of Exchange objects and listing them #> $Showcounter = 0 function countmy-users { $counting = 0 foreach ($LineURI in Get-CsExUmContact) { $counting++ } write-output $counting } $Showcounter += countmy-users "

There are $Showcounter Exchange objects

" | Out-File $file7 -append Get-CsExUmContact -Filter {LineURI -ne $Null} | sort -Property lineuri | Select-object Lineuri,displayname,displayuri | ConvertTo-HTML -fragment | Out-File $file7 -append $Showcounter = $NULL $counting = $NULL $Showcounter = $NULL <# Counting the number of LRS objects and listing them #> $Showcounter = 0 function countmy-users { $counting = 0 foreach ($LineURI in Get-CsMeetingRoom) { $counting++ } write-output $counting } $Showcounter += countmy-users "

There are $Showcounter MeetingRoom objects

" | Out-File $file7 -append Get-CsMeetingRoom | sort -Property lineuri | Select-object Lineuri,displayname,sipaddress | ConvertTo-HTML -fragment | Out-File $file7 -append $Showcounter = $NULL $counting = $NULL $Showcounter = $NULL <# Finding servers and their versions #> $verCollection = @("ApplicationServer","ArchivingServer","BackupServer","CentralManagement","ConferencingServer","Director","EdgeServer","MediationServer","MonitoringServer","PersistentChatServer","Registrar","UserServer","WebServer","VideoInteropServer") $verQueryPool = get-pools $verCollection foreach ($verpool in $verQueryPool){ $verQueryComputers = get-machine $verpool foreach ($x in $verQueryComputers){ get-Version $x } } $verCollection = @("WacServer") $verQueryPool = get-pools $verCollection foreach ($verpool in $verQueryPool){ $verQueryComputers = get-machine $verpool foreach ($x in $verQueryComputers){ $finalIP = [System.Net.Dns]::GetHostByName("$x") $ipValue = $finalIP.AddressList.IPAddressToString $correctName = [System.Net.Dns]::GetHostByAddress("$ipValue") $correctValue = $correctName.HostName.ToString() get-Version $correctValue } } <#Closing all htm files #> HTML-End | Out-File $file -Append HTML-End | Out-File $file1 -Append HTML-End | Out-File $file2 -Append HTML-End | Out-File $file3 -Append HTML-End | Out-File $file4 -Append HTML-End | Out-File $file5 -Append HTML-End | Out-File $file6 -Append HTML-End | Out-File $file7 -Append HTML-End | Out-File $file8 -Append $zipIT = ZipFiles $backupfile10 $filepath $zipJob = start-job -ScriptBlock {$zipIT} -Name ZipJob |out-null get-job -Name ZipJob | Wait-Job |out-null if(!$KEEPTemp.IsPresent){ $deleteFiles = $filepath + "\\*.*" Remove-Item $deleteFiles -force -Recurse | Out-Null } Set-Location $startpath Get-Job -Name ZipJob | Remove-Job Move-Item $backupfile10 $filepath $attachFile = $filepath + "\Documentation_set_" + $date2 +".zip" if($SendEmailOnComplete.IsPresent){ Write-host ("Sending e-mail `n") send_email } write-host "Documentation complete. All files can now be found in a zipped file found at " -NoNewLine -Foregroundcolor yellow write-host "$filepath" -Foregroundcolor Green Write-host "Finished at: " (Get-Date -format yyyy-MM-dd-HH:mm:ss) -ForegroundColor Green # SIG # Begin signature block # MIIOjgYJKoZIhvcNAQcCoIIOfzCCDnsCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR # AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUZ+BTCqCcyWUjcc7KqVrs1c3/ # Y6WgggvQMIIFMDCCBBigAwIBAgIQBAkYG1/Vu2Z1U0O1b5VQCDANBgkqhkiG9w0B # AQsFADBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYD # VQQLExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVk # IElEIFJvb3QgQ0EwHhcNMTMxMDIyMTIwMDAwWhcN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