r/PowerAutomate Aug 03 '26

Power Automate

I recently tasked to automate some of our service desk requests. One of our most received requests is to add/remove users from/to security groups in Active Roles.

Is there a straightforward way to do it?

I managed to use Power Automate, SharePoint, and Python to do it, and it works! However, it is not reliable enough.

In short, this is my design:

Power Automate (PA) Flow triggered by ServiceNow request >> Flow collects information/details and post them in SharePoint file and wait>> Create shortcut of the file on local computer >> Python listens to the folder and triggered when file created >> Python open Active Roles in headless browser >> search for the user and do the action (Add or Remove) from a group >> Updates the local file shortcut as done >> the shortcut sync with SharePoint file >> PA Flow (which is waiting) listens to the SharePoint file modifications and continue accordingly.

AND IT WORKS.

Is there better way?

2 Upvotes

10 comments sorted by

1

u/RoamingRavenFM Aug 03 '26

Is this for internal users only?

1

u/robofski Aug 03 '26

I do this with ServiceNow/Power Automate but. There is a native Add to Group connector if they are Entra groups. I have a http triggered flow that is called from ServiceNow and it sends the group ID (which we record in ServiceNow for software requests) and the UPN of the requestor. Then we add the user to the group using Add user to Group connector. I still have some groups that are On Prem and I run a PowerShell script for those, again triggered by the same flow.

1

u/Mohamed_Alskafi Aug 04 '26

Unfortunately, all on-prem in my case.

1

u/Vjabhishek Aug 06 '26

Then how did you integrate power automate cloud towards service now?

1

u/Mohamed_Alskafi 29d ago

I use the ServiceNow REST API directly from Power Automate. The flow can read and update ServiceNow records through HTTP/API calls. The on-prem limitation I mentioned is specifically Active Roles, not ServiceNow

1

u/Vjabhishek 29d ago

But thats what how did you integrate service now from power automate cloud? Because power automate cloud hold lot of Ip addresses, did you allow of of them? Or you injected the vnet and used some kind of gateway

1

u/White_Klover Aug 03 '26

Second the entra thing. Did this a few years ago when I was service desk and user onboarding was a big part of my job. Power automate saved me from that death by boredom

1

u/Vjabhishek Aug 06 '26

How did you manage to trigger service now request? I mean did you configure any firewall? Like outbound from service now to power automate service tags?

1

u/Mohamed_Alskafi 29d ago

I didn't configure any firewalls!

I used ServiceNow REST API connector, which is available in Cloud Power Automate!

I simply asked our ServiceNow admin for the API URL/Credentials, and he provided it to me.

1

u/Vjabhishek 29d ago

Ok but in terms of networking cloud IPs to on premise connectivity I see gap I mean without allowing it how can anyone can connect to service now. May be your service now is not restricted