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

Is it possible to use Regex to force a edit box parameter value to a specific format? Forcing a user to input an alphanumeric as (###) ###-####

asked Nov 22 by msheppard (610 points)
0 votes
1 answer

I have a scheduled task that runs the following PowerShell script. $user = New-AdmUser -Server $domain -AdaxesService localhost -Path $workdayDn -ChangePasswordAtLogon $true -PassThru - ... ) over all objects. I'm stumped! Any help would be super appreciated.

asked Sep 5 by emeisner (100 points)
3,588 questions
3,277 answers
8,303 comments
548,092 users