CA Service Management

  • 1.  Contact supervisor details update with SD LDAP SYNC

    Posted Nov 05, 2012 07:39 PM
    Hi All,

    Problem:

    In Service Desk, contacts' supervisor details are not update regularly. And we can update contacts' details like location, phone numbers with LDAP Synchroniztion process except Supervisor. But we having the Service Catalog and most of the tickets needs immediae manager approvals. So we are having problem in updating the details other than manula process.


    Please let me know is there any other process where i can update these details either from Catalog or any.

    Thanks in advance

    ~Hari


  • 2.  RE: Contact supervisor details update with SD LDAP SYNC
    Best Answer

    Posted Nov 06, 2012 05:55 AM
    Hi Hari,

    Check if the OOTB "ldap.maj" file has a mapping for the supervisor field. If it does not have it, you will have to customize it to include the supervior and tell it which field from your LDAP this field maps to.

    Hope this helps...


  • 3.  RE: Contact supervisor details update with SD LDAP SYNC

    Posted Nov 06, 2012 01:24 PM
    The manager attribute in LDAP contains a dn (distinguished name). If you want to synchronize Service Desk with your LDAP source and update the supervisor on the contact here is what you need to do.

    1. Modify the schema and add the following attribute to the cnt object:

    z_supervisor_ldap_dn STRING 512

    (When doing this in the schema designer leave the leading z off as it will be automatically added)
    (Don't forget to pdm_publish after publishing your schema changes)

    2. Your ldap.mod file should look like this:

    OBJECT ldap LDAP
    {
    ATTRIBUTES LDAP_Entry
    {
    z_supervisor_ldap_dn manager STRING ;
    } ;
    } ;

    (Service Desk can now be restarted)

    3. after you run your ldap_sync, run a sqlcmd against the mdb using the following sql:

    UPDATE dbo.ca_contact
    SET supervisor_contact_uuid = super.contact_uuid
    FROM dbo.ca_contact AS ca
    INNER JOIN dbo.usp_contact AS usp ON ca.contact_uuid = usp.contact_uuid
    INNER JOIN dbo.usp_contact AS super ON usp.z_supervisor_ldap_dn = super.ldap_dn
    WHERE ca.inactive = 0


  • 4.  Re: Contact supervisor details update with SD LDAP SYNC

    Posted May 06, 2018 05:53 AM

    Hello;

     

    i tried the steps; but i faced an issue which is that i must run the query each time i have a change in a manager in our environment.

     

    is that true or i am missing something here?!!



  • 5.  Re: Contact supervisor details update with SD LDAP SYNC

    Posted May 08, 2018 12:10 AM

    Yes, that is true.



  • 6.  RE: Re: Contact supervisor details update with SD LDAP SYNC

    Posted Jun 20, 2022 02:57 AM
    you can copy this job to ms sql server which doing the sync and update the ca_contact then refresh the ca_contact table without restart the service and it takes around 1 minute to finish the job for 2000 users in AD 
    just copy the following script to a new query in ms sql server and run it  then you can chose the schedule time (mine is 11:00pm daily ) 

    BEGIN TRANSACTION
    DECLARE @ReturnCode INT
    SELECT @ReturnCode = 0
    /****** Object:  JobCategory [[Uncategorized (Local)]]    Script Date: 6/18/2022 6:37:01 PM ******/
    IF NOT EXISTS (SELECT name FROM msdb.dbo.syscategories WHERE name=N'[Uncategorized (Local)]' AND category_class=1)
    BEGIN
    EXEC @ReturnCode = msdb.dbo.sp_add_category @class=N'JOB', @type=N'LOCAL', @name=N'[Uncategorized (Local)]'
    IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback

    END

    DECLARE @jobId BINARY(16)
    EXEC @ReturnCode =  msdb.dbo.sp_add_job @job_name=N'Update Direct Manager',
    @enabled=1,
    @notify_level_eventlog=0,
    @notify_level_email=0,
    @notify_level_netsend=0,
    @notify_level_page=0,
    @delete_level=0,
    @description=N'No description available.',
    @category_name=N'[Uncategorized (Local)]',
    @owner_login_name=N'MEDGULF\casmadmin', @job_id = @jobId OUTPUT
    IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
    /****** Object:  Step [1_pdm_ldap_sync]    Script Date: 6/18/2022 6:37:01 PM ******/
    EXEC @ReturnCode = msdb.dbo.sp_add_jobstep @job_id=@jobId, @step_name=N'1_pdm_ldap_sync',
    @step_id=1,
    @cmdexec_success_code=0,
    @on_success_action=4,
    @on_success_step_id=2,
    @on_fail_action=2,
    @on_fail_step_id=0,
    @retry_attempts=0,
    @retry_interval=0,
    @os_run_priority=0, @subsystem=N'PowerShell',
    @command=N'pdm_ldap_sync',
    @database_name=N'master',
    @flags=0
    IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
    /****** Object:  Step [2-UPDATE dbo.ca_contact]    Script Date: 6/18/2022 6:37:01 PM ******/
    EXEC @ReturnCode = msdb.dbo.sp_add_jobstep @job_id=@jobId, @step_name=N'2-UPDATE dbo.ca_contact',
    @step_id=2,
    @cmdexec_success_code=0,
    @on_success_action=4,
    @on_success_step_id=3,
    @on_fail_action=2,
    @on_fail_step_id=0,
    @retry_attempts=0,
    @retry_interval=0,
    @os_run_priority=0, @subsystem=N'TSQL',
    @command=N'use mdb
    UPDATE dbo.ca_contact
    SET supervisor_contact_uuid = super.contact_uuid
    FROM dbo.ca_contact AS ca
    INNER JOIN dbo.usp_contact AS usp ON ca.contact_uuid = usp.contact_uuid
    INNER JOIN dbo.usp_contact AS super ON usp.z_supervisor_ldap_dn = super.ldap_dn
    WHERE ca.inactive = 0',
    @database_name=N'master',
    @flags=0
    IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
    /****** Object:  Step [3_pdm_cache_refresh -t ca_contact]    Script Date: 6/18/2022 6:37:01 PM ******/
    EXEC @ReturnCode = msdb.dbo.sp_add_jobstep @job_id=@jobId, @step_name=N'3_pdm_cache_refresh -t ca_contact',
    @step_id=3,
    @cmdexec_success_code=0,
    @on_success_action=1,
    @on_success_step_id=0,
    @on_fail_action=2,
    @on_fail_step_id=0,
    @retry_attempts=0,
    @retry_interval=0,
    @os_run_priority=0, @subsystem=N'PowerShell',
    @command=N'pdm_cache_refresh -t ca_contact',
    @database_name=N'master',
    @flags=0
    IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
    EXEC @ReturnCode = msdb.dbo.sp_update_job @job_id = @jobId, @start_step_id = 1
    IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
    EXEC @ReturnCode = msdb.dbo.sp_add_jobschedule @job_id=@jobId, @name=N'daily',
    @enabled=1,
    @freq_type=4,
    @freq_interval=1,
    @freq_subday_type=1,
    @freq_subday_interval=0,
    @freq_relative_interval=0,
    @freq_recurrence_factor=0,
    @active_start_date=20220618,
    @active_end_date=99991231,
    @active_start_time=230000,
    @active_end_time=235959,
    @schedule_uid=N'a97c7281-4555-4004-8b66-1ecd30d04bed'
    IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
    EXEC @ReturnCode = msdb.dbo.sp_add_jobserver @job_id = @jobId, @server_name = N'(local)'
    IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
    COMMIT TRANSACTION
    GOTO EndSave
    QuitWithRollback:
        IF (@@TRANCOUNT > 0) ROLLBACK TRANSACTION
    EndSave:
    GO




  • 7.  RE: Contact supervisor details update with SD LDAP SYNC

    Posted Apr 26, 2022 10:34 PM
    This is a very old post. We are using SDM 17.3.0.11, and I would like to populate the Supervisor contact field via pdm_ldap_sync.exe via our Active Directory.

    Is anyone else doing this? And is this the correct solution, not a fan of having to do an unsupported customization, surprised its not available out of the box.


  • 8.  RE: Contact supervisor details update with SD LDAP SYNC

     
    Posted Nov 12, 2012 04:57 PM
    Hi Hari,

    Did the suggestions here help answer your question? If so please mark the appropriate posts as Accepted Solution.

    Thanks!
    Chris