Quantcast
Channel: Forum Microsoft Identity Manager
Viewing all articles
Browse latest Browse all 1783

MIMWAL: Powershell Add-ADGroupMember

$
0
0

Hi, 

I'm currently trying to add new users to some default AD groups (that i haven't yet imported into MIM fully), so i'm looking at using the MIMWAL Powershell activity. 

I've written and tested the following script which works when i run it from the server:

param
(
	[parameter(mandatory = $true)] $user
)

$group1 = "Group1"
$group2 = "Group2"
$group3 = "Group3"
$group4 = "Group4" 
$group5 = "Group5"


Add-ADGroupMember -Identity $group1 -Members $user
Add-ADGroupMember -Identity $group2 -Members $user
Add-ADGroupMember -Identity $group3 -Members $user
Add-ADGroupMember -Identity $group4 -Members $user
Add-ADGroupMember -Identity $group5 -Members $user

but when i try run it in the MIMWAL workflow (flowing [//Target/AccountName] to $user), i get the following error:

WAL (2.18.0318.0): 08/20/2019 15:31:00.1703: <>c : <SetupStreamEventHandlers>b__68_0: The term 'Add-ADGroupMember' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

I've read somewhere that MIMWAL uses powershell 2.0 commands, but i thought (perhaps wrongly) that Add-ADGroupMember was added in 2.0.

I have tried adding "import-module activedirectory" to the scriptblock in the workflow,but that gives the following error:WAL

(2.18.0318.0): 08/20/2019 15:38:46.0605: <>c : <SetupStreamEventHandlers>b__68_0: The 'C:\windows\system32\WindowsPowerShell\v1.0\Modules\activedirectory\activedirectory.psd1' module cannot be imported because its manifest contains one or more members that are not valid. The valid manifest members are ('ModuleToProcess', 'NestedModules', 'GUID', 'Author', 'CompanyName', 'Copyright', 'ModuleVersion', 'Description', 'PowerShellVersion', 'PowerShellHostName', 'PowerShellHostVersion', 'CLRVersion', 'DotNetFrameworkVersion', 'ProcessorArchitecture', 'RequiredModules', 'TypesToProcess', 'FormatsToProcess', 'ScriptsToProcess', 'PrivateData', 'RequiredAssemblies', 'ModuleList', 'FileList', 'FunctionsToExport', 'VariablesToExport', 'AliasesToExport', 'CmdletsToExport'). Remove the members that are not valid ('HelpInfoUri'), then try to import the module again.

At line:1 char:14     + import-module <<<<  activedirectory

Has anyone else come across this issue before?


Viewing all articles
Browse latest Browse all 1783

Trending Articles