Microsoft AD Spoke - Update Object/Group Action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2023 11:36 AM
I want to update an Active Directory object in Flow Designer but, there is no such action in the Microsoft AD spoke. Specifically, I want to update the description and manager of a group object. There are actions to create group, delete group and lookup group, but no update action. Has anyone developed an action to accomplish this deed?
- Labels:
-
Flow Designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2024 11:40 AM
I had a similar requirement to update a group attribute. I had to create a custom action that ran a Powershell script to update the object.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2025 04:09 AM
Hi NBeheydt,
Assuming your powershell script solution is working, any chance you could share the steps you took to achieve this and the script used?
Thanks
Andy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2025 04:49 AM
Our requirement was to update the AD object GID. Here is the Powershell script. You can probably ignore the code regarding the RID as that was a specific requirement based on how we set this value.
# Retrieve the group object from Active Directory
$Group = Get-ADGroup -Filter {samAccountName -eq $GroupName} -Properties objectSid -Credential $cred -Server $computer
if ($Group) {
# Extract the RID from the objectSid property
$RID = $Group.objectSid.Value.Substring($Group.objectSid.Value.LastIndexOf("-") + 1)
Write-Host "$GroupName;$($Group.SID);$RID"
$GIDNUM = 1000000000 + $RID
# Write-Host "Set-ADGroup $GroupName -Replace @{ gidNumber=$GIDNUM}"
Set-ADGroup $GroupName -Replace @{gidNumber=$GIDNUM}
} else {
Write-Host "Group not found: $GroupName $Group"
}
Then created a custom flow Action that runs the script and outputs (true/false) whether the script ran successfully to update the object.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2025 05:15 AM
Hi,
script looks good thank you - I need a little help to confirm what the custom flow action looks like - would you mind sharing that too please?
Thanks