Saturday 20 June 2020

Update Missing Group Owner Attribute in MIM

[cmdletbinding()]           
param()
Set-ResourceManagementClient -BaseAddress “http://TEST-MIM.test.com:5725”
$MIMGroups = Get-Content C:\Temp\ADGroups.txt
foreach ($MIMGroup in $MIMGroups) {
$og = get-resource -ObjectType "Group" -AttributeName "AccountName" -AttributeValue "$MIMGroup"
$owner = $og.Owner | Select-Object -ExpandProperty value -First 1
$og.DisplayedOwner = "$owner"
Save-Resource $og
}

Microsoft Identity Manager Group Report

 # Microsoft Identity Manager Group Report

[cmdletbinding()]           
param()

# Connect MIM Identity Manager

Set-ResourceManagementClient -BaseAddress “http://Mim.test.com:5725”

# List of AD Groups from specific OU.

$MIMGroups = Get-ADGroup -Filter * -SearchBase "OU=Test-MIM,DC=Test,DC=com" -Properties * | Select-Object -ExpandProperty SamAccountName

# Check each Group Attribute one at time

foreach ($MIMGroup in $MIMGroups) {

# Check Group Attribute from Metaverse and store value into Variable

$og = get-resource -ObjectType "Group" -AttributeName "AccountName" -AttributeValue "$MIMGroup"

# Create Powershell Object and extract specific attribute from Og variable

 $obj = New-Object -Type PSObject -Property (           
  @{           
   "AccountName"  = $og.AccountName;           
   "DisplayName" = $og.DisplayName;
   "AuthoritativeDirectory" = $og.AuthoritativeDirectory;           
   "DisplayedOwner" = $og.DisplayedOwner;
   "Owner" = $og.Owner
  }           
 )

# Export values into excel
         
 $Obj |Select-Object AccountName,DisplayName,AuthoritativeDirectory,@{Name="DisplayedOwner";e={$_.DisplayedOwner -join ","}},@{Name="Owner";e={$_.Owner -join ","}} | export-csv c:\temp\AllADGroups.csv -notypeinformation -Encoding UTF8 -Append       
}