Skip to content
DataMiner DoJo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Blog
  • Questions
  • Learning
    • E-learning Courses
    • Empower Replay: Limited Edition
    • Tutorials
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • Video Library
    • Books We Like
    • >> Go to DataMiner Docs
  • Expert Center
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Markets & Industries
      • Media production
      • Government & defense
      • Content distribution
      • Service providers
      • Partners
      • OSS/BSS
    • DataMiner Insights
      • Security
      • System Architecture
      • DataMiner Releases & Updates
    • Agile
      • Agile Webspace
      • Everything Agile
        • The Agile Manifesto
        • Best Practices
        • Retro Recipes
      • Methodologies
        • The Scrum Framework
        • Kanban
        • Extreme Programming
      • Roles
        • The Product Owner
        • The Agile Coach
        • The Quality & UX Coach (QX)
    • DataMiner DevOps Professional Program
  • Downloads
  • More
    • Feature Suggestions
    • Climb the leaderboard!
    • Swag Shop
    • Contact
      • General Inquiries
      • DataMiner DevOps Support
      • Commercial Requests
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

Retrieving Domain account information in Automation

Solved879 views13th July 2023AD Automation
0
Nikolas Boatright36 29th August 2022 1 Comment

We have an automation script where a user (who is logged in via a AD domain account) clicks a button to activate a system. So we know who did what, we require the user to enter their username and a phone number in which they can be reached should we see an issue. the users would like to further streamline this process and not have to enter this information but still have this information. If we add the phone number to the users' domain account information, is there a way in Automation to pull this information back out of the domain account?

Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 13th July 2023
Marieke Goethals [SLC] [DevOps Catalyst] commented 13th July 2023

As this question has been inactive for a long time, we will now close it. If you want further assistance, feel free to post a new question or contact techsupport@skyline.be.

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
1
Gellynck Jens [SLC]2.71K Posted 29th August 2022 5 Comments

Hi Nikolas,

This is possible using the Automation script engine in DataMiner. You can create an automation script that uses a C# action to read the user's phone number (assuming it's available in the Active Directory for said user):

var userFullName = engine.SendSLNetSingleResponseMessage(new GetUserFullNameMessage()) as GetUserFullNameResponseMessage;

var userInfo = engine.SendSLNetSingleResponseMessage(new GetInfoMessage(InfoType.SecurityInfo)) as GetUserInfoResponseMessage;

var currentUser = userInfo.Users.FirstOrDefault(u => u.FullName == userFullName.User);

engine.GenerateInformation("Current user's phone is " + currentUser.PhoneNumber);

Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 13th July 2023
Nikolas Boatright commented 29th August 2022

What namespace needs to be included for GetUSerFullNameMessage and GetUserFullNameResponseMessage? An error gets thrown on those.

Gellynck Jens [SLC] commented 29th August 2022

using Skyline.DataMiner.Net.Messages

Nikolas Boatright commented 29th August 2022

almost there.
Now I get an error about the FirstOrDefault

The following was returned from the script:
(after retries) (Code: 0x80040251) Skyline.DataMiner.Net.Exceptions.DataMinerException: No Assembly found for cookie 3
(86,30): error CS1061: ‘DataMinerUser[]’ does not contain a definition for ‘FirstOrDefault’ and no accessible extension method ‘FirstOrDefault’ accepting a first argument of type ‘DataMinerUser[]’ could be found (are you missing a using directive or an assembly reference?)

Gellynck Jens [SLC] commented 29th August 2022

That method is located in de System.Linq namespace

Nikolas Boatright commented 31st August 2022

It appears that currentUser is null.
userInfo returns: User Info: 12 User(s), 3 Group(s).
Accessing the next line (currentUser) returns blank. If I try to access the member PhoneNumber like in your example, I get a Null Reference Exception.

You are viewing 1 out of 1 answers, click here to view all answers.
Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas
Privacy Policy • Terms & Conditions • Contact

© 2025 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs

[ Placeholder content for popup link ] WordPress Download Manager - Best Download Management Plugin