Jump to content
Sign in to follow this  
support

Adding a AD account which is set up for automatic resets

Recommended Posts

This post describes how to set up an Active Directory account in Passwordstate, configured for Automatic Resets:

 

Powershell Script:

 

$PasswordstateAPIURL = "https://fabrikam.com/api/passwords"
    
    $jsonString = '
{
    "PasswordListID":"9914",
    "Title":"SCCM Service Account",
    "Username":"sccm_admin",
    "GeneratePassword":"False",
    "Password":"Welcome01",
    "APIKey":"63fca2537db89e4fb329546d7e83cab6",
    "ValidatewithPrivAccount":"False",
    "AllowExport":"True",
    "PasswordResetEnabled":"True",
    "EnablePasswordResetSchedule":"True",
    "PasswordResetSchedule":"23:00",
    "AccountTypeID":"82",
    "ADDomainNetBIOS":"fabrikam",
    "PrivilegedAccountID":"2",
    "HeartbeatEnabled":"True",
    "ValidationScriptID":"9",
    "HeartbeatSchedule":"10:00"    
}
'
Invoke-Restmethod -Method POST -Uri $PasswordstateAPIURL -ContentType "application/json" -Body $jsonString

 

 

Pre-Requisites to get this script working:

 

An API key needs to be set on a Password List.  This can be achieved when adding or editing a Password List:

2017-11-08_8-58-11.png

 

You'll need to find the PasswordListID value, by toggling the Visibility of the Web API IDs:

2017-11-08_8-58-36.png

 

Next you'll need to find the AccountTypeID for Active Directory under Administration -> Images and Account Types:

2017-11-08_9-01-43.png

 

 

Next find the Validation ScriptID for Active Directory Accounts under Administration -> Powershell Scripts -> Password Validation:

2017-11-08_9-07-03.png

 

And the ID of your Privileged account, which has permissions in AD to reset Accounts:

2017-11-08_9-08-46.png

 

 

If you insert these values into your script, along with any other string values like the Title or username, it will add a record in to the system as expected.

 

 

 

 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...