0 votes

I am getting the following error...

The type initializer for 'System.Management.Automation.PSCredential' threw an exception.

The term 'Get-AdmUser' 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.

My powershell scripts have been working for months and then suddenly... BOOM! They started throwing this error.

by (360 points)
0

Here is the script that I have been using to strip group memberships as part of our Account Move process.

Import-Module Adaxes
    $user = Get-AdmUser "%distinguishedName%" -Properties MemberOf
    if ($user.MemberOf -ne $Null)
    {
        foreach ($groupDN in $user.MemberOf)
        {
            Remove-AdmGroupMember $groupDN -Members $user  -Confirm:$False
        }
    }
0

Hello,

Did you reinstall or upgrade Adaxes lately? If you did, did you also install Adaxes PowerShell module? It is not installed by default, it is an optional component.

How to install

0

Adaxes has been running fine for the last 6 month or more. No modifications were made to it. It just quit working.

1 Answer

0 votes
by (215k points)
selected by
Best answer

Hello,

We noticed that you receive the following error: The type initializer for 'System.Management.Automation.PSCredential' threw an exception. It can occur because of a bug in .Net Framework 3.5. Try restarting your Adaxes service. This should resolve the issue.

0

That actually resolved my issue! Thank you! I guess I will need to remember to restart the service when I get script errors.

Related questions

0 votes
1 answer

I would like users to use Adaxes to add themselves or others to a group, but instead of it just working, it has to go thru an approval process and be approved by the group owner before they are added. Thanks!

asked Jun 30, 2021 by RayBilyk (180 points)
0 votes
1 answer

Some of our users don't log on to AD ever therefore does not give us a true user picture?

asked Jun 4, 2021 by marcwoollard (40 points)
0 votes
1 answer

Is there a way to get the name of the user who approved a request and supply that to a step inside of a custom command? For example, HR submits a status change for an employee. ... and pass it as a param in a custom command that is called in one of the steps?

asked May 12, 2021 by davfount90 (20 points)
0 votes
1 answer

Hi, I know there probably better places for this question but since I need to use Get-AdmUser I was wondering if you could help me build a Filter to find all ... automatically send a report every month but we need to narrow it down Thanks in advance Ingemar

asked Sep 15, 2015 by ijacob (960 points)
0 votes
1 answer

I know I got this code to check for a unique email address from you guys, just can't find where Import-Module Adaxes if ($Context.IsPropertyModified("mail")) { $value = ... all the targeted type of objects under Adaxes' purview? Thanks again for the help!!!

asked Mar 25, 2013 by jiambor (1.2k points)
2,733 questions
2,469 answers
6,460 comments
1,336,485 users