0 votes

Hello,

I am trying to give the helpdesk a method of alerting all users in the organization of a service interruption via SMS or email.

I was able to create a custom command to accomplish this (sort of)

Created a custom command.
Created a param for the message content.

I tested it and it works, but i would like to not have to select each individual user to send the message to. I would just basically like it to send the message to any user account found under our Internal OU, or all users in an ALL USERS ad group of some sort.

Any help would be appreciated.

Thanks!

by (70 points)
0

Hello,

This can be done using a Custom Command and a Web Interface action. The command will have a parameter for message content (which you already have) and execute a PowerShell script that will send the notification to all the required users. The action will be used to execute the Custom Command in Adaxes Web Interface and will be configured for the currently logged on user so that there is no need to select a target user. The scope of users that will have to receive the notification will be specified in the script itself.

The script can use an OU or a group to get the recipients and can send either SMS or email notification (or both). Please, clarify which approach meets your needs best and we will provide you with detailed instructions.

0

I think AD group would work perfectly for our needs!

1 Answer

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

Hello,

Thank you for clarifying.

Below is the script that will do the job. It will send SMS messages only to users that have a mobile number specified in the corresponding property. To run the script, create a Custom Command configured for Group object type. In the script:

  • $parameterName – specifies the name of the parameter that stores the SMS message text with the param- prefix;
  • $mobileProperty – specifies the LDAP name of the property that stores user mobile numbers.
$parameterName = "param-MyParam" # TODO: modify me
$mobileProperty = "mobile" # TODO: modify me

# Get all members who have a mobile number
$searcher = $Context.TargetObject
$searcher.AttributeScopeQuery = "member"
$searcher.SearchFilter = "(&(sAMAccountType=805306368)($mobileProperty=*))"
$searcher.PageSize = 500
$searcher.SearchScope = "ADS_SCOPE_BASE"
$searcher.SetPropertiesToLoad($mobileProperty)

try
{
    $searchResultIterator = $searcher.ExecuteSearch()
    $searchResults = $searchResultIterator.FetchAll()

    $parameterValue = $Context.GetParameterValue($parameterName)
    foreach ($searchResult in $searchResults)
    {
        $mobileNumber = $searchResult.Properties[$mobileProperty].Value
        $Context.SendSms($mobileNumber, $parameterValue)
    }
}
finally
{
    # Release resources
    if ($searchResultIterator){ $searchResultIterator.Dispose() }
}

Related questions

0 votes
1 answer

If I have created an custom command i would like to find where this CC is used (linked) in Adaxes (used in Scheduked Task and so on). How can a general find references ... report where I can find all the Linked Objects that I have created by myself in Adaxes ?

asked Jun 1, 2023 by Beat Ott (40 points)
0 votes
1 answer

Hi, In a previous installation of Adaxes, we were able to reset users passwords, and send it automatically by SMS to the user. When we try to do the same in Adaxes 2018. ... when we reset a users password. A similar SMS works just fine when we create the user.

asked May 23, 2019 by eirikza (120 points)
0 votes
1 answer

I am wanting to export a list of users including the properties of a specific custom attribute. Ideally, I would be able to run a get-admuser and filter on a custom attribute, but even an excel report with the custom attributes would work. Is this possible?

asked Sep 9, 2021 by ggallaway (300 points)
0 votes
1 answer

I would like to know if it is possible to create a field in the web UI under user management to "assign" a machine to a user. I would like to be able to put the ... be moved to "workstation OU. Is there s custome field that can be used to accomplish this?

asked Oct 22, 2020 by copatterson (70 points)
0 votes
1 answer

Hi, I had to create Custom Command for distribution group creation. Default group creation wizard cannot be used, because we need some of parameters to be mandatory etc. Anyway I ... which shouldn't be targeted to any particular AD object. How do I do it?

asked Jan 20, 2020 by KIT (960 points)
3,548 questions
3,239 answers
8,232 comments
547,814 users