0 votes

I am working on a scheduled task to help with the transition to adaxes.

I need to get the value that is currently set in msRTCSIP-Line, drop everything including the character "=", and populate that value into a custom attribute.

For Example, if msRTCSIP-Line is tel:+15555551234;ext=12345 i need to trim everything except the extension "12345" and then populate adm-CustomAttributeText4 with the value 12345. Leaving msRTCSIP-Line untouched of course.

Is this something that can be done via a scheduled task? I'm moving most aspects of Lync management to adaxes and need to stage the custom attributes that I am using for all the accounts that were already configured for Lync outside of Adaxes

by (370 points)

1 Answer

0 votes
by (216k points)
selected by
Best answer

Hello,

Yes, this can be done using a PowerShell script. Here's a script that does the job:

# Get the value of msRTCSIP-Line
try
{
    $value = $Context.TargetObject.Get("msRTCSIP-Line")
}
catch
{
    $Context.LogMessage("Attribute 'msRTCSIP-Line' is empty", "Warning")
    return
}

# Get extension
$extension = $value.SubString($value.LastIndexOf("=") + 1)

# Save extension to the custom attribute
$Context.TargetObject.Put("adm-CustomAttributeText4", $extension)
$Context.TargetObject.SetInfo()

To run the script as a part of your Scheduled Task, use the Run a Program or PowerShell script action.

Related questions

0 votes
1 answer

Hi, in our Create User action we have setup a custom binary attribute to upload the staff picture. Is there a way to save the uploaded image to a network share and rename ... out how to save the uploaded image to the share with proper file name. Thank you.

asked Apr 29, 2021 by TJ_Umredkar (140 points)
0 votes
1 answer

We need to capture the Office365 (if any) on the user account before we disable. These are accounts taht are temps or contractors that we disabled and re enable for ... Example of group name is Office-E3-EXO and we want to capture it to CustomAttributeText31

asked Aug 4, 2020 by willy-wally (3.2k points)
0 votes
1 answer

Hi there, i know the multiple ways of copying the user groups - or all of them within the user creation wizard. I want to copy only a couple of groups ... is it possible to create an approval operation out of an powershellscript? Kind regards, Constantin

asked May 27, 2021 by Constey (190 points)
0 votes
1 answer

Hello Forum, in our Adaxes environment we have a lot of security roles (one Security Role per Department). This allows the management of the Department to modify their Users / ... copy it to my newly created Role in powershell? Thanks a lot for your help.

asked Apr 30, 2015 by esoAdxAdmin (650 points)
0 votes
1 answer

Hi, during account creation we store a user/requester DN in field adm-CustomAttributeObject2 If now this requester is disabled, I want to find all users in AD ... field. I found some articles and scripts, but nothing working as expected.

asked Feb 27 by wintec01 (1.1k points)
3,326 questions
3,026 answers
7,727 comments
544,678 users