cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
663
Views
20
Helpful
5
Replies

Using BAT to assign phones to users, that already have lines assigned.

mtkelly01
Level 1
Level 1

I've been trying to export All Details of Phones which would include the lines and assigned user of those lines, so that i can copy that user and assign them to the phone. I am able to get the assigned lines with the users, but I'm not seeing where i can copy that information back into the csv to assign the users that specific phone. 

 

I apologize for being wordy, but its simply that i need to assign the users of the lines, the the phone where the line is configured.

 

Has anyone else had to do this or know the way to do this?

5 Replies 5

If I read you correctly you ask for how to assign users as owner of devices via bulk?



Response Signature


Yes.

The users are assigned to the line already and the line is configured on the device. Now I want to use that to update the user for the device.


I’m outside of work hours for the day, so don’t have access to various files. I’ll look for a suitable one for this tomorrow and get back to you on this.



Response Signature


I hope you are trying to update the OWNER-ID filed for the phone ? 



Response Signature


As @Nithin Eluvathingal wrote it is the Owner User ID field that you'd need to set on the device to set the user as the owner.

See this example for an all details file that I've used in the past.

Device Name,Description,Device Pool,Phone Button Template,CSS,Location,Extension Mobility,Packet Capture Mode,Packet Capture Duration,Built in Bridge,Privacy,Retry Video Call as Audio,Ignore Presentation Indicators,Softkey Template,MLPP Indication,MLPP Preemption,Device Type,User ID 1,Owner User ID,Device Security Profile,Device Protocol,Common Device Configuration,Primary Phone,Directory Number 1,Route Partition 1,Voice Mail Profile 1,Line CSS 1,Auto Answer 1,Forward All Voice Mail 1,Forward All CSS 1,Forward Busy Internal Voice Mail 1,Forward Busy Internal CSS 1,Forward Busy External Voice Mail 1,Forward Busy External CSS 1,Forward No Answer Internal Voice Mail 1,Forward No Answer Internal CSS 1,Forward No Answer External Voice Mail 1,Forward No Answer External CSS 1,Forward No Coverage Internal Voice Mail 1,Forward No Coverage Internal CSS 1,Forward No Coverage External Voice Mail 1,Forward No Coverage External CSS 1,Line Text Label 1,Maximum Number of Calls 1,Busy Trigger 1,Visual Message Waiting Indicator Policy 1,Ring setting (Phone Idle) 1,Ring Setting (Phone Active) 1,Caller Name 1,Caller Number 1,Redirected Number 1,Dialed Number 1,Line Description 1,Alerting Name 1,ASCII Alerting Name 1,Secondary CSS for Forward All 1,Forward on CTI Failure Voice Mail 1,Forward on CTI Failure CSS 1,Display 1,ASCII Display 1,Forward Unregistered Internal Voice Mail 1,Forward Unregistered Internal CSS 1,Forward Unregistered External Voice Mail 1,Forward Unregistered External CSS 1,Log Missed Calls 1,Service Name 1,Subscribed Service Name 1,Subscribed Service URL 1
SEP002290053873,CHLA EM Phone - 4114567,CHLA_DP,7945 1L/1SURL,CHLA_DEVICE_CSS,Hub_None,t,None,60,Default,Default,t,f,Standard Feature Plus Callback,Default,Default,Cisco 7945,,CHLAOSS,Universal Device Template - Model-independent Security Profile,SCCP,CHLA_CDC,,\+4121234567,CW_Primary_Line_PT,NoVoiceMail,CH_LINE_Unrestricted_CSS,Auto Answer Off,,,,,,,,,,,,,,,CHLA EM Phone - 4114567,4,2,Use System Policy,Use System Default,Use System Default,t,f,f,t,CHLA EM Phone - 4114567,CHLA EM Phone - 4114567,CHLA EM Phone - 4114567,,,,CHLA EM Phone - 4114567,CHLA EM Phone - 4114567,,,,,t,,,

In this example I set the owner to CHLAOSS and I have made the fields for this in bold text so that it is easier to find.

If you want to go fancy you could do this from CLI or via AXL API also by using something along with this.

List devices that are assoiated with an XXYYOSS end user
run sql select eu.userid, d.name, d.description from device as d inner join enduserdevicemap as eudm on eudm.fkdevice=d.pkid inner join enduser as eu on eudm.fkenduser=eu.pkid where (eu.userid like '%OSS' ) order by eu.userid

List devices where name starts with SEP that are owned (licensed) by an XXYYOSS user where user id ends with OSS
run sql select d.name as devicename, d.description, d.pkid as devicepid, eu.userid as ownername, fkEndUser as ownerpid from device as d inner join enduser as eu on fkenduser=eu.pkid where (d.name like 'SEP%' and eu.userid like '%OSS' ) order by eu.userid

List devices where name starts with SEP that are owned (licensed) by an XXYYOSS user where user id is any 4 characters and ends with OSS
run sql select d.name as devicename, d.description, d.pkid as devicepid, eu.userid as ownername, fkEndUser as ownerpid from device as d inner join enduser as eu on fkenduser=eu.pkid where (d.name like 'SEP%' and eu.userid like '____OSS' ) order by eu.userid

Test with SQL update for one device (SEPD0EC35FE8AE7)
run sql select d.name as devicename, d.description, d.pkid as devicepid, eu.userid as ownername, fkEndUser as ownerpid from device as d inner join enduser as eu on fkenduser=eu.pkid where (d.name like 'SEPD0EC35FE8AE7' and eu.userid like 'TRISOSS' ) order by eu.userid

devicename description devicepid ownername ownerpid =============== ============= ==================================== ========= ==================================== SEPD0EC35FE8AE7 Bursa 9019436 0d3a99c9-d99f-38b5-5ec5-06b422eda0bd TRISOSS 1f9f813e-d24d-0340-93f5-02cdd355b8ed Clear the owner run sql update device set fkenduser=NULL where (pkid="0d3a99c9-d99f-38b5-5ec5-06b422eda0bd") Roll-back the owner run sql update device set fkenduser="1f9f813e-d24d-0340-93f5-02cdd355b8ed" where (pkid="0d3a99c9-d99f-38b5-5ec5-06b422eda0bd")

Word of caution, if you do it from CLI you better be 100% sure on the syntax as you can seriously mess up the database if you do it wrong. The safer option would be to use the information for the SQL update part and use that with AXL as that has more built in control then doing it in CLI. We have used this in a vbs script that we ran from SecureCRT to do the reverse of what your asking for, aka to remove the set owner on a bunch of devices.



Response Signature