wsadmin script/command arguments to modify auth data entries - scripting

Can someone help me how i can update an authentication data entry using wsadmin without logging into was console as i have too many data sources and doing them manually is a time taking procedure. Below is the far that i can get to. Not sure how to use the arguments. Thanks for your help in advance.
wsadmin>$AdminTask help modifyAuthDataEntry
WASX8006I: Detailed help for command: modifyAuthDataEntry
Description: Modify an authentication data entry
Target object: None
Arguments:
securityDomainName - Name used to uniquely identify the security domain.
*alias - The alias of the auth data.
user - The username of the auth data.
password - The password of the auth data.
description - The description of the auth data.
Steps:
None
wsadmin>

Modify authData with:
AdminTask.modifyAuthDataEntry('[-alias myAlias -user myUser -password myPassword -description "my alias description" ]')
In general, to learn the wsadmin command for a given Admin Console operation which you know how to perform, you can use the command assistance function to capture the equivalent last wsadmin scripting command.

Related

How to Get the credentials object without prompt using powershell

I am using the below command,
$SQLServerPSCred = Get-Credential
to get the credential object.
How can I get the Creds object without the Prompt?
I have tried below code, but it is failing.
$SQLServerPSCred = New-Object System.Management.Automation.PSCredential -ArgumentList $UserName, $Password
You haven't included much information about what your actual problem with the code is. it's correct that you're prompted with your first example. As you explicitly tell it to ask you.
With your second example it's incomplete.
PowerShell – How to create a PSCredential object by koteshblog has an example on how to do it:
$secpasswd = ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force
$mycreds = New-Object System.Management.Automation.PSCredential ("username", $secpasswd)
As you can see you first need to convert the password into a SecureString which you can pass to the credential object. It also shows a slightly different syntax but that shouldn't matter.
Depending on what you're doing and where that script resides it can also be worth it to look into some form of "more secure" storage for your secrets. As it is everyone who would have access to the script could extract the username and password from it.
One option is to store the secure string. But keep in mind a secure string is somewhat tied to the users. So You won't be able to easily just pass along a text file that contains the password.
For an example on how to do that check Powershell Tip – Storing and Using Password Credentials by robcost. It's a basic solutions there might be better ones available depending on your needs.

changing password ldapmodify over SSL to AD 2008 R2 fails with 0000052D: SvcErr: DSID-031A1248, problem 5003 (WILL_NOT_PERFORM)

When attempting an ldapmodify to set the unicode password (with the correct encoding) over SSL(636), the operation fails and Active Directory returns the following error code:
0000052D: SvcErr: DSID-031A1248, problem 5003 (WILL_NOT_PERFORM), data
0
I found countless threads and answers on resolving WILL_NOT_PERFORM but I am hoping someone knows the meaning of the exact codes above.
Every other solution points to password complexity, min pw age before the modify, SSL requirement, encoding requirement, and some others.
We have set the min pw age to 0, ensured we met the pw complexity requirements, encoded in UTF16LE=>base64, submitted the operation over SSL with 256 bit encryption and trusted/verified certificates, and we still receive this message.
The ldapadds/modifies are being performed by an automated tool which has successfully worked on other AD 2008 R2 instances so we know the password reqs, encodings, and SSL requirements are satisfied by the tool. We also tested with manual ldapmodify via LDIF and receive the same message.
Can anyone shed some light on any other possible permission, bug, UAC related setting, or way to decrypt the exact error code above?
Any help would be greatly appreciated! :)
I could only guess about your environment setup, but try to perform these steps:
Check if this password really could be setup through AD interface on server
Ensure you wrap you password with double quotes before encoding (i.e. it should be "password", not password
Check if you use unicodePwd attribute to set the password
So my ldapmodify entry to set password to StrongPassword! looks like:
dn: CN=User,CN=Users,DC=corp,DC=example,DC=org
changetype: modify
replace: unicodePwd
unicodePwd:: IgBTAHQAcgBvAG4AZwBQAGEAcwBzAHcAbwByAGQAIQAiAA==
Note unicodePwd has two colons

(openldap) ldappasswd command doesn't work with uid, but does with cn=full name

I am attempting to add passwords to 1300 users in my OpenLDAP server for work.
I can add a password to a user if I utilize the following command
ldappasswd -s newpasswd -w adminpw -D "cn=admin,dc=school,dc=private" "cn=test user,dc=school,dc=private"
I have 1300+ people that I am adding passwords for though, and some users have duplicate names but different uids.
I do the following command when trying to use the UID but it doesn't find the user. The command is the same except for switching cn=test user for uid=testu.
ldappasswd -s newpasswd -w adminpw -D "cn=admin,dc=school,dc=private" "uid=testu,dc=school,dc=private"
According to all of the guides I've seen online this should work. Why do I get a No such object (32) error?
Just to note I am working on a test server for the moment. The user is made up for test purposes. "cn=Test User" "uid=testu" "uidNumber=1001" The user is in the base of the ldap "dc=school,dc=private" There is one group called "People" with a gid=501
I used http://www.thegeekstuff.com/2015/02/openldap-add-users-groups/ for a guide along with https://www.digitalocean.com/community/tutorials/how-to-manage-and-use-ldap-servers-with-openldap-utilities#various-other-ldap-commands
I am an ldap novice when it comes to adding users/modifying them, but I did build the servers, did set up replication between them and added
TLS encryption for them.
Each LDAP entry is a collection of attributes which are name-value pairs. Usually, you pick a single attribute in the form name=value as the Relative Distinguished Name (RDN) of the entry. Wisely, you pick an attribute with a unique value.
All entries are nodes in a Directory Information Tree (DIT). The path to an entry consists of a sequence of RDNs joined by commas in leaf-to-root (left-to-right) order by convention. This path is called Distinguished Name (DN) and is used to identify the user in the DIT.
As you chose the RDN to be cn=test user you can't address the user with DN uid=testu, dc=school, dc=private, even though an attribute uid with value testu is part of the user entry.

LDAP simple bind parameters

I am trying to use ldap for a flask application .
The app.config['LDAP_PROVIDER_URL'] = 'ldaps://appauth.corp.domain.com:636'
(I have replaced the domain for the original name here)
In another script in need the following ldap details
conn.simple_bind_s(
'cn=%s,ou=Users,dc=corp,dc=domain,dc=com' % username,
password
)
How do I find the OU,or can i ignore OU and drop it from above. Please let me know if other parameters are correct. I don't know LDAP
The general idea is that you bind as an application account with search privileges to locate the user account, e.g. by his email address, displayName, etc., and then use that DN to rebind using the password he supplied.

What is available for Roundhouse Token Replacement?

We're using Roundhouse to deploy our databases and keep versions for SQL Server (2008+)
I have a script which grants permissions and needs to have a username passed in. I know there is support for token replacement in Roundhouse, but the only token I've seen mentioned is {{database}}.
What built-in tokens are available?
Can users define their own tokens? Is so how?
At this time ONLY the items in the configuration - https://github.com/chucknorris/roundhouse/wiki/ConfigurationOptions
Note the full name of the option when using token replacement:
-d, --db, --database, --databasename=VALUE | REQUIRED: DatabaseName - The database you want to create/migrate.
-c, --cs, --connstring, --connectionstring=VALUE | REQUIRED: ConnectionString - As an alternative to ServerName and Database - You
can provide an entire connection string instead.
It's the bolded name, e.g. "{{DatabaseName}}" or "{{ConnectionString}}" from the examples above.