Git Product home page Git Product logo

cucm_appuser_device_assoc_sql's Introduction

cucm_appuser_device_assoc_sql

This simple script will create SQL command that can be run in the CLI (SSH session) of a Cisco Call Manager (CUCM) to associate (or disassociate) devices from an Application user (Or list of multiple application users)
The script inputs a text file with a list of devices to be associated (or disassociated)
One device per row.
It will output 2 files per Application user provided
One to associate, one to disassociate

Example devices.txt file is provided

rename devices.txt.example to devices.txt

Example Associate output

run sql insert into applicationuserdevicemap (fkapplicationuser, fkdevice, tkuserassociation) select au.pkid, d.pkid, 1 from applicationuser au cross join device d where au.name = 'DAL_RMCM' and d.name in ('SEP_ap231','csf_mylogin1','CIPCUCCXADMIN','SEP00152B176C99') and d.pkid not in (select fkdevice from applicationuserdevicemap where fkapplicationuser = au.pkid)

run sql insert into applicationuserdevicemap (fkapplicationuser, fkdevice, tkuserassociation) select au.pkid, d.pkid, 1 from applicationuser au cross join device d where au.name = 'WFM_REC01' and d.name in ('SEP_ap231','csf_mylogin1','CIPCUCCXADMIN','SEP00152B176C99') and d.pkid not in (select fkdevice from applicationuserdevicemap where fkapplicationuser = au.pkid)

Example Disassociate output

run sql delete from applicationuserdevicemap where fkapplicationuser = (select pkid from applicationuser au where au.name = 'DAL_RMCM') and fkdevice in (select pkid from device d where d.name in ('SEP_ap231','csf_mylogin1','CIPCUCCXADMIN','SEP00152B176C99'))

run sql delete from applicationuserdevicemap where fkapplicationuser = (select pkid from applicationuser au where au.name = 'WFM_REC01') and fkdevice in (select pkid from device d where d.name in ('SEP_ap231','csf_mylogin1','CIPCUCCXADMIN','SEP00152B176C99'))

cucm_appuser_device_assoc_sql's People

Contributors

bvanbens avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.