Coder Social home page Coder Social logo

jossryan / cucmposh Goto Github PK

View Code? Open in Web Editor NEW
24.0 5.0 5.0 36 KB

A PowerShell module and scripts to facilitate AXL SOAP requests to Cisco Unified Communications Manager

License: Apache License 2.0

PowerShell 100.00%
powershell cisco-call-manager cucm axl soap cisco voice scripts sharepoint oncall

cucmposh's Introduction

CUCMPosh Module and Scripts

A PowerShell module and scripts to facilitate AXL SOAP requests to Cisco Unified Communications Manager.

About

Automate all the things. This PowerShell module is for interfacing with CUCM and was initially developed for automating an on-call schedule and then built from there. Our department has a DID assigned for on-call which rotates weekly whose cell it forwards to.

Getting Started

To get started with this module, you need to download a copy of the latest release and unzip the contents to a working directory, e.g. C:\Dev\CUCM\. The repository contains scripts and the module. To use the module without specifying path, copy the CUCMPosh subdirectory to your PowerShell Modules folder:

  • User Only: C:\Users\YourUserName\My Documents\WindowsPowerShell\Modules
  • Global: C:\Windows\System32\WindowsPowerShell\v1.0\Modules

Prerequisites

A few of the scripts rely on third party PowerShell modules, you may need the following added to one of the Module directories (dependent on the scope you're running at).

Usage

After installing into the modules directory, to use the included functions just Import-Module CUCMPosh from a PowerShell instance. To use any of the scripts, copy the folder to a directory that makes sense or extract only what you need. Make sure to modify the settings to fit your environment - script variables should be at the top of every script unless specified.

Scripts

  • Automated On-Call Scheduler - Uses Set-LineForward function against a schedule hosted on SharePoint to automatically update a specified line at a set interval.

Sample Commands

Basic Queries

Get basic/common phone information by name.

PS \> Get-Phone -Name SEP00EBD6543210 -Basic
name                   : SEP00EBD6543210
description            : 4321 James Smith
model                  : Cisco 8851
class                  : Phone
protocol               : SIP
ownerUserName          : jsmith
mobilityUserIdName     :
lines                  : {line, line, line}
speedDials             : {speeddial, speeddial, speeddial, speeddial...}
cssName                : National_css
locationName           : MainOffice_loc
devicePool             : MainOffice_dp
commonDeviceConfigName : StndKeysNoMOH_cp
commonPhoneConfigName  : Standard Common Phone Profile
phoneTemplateName      : SEP00EBD6543210-SIP-Individual Template
userLocale             : English United States
networkLocale          : United States
softkeyTemplateName    : Standard
dndStatus              : false
uuid                   : {03231B3F-9B7E-C31A-ECF1-A1B2C3D4E5F6}
loadInformation        : sip88xx.12-1-1SR1-4

Check if DN exists by Pattern or Description.

PS \> Get-DN -DN 4321
uuid                                 : {F4D81158-B1AC-C5C4-FF4B-A1B2C3D4E5F6}
pattern                              : 4321
description                          : Script Test
usage                                : Device
routePartitionName                   : routePartitionName
aarNeighborhoodName                  :
aarDestinationMask                   :
aarKeepCallHistory                   : true
aarVoiceMailEnabled                  : false
callPickupGroupName                  :
autoAnswer                           : Auto Answer Off
networkHoldMohAudioSourceId          :
userHoldMohAudioSourceId             :
alertingName                         : CUCM Script Test
asciiAlertingName                    : CUCM Script Test
presenceGroupName                    : presenceGroupName
shareLineAppearanceCssName           :
voiceMailProfileName                 : voiceMailProfileName
patternPrecedence                    : Default
releaseClause                        : No Error
hrDuration                           :
hrInterval                           :
cfaCssPolicy                         : Use System Default
defaultActivatedDeviceName           :
parkMonForwardNoRetrieveDn           :
parkMonForwardNoRetrieveIntDn        :
parkMonForwardNoRetrieveVmEnabled    : false
parkMonForwardNoRetrieveIntVmEnabled : false
parkMonForwardNoRetrieveCssName      :
parkMonForwardNoRetrieveIntCssName   :
parkMonReversionTimer                :
partyEntranceTone                    : Default

Get line association by DN/Pattern, Description, and/or Route Partition

PS \> Get-Line -DNorPattern 4321 -RoutePartition 0_Internal_pt
name            description          dn   partition
----            -----------          --   ---------
SEP00EBD6543210 4321 James Smith     4321 0_Internal_pt
Setting Information

Forward all calls for DN to Voicemail.

PS \> Add-LineForward -Pattern 1234 -RoutePartition 0_Internal_pt -Voicemail

Stop forwarding all calls for DN to Voicemail.

PS \> Remove-LineForward -Pattern 1234 -RoutePartition 0_Internal_pt -Voicemail

Forward all calls for DN to cell phone.

PS \> Add-LineForward -Pattern 1234 -RoutePartition 0_Internal_pt -Destination 815085551234 -DestinationCSS National_css

Remove all ForwardAll settings for DN.

PS \> Remove-LineForward -Pattern 1234 -RoutePartition 0_Internal_pt

Advanced Queries

Get the phone information for each line returned from a Get-Line by DN/Pattern, Description, and/or Route Partition result.

PS \> Get-Line -DNorPattern 4321 | %{ Get-Phone -Name $_.name -Basic }
name                   : SEP00EBD6543210
description            : 4321 James Smith
model                  : Cisco 8851
class                  : Phone
protocol               : SIP
ownerUserName          : jsmith
mobilityUserIdName     :
lines                  : {line, line, line}
speedDials             : {speeddial, speeddial, speeddial, speeddial...}
cssName                : National_css
locationName           : MainOffice_loc
devicePool             : MainOffice_dp
commonDeviceConfigName : StndKeysNoMOH_cp
commonPhoneConfigName  : Standard Common Phone Profile
phoneTemplateName      : SEP00EBD6543210-SIP-Individual Template
userLocale             : English United States
networkLocale          : United States
softkeyTemplateName    : Standard
dndStatus              : false
uuid                   : {03231B3F-9B7E-C31A-ECF1-A1B2C3D4E5F6}
loadInformation        : sip88xx.12-1-1SR1-4

Get configured speed dials for a phone.

PS \> $ph = Get-Line -DNorPattern 4321 | %{ Get-Phone -Name $_.name -Basic }
PS \> $ph.speedDials
dirn                      label                     index
----                      -----                     -----
818665551234              ABC Company, Inc.         1
818009995555              XYZ Communications, LLC.  2
818668884321,,1,5555#,#   Weekly MSP Check-in       3

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

To-Do List

  • Better handling of returns from POSTs
  • Read Queries and respective Sets
    • Get-User
    • Get-HuntPilot
    • Get-HuntList
    • Get-LineGroup
    • Get-RoutePlanReport
  • System Requests
    • Sync-LDAP

Change Log

Changes between releases are noted in the release notes. For a complete list of changes, see the CHANGELOG.md.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details

Acknowledgments

  • Thanks to @Tervis-Tumbler for inspiration and helping me understand CUCM SOAP requests.

cucmposh's People

Contributors

jossryan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cucmposh's Issues

Add a Remove-LineForward command

Is your feature request related to a problem? Please describe.
It is easy to use set-lineforward to forward a line, however there isn't an easy way to UNforward the line after
Describe the solution you'd like
change set-lineforward to add-lineforward, and then create a remove-lineforward

Describe alternatives you've considered
Could add a flag for set-lineforward 1 for add a line forward, and set-lineforward 0 for removing a lineforward

Cannot index into a null array

Describe the bug
When running any of the examples from Sample Commands such as:
Get-Phone -Name SEP706E6D10904E -Basic

i am met with:

Cannot index into a null array.
At T:\AdminTools\Scripts\Powershell\Modules\CUCMPosh\Public\Get-SettingsFile.ps1:32 char:3
$cucm_path = $MyInvocation.MyCommand.Module.PrivateData['cucm ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : NullArray

Cannot index into a null array.
At T:\AdminTools\Scripts\Powershell\Modules\CUCMPosh\Public\Get-SettingsFile.ps1:32 char:3
$cucm_path = $MyInvocation.MyCommand.Module.PrivateData['cucm ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : NullArray

Cannot index into a null array.
At T:\AdminTools\Scripts\Powershell\Modules\CUCMPosh\Private\Invoke-CUCMAPIRequest.ps1:22 char:2
$cucm_path = $MyInvocation.MyCommand.Module.PrivateData['cucm_pat ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : NullArray

I am on windows 10 using the most current version of the download as of today's date.

This happens if i am using ISE or PowerGUI.

It will ultimately produce the desired output but causes these errors along the way.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.