lithnet / resourcemanagement-powershell

Lithnet FIM/MIM Service PowerShell Module
MIT License
37 stars 12 forks source link

Need help creating group #4

Closed Keldandorin closed 8 years ago

Keldandorin commented 8 years ago

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?

ryannewington commented 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.

Keldandorin commented 8 years ago

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?

Keldandorin commented 8 years ago

Found the issue I forgot to add the DisplayedOwner value to the Group. Thx alot for your great module

ryannewington commented 8 years ago

No worries. Glad you got it working.

Keldandorin commented 7 years ago

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

Keldandorin commented 7 years ago

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.

raykarim93 commented 3 years ago

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

Keldandorin commented 3 years ago

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