0 votes

Hello

I'm trying to pass another credential than the initiator, to add a member to a group.

$Server = $Context.GetObjectDomain("%distinguishedName%")
$Secpasswd = ConvertTo-SecureString "VeryWeakPassword" -AsPlainText -Force
$Credential = New-Object System.Management.Automation.PSCredential ("shadowuser@mydiom.local", $Secpasswd)
Add-AdmGroupMember -Identity "TheGroup" -Members "JohnDoe" -AdaxesService localhost -Server $Server -Confirm:$False -Credential $Credential

The user is added to the group allright, but I get this error:

"Cannot process argument transformation on parameter 'Credential'. Cannot invoke this function because the current host does not implement it."

- Thanks

by (2.6k points)

Please log in or register to answer this question.

Related questions

0 votes
1 answer

Hi, I'm trying to add a column to a report to retrieve the last login data from AAD/Graph using the script posted here but i'm running into the ... [0].signInActivity.lastSignInDateTime # Assign a column value to $Context.Value $Context.Value = $lastLogonDate

asked Feb 22, 2022 by richarddewis (260 points)
0 votes
1 answer

Hi everyone, we're getting the below error when enabling a user for Lync: Connecting to remote server failed with the following error message : WinRM cannot process the request ... box' Lync enablement feature. Any ideas what might be going on? Thanks again!

asked Dec 6, 2013 by EgotisticalGiraffe (350 points)
0 votes
1 answer

My company has 400+ positions, each with different access levels in our Active Directory (AD). I want to automate the new user onboarding process as much as ... time-consuming than creating over 400 custom commands. Any assistance would be greatly appreciated.

asked Sep 26, 2023 by sysadmin (20 points)
0 votes
1 answer

We are attempting to use the member property in a powershell script for all groups. We get this error message on certain groups that are used as "primary". If we set another ... just shows the single member in the group in which the group is not the primary.

asked Feb 19, 2020 by mark.it.admin (2.3k points)
0 votes
1 answer

Hello, I think I might have found a regression. Starting 2014.1 it is impossible to change the reply address for a user having an Exchange 2003 mailbox. The button "Set ... related to my authorizations; I did test various configuration (admin, ...). Regards,

asked May 2, 2014 by Pierre (750 points)
3,347 questions
3,048 answers
7,788 comments
545,035 users