Calling NetUserGetGroups from PowerBuilder,
Does anyone have a working example of how to call this from PowerBuilder?
Thanks in advance.
Calling NetUserGetGroups from PowerBuilder,
Does anyone have a working example of how to call this from PowerBuilder?
Thanks in advance.
This is great John, thank you.
This will make life easier....
I am having one issue with your code though. When declaring the external functions I receive two errors.
REF os_group_users_info_1 dest
REF os_group_users_info_0 dest
Both produce errors complaining about unknown data type, I searched your code and can not find these referenced anywhere else? I am using Windows 10 PB2022 R3. Any thoughts? Thank you.
In case anyone following this thread is interested, I have figured out how to call the NetUserGetGroups Windows API function from PB and obtain the results. Had a little problem getting it to work in 64-bit, but it is working now. The small attached app contains a non-visual object to obtain the information and the window illustrates how to use the NVO.
Thanks Armeen
Thank you Chris
Hi David;
Here are the various functions in the "nc_active_directory_master" Custom User Object within the STD Framework for AD interaction ...
Regards .. Chris
Hi Chris,
Thanks for this. Can you point me to the location in the code where you retrieve the AD groups that are granted to a user please?
I have done some searching on NetUserGetGroups and did not find it, this is the call I was expecting to see.
Thank you.
Hi John,
The user will be running a PowerServer application. I need to check if the user is in a particular Active Directory group in the app before letting them proceed to connect to a particular environment.
Thanks for your help
Hi David;
My STD Framework has all the AD interaction capabilities built in. Here is a presentation that I gave at a PB conference that explains how it works...
https://sourceforge.net/projects/stdfndclass/files/Presentations/Active%20Directory
BTW: the framework is free & open source so please adapt any code that helps you in this quest.
Regards... Chris
Hi, David -
It appears that you and Ed are doubling up on this question (which really isn't necessary, by the way), so I will repeat this response in the other thread.
I've never called this WinAPI function before, but in looking at the Windows documentation, it looks like it can be called with null arguments, and this affects how the function is called from PB. Therefore, I have a couple of questions:
1. Are you wanting to run this function on the local server (where the app is running) or on a remote (non-local) server?
2. Are you wanting only the names of the groups (the GROUP_USER_INFO_0 structure) or the names and attribute flags (the GROUP_USER_INFO_1 structure)?
I'm willing to try and figure out how to get the information into a PB app once I hear back from you, but please know that I have a limited amount of free time at home in the evening in which to tackle this, as my employer understandably does not want to pay me for working on other people's problems. Once I hear back from either/both of you, I'll see what I can come up with.
Best regards, John
Apologies for the late response, as I have driving to another state to attend a wedding.
Both structures are internal, local object structures defined and contained within the non-visual object (the “os_” prefix is Hungarian notation for “object structure”).
If you are not familiar with the mechanics on how to view an object structure in the Painter, just Edit Source and you’ll see their definitions near the top of the source code. Both structures are very simple, but the member data types must be as I have coded them for them to work in 64-bit (PowerServer).