Closed Keldandorin closed 8 years ago
Owner is a reference attribute and needs to point to the guid of another object. Something like this should work.
$owner = Get-Resource Person DisplayName Keldandorin
$GroupModify = New-Resource -ObjectType Group
$GroupModify.AccountName = "test"
$GroupModify.Owner = $owner
$GroupModify.DisplayName = "test"
$GroupModify.Scope = 'Global'
$GroupModify.Type = 'Security'
$GroupModify.Domain = 'INTRANET'
$GroupModify.Description = "test"
$GroupModify.MembershipLocked = $false
$GroupModify.MembershipAddWorkflow = 'Owner Approval'
Also, membershipLocked should be a boolean value.
Thx, for Quick awnser. Got alitle longer this time but still get error, This time its Save-Resource : Policy prohibits the request from completing. I'm loged on as MIM Admin but is there anything else that need to be enabled in MIM for this to work?
Found the issue I forgot to add the DisplayedOwner value to the Group. Thx alot for your great module
No worries. Glad you got it working.
Hi again, Is it possible to ad more then one Owner to a group and how? Tryed doing this but it dosent seems to work
$MIMOwner = Get-Resource -ObjectType Person -AttributeName AccountName -AttributeValue $Owner
$MIMGroup = Get-Resource -ObjectType Group -AttributeName AccountName -AttributeValue $GroupName;
$MIMGroup.Owner = $MIMOwner
Save-Resource $MIMGroup
I'm to fast asking...figured it out myself :) how to add. Replacing existing users as I do in my previus post dosent work though for some reason.
Hi again, Is it possible to ad more then one Owner to a group and how? Tryed doing this but it dosent seems to work
Get Owner
$MIMOwner = Get-Resource -ObjectType Person -AttributeName AccountName -AttributeValue $Owner
Get Group Objekt in MIM
$MIMGroup = Get-Resource -ObjectType Group -AttributeName AccountName -AttributeValue $GroupName;
Add owner
$MIMGroup.Owner = $MIMOwner
Save Group
Save-Resource $MIMGroup
Hi @Keldandorin, I am having the same issue. Did you use an array to solve this?
Thanks
Hi again, Is it possible to ad more then one Owner to a group and how? Tryed doing this but it dosent seems to work
Get Owner
$MIMOwner = Get-Resource -ObjectType Person -AttributeName AccountName -AttributeValue $Owner
Get Group Objekt in MIM
$MIMGroup = Get-Resource -ObjectType Group -AttributeName AccountName -AttributeValue $GroupName;
Add owner
$MIMGroup.Owner = $MIMOwner
Save Group
Save-Resource $MIMGroup
Hi @Keldandorin, I am having the same issue. Did you use an array to solve this?
Thanks Hi @raykarim93 Array of owners
$Oldowners = $MIMGroup.Owner $NewOwners = $Oldowners + $MIMOwner.ObjectID $MIMGroup.Owner = $NewOwners
Trying to create a Group but get error Request could not be dispatched. Here is Powershell
$GroupModify = New-Resource -ObjectType Group $GroupModify.AccountName = "test" $GroupModify.Owner = "Keldandorin" $GroupModify.DisplayName = "test" $GroupModify.Scope = 'Global' $GroupModify.Type = 'Security' $GroupModify.Domain = 'INTRANET' $GroupModify.Description = "test" $GroupModify.MembershipLocked = 'False' $GroupModify.MembershipAddWorkflow = 'Owner Approval'
Save-Resource $GroupModify What I'm I doing wrong?